Shutdown page will redirect to home after 30s to prevent additional reboot

This commit is contained in:
Taylor Helsper 2019-12-18 21:47:18 -06:00
parent 86ee9c5dc4
commit de70715210

View File

@ -5,32 +5,7 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
hasShutdown = 0 setInterval(checkStatus, 30000);
function redirectHome() {
window.location.replace("/");
}
function checkStatus() {
var jqxhr = $.get("/settings/ping", function() {
if (hasShutdown) {
// Redirect to home
setTimeout(redirectHome, 2500)
}
})
.done(function() {
if (hasShutdown) {
// Redirect to home
setTimeout(redirectHome, 2500)
}
})
.fail(function() {
hasShutdown = 1
})
}
checkStatus()
setInterval(checkStatus, 2500);
}); });
</script> </script>