Select Git revision
update_checker.html
update_checker.html 3.52 KiB
<!DOCTYPE html>
<html>
<head>
<title>Update Checker</title>
<meta charset="utf-8">
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<style type="text/css">
body { font-family: sans-serif; }
.green { color: green; }
.red { color: red; }
table { border-collapse: collapse; }
table td, table th { border: 1px solid #000; border-left:0; border-right:0 }
</style>
<script>
function formatTime(time) {
return time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds()
}
function refreshUpdates() {
$.getJSON("/update_checker/data.json", function(data) {
var lastUpdate = new Date(data.timestamp * 1000)
var lastFetch = new Date()
$("#lastUpdate").text(formatTime(lastUpdate) + " (fetch: " + formatTime(lastFetch) + ")")
var downloadedOffline = $("#downloadedOffline")
var downloaded = $("#downloaded")
downloadedOffline.empty()
downloaded.empty()
$.each(data["update_events"], function(k, upd) {
var line = $("<tr/>")
var maplink = "https://map.freifunk-stuttgart.de/#!/en/map/" + upd.mac.replace(/:/g, "").toLowerCase()
$("<td/>").append($("<a/>").text(upd.hostname).attr("href", maplink)).appendTo(line)
$("<td/>").text(upd.mac).appendTo(line)
$("<td/>").text(upd.from_release).appendTo(line)
$("<td/>").text(upd.to_release).appendTo(line)
$("<td/>").text(upd.model).appendTo(line)
var status = $("<td/>").text(upd.status)
if(upd.status) {
status.addClass("green")
} else {
status.addClass("red")
}
status.appendTo(line)
$("<td/>").text(upd.download_count).appendTo(line)
$("<td/>").text(upd.last_date).appendTo(line)
if (upd.status) {
downloaded.append(line)
} else {
downloadedOffline.append(line)
}
})
})
}
$(document).ready(function() {
refreshUpdates()
window.setInterval(refreshUpdates, 60*1000);
})
</script>
</head>
<body>
<h1>Update Checker</h1>
<p>Last update: <span id="lastUpdate">(never)</span></p>
<h2>Update downloaded and offline</h2>
<p>These nodes have downloaded a firmware update from the server, have never been observed running the updated firmware and are currently offline. It is not guaranteed they are offline because of the update. It could also mean they are running the new firmware fine, but they currently don't have a connection to the mesh or they were interrupted before installing the update etc.</p>
<table>
<tr>
<th>Hostname</th>
<th>MAC</th>
<th>From Version</th>
<th>To Version</th>
<th>Model</th>