diff options
Diffstat (limited to 'modules-available')
-rw-r--r-- | modules-available/dnbd3/templates/page-serverlist.html | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/modules-available/dnbd3/templates/page-serverlist.html b/modules-available/dnbd3/templates/page-serverlist.html index c5a1337a..5ec3f5f9 100644 --- a/modules-available/dnbd3/templates/page-serverlist.html +++ b/modules-available/dnbd3/templates/page-serverlist.html @@ -444,11 +444,11 @@ document.addEventListener('DOMContentLoaded', function () { hiddenProp = null; } var formatBytes = function(bytes) { - if (bytes < 1024) return bytes.toFixed(0) + ' B'; - if (bytes < 1048576) return (bytes / 1024).toFixed(0) + ' KiB'; - if (bytes < 1073741824) return (bytes / 1048576).toFixed(1) + ' MiB'; - if (bytes < 1099511627776) return (bytes / 1073741824).toFixed(2) + ' GiB'; - return (bytes / 1099511627776).toFixed(2) + ' TiB'; + if (bytes < 1024) return bytes.toFixed(0) + '\u2009B'; + if (bytes < 1048576) return (bytes / 1024).toFixed(0) + '\u2009KiB'; + if (bytes < 1073741824) return (bytes / 1048576).toFixed(1) + '\u2009MiB'; + if (bytes < 1099511627776) return (bytes / 1073741824).toFixed(2) + '\u2009GiB'; + return (bytes / 1099511627776).toFixed(2) + '\u2009TiB'; }; var calcBackgroundStyle = function(speed) { const colors = ['#eee', '#cfc', '#6f6', '#bc3', '#f00', '#f88']; @@ -489,6 +489,12 @@ document.addEventListener('DOMContentLoaded', function () { } history.push(speedSum); while (history.length > 500) history.shift(); + for (k in lastSpeedList) { + if (!elist[k]) { + $('#upspeed-' + k).text('???').css('background', '#aaa'); + $('#clientcount-' + k).text('-'); + } + } lastSpeedList = elist; updateGraph(); }); @@ -532,7 +538,7 @@ document.addEventListener('DOMContentLoaded', function () { const BAR_COLOR = '#999'; part.reverse(); gctx.fillStyle = BAR_COLOR; - gctx.font = "10pt Arial"; + gctx.font = "9pt Arial"; gctx.textBaseline = 'top'; for (i = 0; i < part.length; ++i) { var x = graph.width - i*10; |