mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-25 05:58:06 +00:00
Shutdown will redirect to home if it comes back up
This commit is contained in:
parent
5a67cc2c62
commit
eeae60e9c1
|
@ -7,6 +7,38 @@
|
|||
<meta name="google" content="notranslate">
|
||||
<script src="{{ url_for('static', filename="js/jquery-3.3.1.min.js")}}"></script>
|
||||
<script src="{{ url_for('static', filename="js/mynode.js")}}"></script>
|
||||
|
||||
<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);
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
Loading…
Reference in New Issue
Block a user