Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/serverinfo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2020-02-25 23:56:13 +0300
committerDaniel Kesselberg <mail@danielkesselberg.de>2020-02-25 23:56:13 +0300
commit0142f9f72eeeab0f712a0de28afaac1e04f175ee (patch)
treec25217f17dd8f9b756f5337aab556c988767a9e8 /js
parent79d013198606a63290fd32d932ff842534189138 (diff)
Enqueue next update after the last update is done
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'js')
-rw-r--r--js/script.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/js/script.js b/js/script.js
index 77670e9..6aad672 100644
--- a/js/script.js
+++ b/js/script.js
@@ -35,9 +35,6 @@
var x = document.getElementById('swapbox');
x.style.backgroundColor = 'rgba(100, 100, 100, 0.8)';
-
- var updateTimer = setInterval(updateInfo, 300);
-
resizeSystemCharts();
updateActiveUsersStatistics();
updateShareStatistics();
@@ -54,13 +51,17 @@
});
function updateInfo() {
- var url = OC.generateUrl('/apps/serverinfo/update');
-
- $.get(url).success(function (response) {
- updateCPUStatistics(response.system.cpuload);
- updateMemoryStatistics(response.system.mem_total, response.system.mem_free, response.system.swap_total, response.system.swap_free);
- });
+ const url = OC.generateUrl('/apps/serverinfo/update')
+
+ $.get(url).success(function(response) {
+ updateCPUStatistics(response.system.cpuload)
+ updateMemoryStatistics(response.system.mem_total, response.system.mem_free, response.system.swap_total, response.system.swap_free)
+ }).complete(function() {
+ setTimeout(updateInfo, 300)
+ })
}
+
+ setTimeout(updateInfo, 0)
});
$(window).resize(function () {