Skip to content
Snippets Groups Projects
Commit 4d9d8e44 authored by Nico's avatar Nico
Browse files

add refresh button

parent 0f6fc5d8
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
return time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds() return time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds()
} }
function refreshUpdates() { function refreshUpdates() {
$("#refresh").attr("disabled", true).text("refreshing...");
$.getJSON("/update_checker/data.json", function(data) { $.getJSON("/update_checker/data.json", function(data) {
var lastUpdate = new Date(data.timestamp * 1000) var lastUpdate = new Date(data.timestamp * 1000)
var lastFetch = new Date() var lastFetch = new Date()
...@@ -47,13 +48,14 @@ ...@@ -47,13 +48,14 @@
} else { } else {
downloadedOffline.append(line) downloadedOffline.append(line)
} }
$("#refresh").attr("disabled", false).text("refresh");
}) })
}) })
} }
$(document).ready(function() { $(document).ready(function() {
refreshUpdates() refreshUpdates()
window.setInterval(refreshUpdates, 60*1000) window.setInterval(refreshUpdates, 60*1000)
$("refresh").on("click", function() { refreshUpdates(); }) $("#refresh").on("click", function() { refreshUpdates(); })
}) })
</script> </script>
</head> </head>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment