summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2022-05-20 11:34:07 +0200
committerSimon Rettberg2022-05-20 11:34:07 +0200
commitc33807a3c1b7a9f5cf3a2e92e2bf88c242456db2 (patch)
tree4e2a6fd32b32df9c79c4cd87f04b7aa298d6f7f3
parent[dnbd3] Minor rendering tweaks, mark dead servers (diff)
downloadslx-admin-c33807a3c1b7a9f5cf3a2e92e2bf88c242456db2.tar.gz
slx-admin-c33807a3c1b7a9f5cf3a2e92e2bf88c242456db2.tar.xz
slx-admin-c33807a3c1b7a9f5cf3a2e92e2bf88c242456db2.zip
[dnbd3] graph: Keep running in background for a while
-rw-r--r--modules-available/dnbd3/templates/page-serverlist.html15
1 files changed, 8 insertions, 7 deletions
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);