summaryrefslogtreecommitdiffstats
path: root/modules-available/rebootcontrol
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/rebootcontrol')
-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