Select Git revision
update_checker.html
update_checker.html 3.74 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() {
$("#refresh").attr("disabled", true).text("refreshing...");
$.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)
}
$("#refresh").attr("disabled", false).text("refresh");
})
})
}
$(document).ready(function() {
refreshUpdates()
window.setInterval(refreshUpdates, 60*1000)
$("#refresh").on("click", function() { refreshUpdates(); })
})
</script>
</head>
<body>
<h1>Update Checker</h1>
<p>Last update: <span id="lastUpdate">(never)</span> <button id="refresh">refresh</button></p>
<h2>Update downloaded and offline</h2>
<p>These nodes have downloaded a firmware update from the server, but 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>
<th>Status</th>
<th>Download Count</th>
<th>Date</th>
</tr>
<tbody id="downloadedOffline"></tbody>
</table>
<h2>Update downloaded</h2>
<p>These nodes have downloaded a firmware update from the server, but are still running the old firmware version. It is normal for a node to appear here for a short period of time. When a node stays in this state for more than 10-20 minutes, this usually means the node couldn't verify the update's signature and will try to re-download, increasing the number in the <em>Download Count</em> column. Common causes for this problem are unstable connections, but in rare cases it can also be an issue with the update package itself.</p>
<table>
<tr>
<th>Hostname</th>
<th>MAC</th>
<th>From Version</th>
<th>To Version</th>
<th>Model</th>
<th>Status</th>
<th>Download Count</th>
<th>Last Download</th>
</tr>
<tbody id="downloaded"></tbody>
</table>
</body>
</html>