aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/nms-info-box.js
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2016-11-07 16:11:54 +0100
committerKristian Lyngstol <kristian@bohemians.org>2016-11-07 16:11:54 +0100
commit6a3a30725cdd850995af897d8e0a62189ff1a3b1 (patch)
treec2890fb5516f1811902e273458b5435c32dde057 /web/js/nms-info-box.js
parentaba3b03eaab4eb503981509bfa08aeb8afb80c1a (diff)
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.
Diffstat (limited to 'web/js/nms-info-box.js')
-rw-r--r--web/js/nms-info-box.js8
1 files changed, 3 insertions, 5 deletions
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;
}