From 6a3a30725cdd850995af897d8e0a62189ff1a3b1 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Mon, 7 Nov 2016 16:11:54 +0100 Subject: Graph ALL the things Tweaks background colors on graphs. Adds a funky "ticker" to the navbar that may or may not break small screens. Graphs average latency and total bandwidth for all equipment. --- web/js/nms-info-box.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'web/js/nms-info-box.js') diff --git a/web/js/nms-info-box.js b/web/js/nms-info-box.js index 3bc60af..9d9d9a3 100644 --- a/web/js/nms-info-box.js +++ b/web/js/nms-info-box.js @@ -682,7 +682,7 @@ var switchPortsPanel = function () { if (snmpJson[obj].ifHCInOctets != 0 || snmpJson[obj].ifHCOutOctets != 0) { var img = document.createElement("img"); - img.src = '/render/?target=cactiStyle(aliasByMetric(perSecond(snmp.' + this.sw + '.' + obj + '.{ifHCOutOctets,ifHCInOctets})),"binary")&target=cactiStyle(aliasByMetric(secondYAxis(snmp.' + this.sw + '.' + obj + '.{ifInDiscards,ifInErrors,ifOutDiscards,ifOutErrors})),"binary")' + nmsInfoBox._graphDefaults(); + img.src = '/render/?target=cactiStyle(aliasByMetric(perSecond(snmp.' + this.sw + '.' + obj + '.{ifHCOutOctets,ifHCInOctets})),"binary")&target=cactiStyle(aliasByMetric(secondYAxis(perSecond(snmp.' + this.sw + '.' + obj + '.{ifInDiscards,ifInErrors,ifOutDiscards,ifOutErrors}))),"binary")' + nmsInfoBox._graphDefaults(); img.classList.add("graph"); panelBodyObj.appendChild(img); } @@ -1140,16 +1140,14 @@ nmsInfoBox._graphZoom = function() { nmsInfoBox._graphFrom = "-60min"; nmsInfoBox._graphUntil = "now"; nmsInfoBox._graphDefaults = function(title) { - // Copied from nms-color-util.js. Could do with expanding. - var colorlist = "337ab7,5cb85c,5bc0de,f0ad4e,d9534f,ffffff"; if (title != undefined) { title = "From " + nmsInfoBox._graphFrom + " until " + nmsInfoBox._graphUntil + " (" + title + ")"; } else { title = "From " + nmsInfoBox._graphFrom + " until " + nmsInfoBox._graphUntil; } - var base = "&yMinLeft=0&yMinRight=0&yMin=0&fontName=courier&width=600&height=240&yUnitSystem=binary&format=svg&colorList=" + colorlist + "&from=" + nmsInfoBox._graphFrom + "&until=" + nmsInfoBox._graphUntil + '&title=' + title; + var base = "&yMinLeft=0&yMinRight=0&yMin=0&bgcolor=%23ffffff00&fontName=courier&width=600&height=240&yUnitSystem=binary&format=svg&from=" + nmsInfoBox._graphFrom + "&until=" + nmsInfoBox._graphUntil + '&title=' + title; if (nms.nightMode) { - return "&bgcolor=%23222222&fgcolor=%23dddddd&minorGridLineColor=%233d3d3d&majorGridLineColor=%23666666" + base; + return "&fgcolor=%23dddddd&minorGridLineColor=%233d3d3d&majorGridLineColor=%23666666" + base; } else { return base; } -- cgit v1.2.3