summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
authorSimon Rettberg2019-12-13 15:34:11 +0100
committerSimon Rettberg2019-12-13 15:34:11 +0100
commitf3fd8875531430caad3bc90a95254611ca7a2cae (patch)
tree2b811e4fc9a62364bd05ddad6875f468aa0214ca /modules-available
parent[statistics] Add NVMe support (diff)
downloadslx-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')
-rw-r--r--modules-available/rebootcontrol/clientscript.js12
-rw-r--r--modules-available/rebootcontrol/templates/status-reboot.html2
-rw-r--r--modules-available/rebootcontrol/templates/status-wol.html2
3 files changed, 8 insertions, 8 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
diff --git a/modules-available/rebootcontrol/templates/status-reboot.html b/modules-available/rebootcontrol/templates/status-reboot.html
index 240c4387..7b46cab4 100644
--- a/modules-available/rebootcontrol/templates/status-reboot.html
+++ b/modules-available/rebootcontrol/templates/status-reboot.html
@@ -46,7 +46,7 @@
function updateStatus(task) {
if (!task || !task.data || !task.data.clientStatus)
return;
- stillActive = true;
+ stillActive = 25;
var clientStatus = task.data.clientStatus;
for (var uuid in clientStatus) {
if (!clientStatus.hasOwnProperty(uuid))
diff --git a/modules-available/rebootcontrol/templates/status-wol.html b/modules-available/rebootcontrol/templates/status-wol.html
index 3e83126c..0e91e8d8 100644
--- a/modules-available/rebootcontrol/templates/status-wol.html
+++ b/modules-available/rebootcontrol/templates/status-wol.html
@@ -47,6 +47,6 @@
<script><!--
function wolCallback(task) {
- stillActive = true;
+ stillActive = 25;
}
//--></script> \ No newline at end of file