mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-27 06:54:00 +00:00
Shutdown page will redirect to home after 30s to prevent additional reboot
This commit is contained in:
parent
86ee9c5dc4
commit
de70715210
|
@ -5,32 +5,7 @@
|
|||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
hasShutdown = 0
|
||||
|
||||
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);
|
||||
setInterval(checkStatus, 30000);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user