From 3123b321c4a4cdfdf5ab38fbe85b63c4165d1eaa Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Thu, 3 Nov 2016 20:46:24 +0100 Subject: Drastically improving graphing and port drill-down - Nightmode - Aliases for sensible legends - Two layers of collapse on ports - Toggle/expand all feature to show graphs for all ports - Show human readable variant of very large numbers in port drill-down in addition to raw value (e.g.: 4800000000 (4.8G)) Still to do: - Ability to click on a stat to get graphs for it - Upgrade to graphite 0.9.15. Most of the following depends on that: - Use perSecond() instead of derivative() for traffic - Use SVG instead of PNG - Get rid of extra )'s in legends - Evaluate using SVG + CSS to get nightmode. Not sure if that'll work at all, as it depends on whether the SVG context is isolated or not from the DOM at large (e.g.: is #nightmode visible) - Consider generalizing graphs --- web/js/nms.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'web/js/nms.js') diff --git a/web/js/nms.js b/web/js/nms.js index 0b9fc73..36ff97f 100644 --- a/web/js/nms.js +++ b/web/js/nms.js @@ -140,6 +140,8 @@ function byteCount(bytes,precision) { bytes = bytes / 1024; i++; } + if (i == 0) + return bytes; return bytes.toFixed(precision) + units[i]; } -- cgit v1.2.3