mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 04:49:36 -07:00
Better restart/shutdown refresh page polling
This commit is contained in:
parent
20e3eebd6a
commit
b76143116c
1 changed files with 24 additions and 27 deletions
|
@ -54,34 +54,31 @@
|
||||||
window.location.href = "${new_http_root}index";
|
window.location.href = "${new_http_root}index";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redirect to home page if page is available.
|
var online = true;
|
||||||
var checkOnline = setInterval(checkPageOffline, 1000);
|
|
||||||
|
|
||||||
function checkPageOffline() {
|
(function poll() {
|
||||||
$.ajax({
|
setTimeout(function () {
|
||||||
type: 'HEAD',
|
$.ajax({
|
||||||
url: 'index',
|
url: 'index',
|
||||||
timeout: 1000,
|
type: 'HEAD',
|
||||||
error: function () {
|
success: function () {
|
||||||
% if signal != 'shutdown':
|
if (!(online)){
|
||||||
clearInterval(checkOnline);
|
reloadPage();
|
||||||
setInterval(checkPageOnline, 1000);
|
}
|
||||||
% else:
|
},
|
||||||
reloadPage();
|
error: function () {
|
||||||
% endif
|
online = false;
|
||||||
}
|
% if signal == 'shutdown':
|
||||||
});
|
reloadPage();
|
||||||
}
|
% endif
|
||||||
function checkPageOnline() {
|
},
|
||||||
$.ajax({
|
complete: function () {
|
||||||
type: 'HEAD',
|
poll();
|
||||||
url: 'index',
|
},
|
||||||
timeout: 1000,
|
timeout: 1000
|
||||||
success: function () {
|
});
|
||||||
reloadPage();
|
}, 1000);
|
||||||
}
|
})();
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</%def>
|
</%def>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue