diff options
author | Simon Rettberg | 2019-12-13 15:34:11 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-12-13 15:34:11 +0100 |
commit | f3fd8875531430caad3bc90a95254611ca7a2cae (patch) | |
tree | 2b811e4fc9a62364bd05ddad6875f468aa0214ca /modules-available/rebootcontrol/clientscript.js | |
parent | [statistics] Add NVMe support (diff) | |
download | slx-admin-f3fd8875531430caad3bc90a95254611ca7a2cae.tar.gz slx-admin-f3fd8875531430caad3bc90a95254611ca7a2cae.tar.xz slx-admin-f3fd8875531430caad3bc90a95254611ca7a2cae.zip |
[rebootcontrol] Longer cooldown for client status updates
Diffstat (limited to 'modules-available/rebootcontrol/clientscript.js')
-rw-r--r-- | modules-available/rebootcontrol/clientscript.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules-available/rebootcontrol/clientscript.js b/modules-available/rebootcontrol/clientscript.js index 80be2533..447072a0 100644 --- a/modules-available/rebootcontrol/clientscript.js +++ b/modules-available/rebootcontrol/clientscript.js @@ -1,13 +1,13 @@ -var stillActive = true; +var stillActive = 10; document.addEventListener('DOMContentLoaded', function() { var clients = []; $('.machineuuid').each(function() { clients.push($(this).data('uuid')); }); if (clients.length === 0) return; function updateClientStatus() { - if (!stillActive) return; - stillActive = false; - setTimeout(updateClientStatus, 5000); + if (stillActive <= 0) return; + stillActive--; + setTimeout(updateClientStatus, Math.max(1, 30 - stillActive) * 1000); $.ajax({ url: "?do=rebootcontrol", method: "POST", @@ -19,9 +19,9 @@ document.addEventListener('DOMContentLoaded', function() { return; for (var e in data) { $('#status-' + e).prop('class', 'glyphicon ' + data[e]); - if (!stillActive) $('#spinner-' + e).remove(); + if (stillActive <= 0) $('#spinner-' + e).remove(); } }); } - setTimeout(updateClientStatus, 1000); + setTimeout(updateClientStatus, 10); });
\ No newline at end of file |