From c33807a3c1b7a9f5cf3a2e92e2bf88c242456db2 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 20 May 2022 11:34:07 +0200 Subject: [dnbd3] graph: Keep running in background for a while --- modules-available/dnbd3/templates/page-serverlist.html | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'modules-available/dnbd3/templates/page-serverlist.html') diff --git a/modules-available/dnbd3/templates/page-serverlist.html b/modules-available/dnbd3/templates/page-serverlist.html index 5ec3f5f9..b5588fc0 100644 --- a/modules-available/dnbd3/templates/page-serverlist.html +++ b/modules-available/dnbd3/templates/page-serverlist.html @@ -464,13 +464,14 @@ document.addEventListener('DOMContentLoaded', function () { var inactiveCount = 0; var updateSpeed = function() { if (hiddenProp && document[hiddenProp]) { - inactiveCount++; - return; - } - if (inactiveCount > 3) { - history.push(-1); + if (++inactiveCount > 30) + return; + } else { + if (inactiveCount > 30) { + history.push(-1); + } + inactiveCount = 0; } - inactiveCount = 0; $.ajax('?do=dnbd3&action=stats').done(function(elist) { var speedSum = 0; for (var k in elist) { @@ -548,7 +549,7 @@ document.addEventListener('DOMContentLoaded', function () { gctx.fillStyle = BAR_COLOR; } else { var v = Math.round((1 - part[i] / max) * 100); - gctx.fillRect(x - 10, v, 10, 100); + gctx.fillRect(x - 10, v, 9, 100); if (peakList[i]) { gctx.fillStyle = '#333'; gctx.fillText(formatBytes(part[i]) + "/s", x + 1, v); -- cgit v1.2.3-55-g7522