summaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
authorSimon Rettberg2019-04-01 17:38:04 +0200
committerSimon Rettberg2019-04-01 18:15:42 +0200
commita1443c8057541bf5589f9fd830e8a76565fd6127 (patch)
tree22d6f76b3c3c8460bb9a26f37713845446ee417a /script
parent[serversetup-bwlp-ipxe] imgfree on localboot (diff)
downloadslx-admin-a1443c8057541bf5589f9fd830e8a76565fd6127.tar.gz
slx-admin-a1443c8057541bf5589f9fd830e8a76565fd6127.tar.xz
slx-admin-a1443c8057541bf5589f9fd830e8a76565fd6127.zip
[main] Incorporate taskmanager callbacks into slx-fixes.js
Diffstat (limited to 'script')
-rw-r--r--script/slx-fixes.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/script/slx-fixes.js b/script/slx-fixes.js
index 925ac44f..29f52449 100644
--- a/script/slx-fixes.js
+++ b/script/slx-fixes.js
@@ -87,3 +87,20 @@ $(document).ready(function() {
};
$('button[data-confirm]').click($function);
});
+
+// Taskmanager callbacks for running tasks
+$(document).ready(function() {
+ var slxCbCooldown = 0;
+ function slxCheckCallbacks() {
+ $.post('api.php?do=cb', { token: TOKEN }, function(data) {
+ if ( data.indexOf('True') >= 0 ) {
+ slxCbCooldown += 1;
+ } else {
+ slxCbCooldown += 10;
+ }
+ if (slxCbCooldown < 30)
+ setTimeout(slxCheckCallbacks, slxCbCooldown * 1000);
+ }, 'text');
+ }
+ slxCheckCallbacks();
+});