diff options
| author | Ioannis Christoforidis | 2025-02-13 13:43:21 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2025-02-13 13:43:21 +0100 |
| commit | f46383ceb7e5f432096653b13ef81ae79606a1f8 (patch) | |
| tree | 2de3789139a79dae40579181959e75ae778097af /modules-available | |
| parent | [eventlog] Fix escaping of predefined rule (diff) | |
| download | slx-admin-f46383ceb7e5f432096653b13ef81ae79606a1f8.tar.gz slx-admin-f46383ceb7e5f432096653b13ef81ae79606a1f8.tar.xz slx-admin-f46383ceb7e5f432096653b13ef81ae79606a1f8.zip | |
[vmstore] Minor tweak to initial wait
Diffstat (limited to 'modules-available')
| -rw-r--r-- | modules-available/vmstore/templates/benchmark-result.html | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules-available/vmstore/templates/benchmark-result.html b/modules-available/vmstore/templates/benchmark-result.html index fce9533d..9af6da14 100644 --- a/modules-available/vmstore/templates/benchmark-result.html +++ b/modules-available/vmstore/templates/benchmark-result.html @@ -11,7 +11,6 @@ <script> document.addEventListener('DOMContentLoaded', function () { - // Is now available via $.get('?do=vmstore') .... var errorsFound = 0; // This is the list of clients we expect, so as long as there's less entries in result, we're not done yet var clients = {{{wanted}}}; @@ -22,6 +21,7 @@ var remaining = {{remaining}}; updateProgressBar(); var counter = 0; + var remainingInterval, getDataInterval; function formatBytes(val) { return Math.floor(val / 1024 / 1024) + "\u2009MiB/s"; @@ -57,8 +57,7 @@ $('#errors').html('No errors found in client data'); $('#errors').addClass('alert-success'); } - } else { - setTimeout(getData, 1000); + clearInterval(getDataInterval); } }) // .always( set timeout( ... 1000) ); } @@ -182,6 +181,7 @@ } function updateProgressBar() { + var progress; if (remaining > 0) { // reserve 80% of the progress bar for the initial "remaining" time // and 20% for the clients we receive @@ -194,7 +194,9 @@ $('#progress-clients').html(clients.length + ' Client(s) remaining'); } - setTimeout(getData, remaining > 0 ? remaining * 1000 : 500); + setTimeout(function() { + getDataInterval = setInterval(getData, 1000) + }, remaining > 0 ? remaining * 1000 - 1000 : 1); remainingInterval = setInterval(updateRemaining, 1000); }); </script> |
