diff options
author | Magnus Kirø <magnuskiro@gmail.com> | 2016-03-21 16:25:14 +0100 |
---|---|---|
committer | Magnus Kirø <magnuskiro@gmail.com> | 2016-03-21 16:25:14 +0100 |
commit | 90632b710fa8798c0eeda1bb10ff25b328634e33 (patch) | |
tree | 07db5857197f87733fb3c35c611604cd56c14341 /web/nms.gathering.org/js/nms-map-handlers.js | |
parent | 0dfc30bc1a17c17716f11ec522e4a145f5629ad3 (diff) |
js linting / code fixup.
Diffstat (limited to 'web/nms.gathering.org/js/nms-map-handlers.js')
-rw-r--r-- | web/nms.gathering.org/js/nms-map-handlers.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/web/nms.gathering.org/js/nms-map-handlers.js b/web/nms.gathering.org/js/nms-map-handlers.js index b1d31f0..b98a944 100644 --- a/web/nms.gathering.org/js/nms-map-handlers.js +++ b/web/nms.gathering.org/js/nms-map-handlers.js @@ -84,7 +84,7 @@ function uplinkUpdater() return; if (!nmsData.switchstate.switches) return; - for (sw in nmsData.switches.switches) { + for (var sw in nmsData.switches.switches) { var uplinks=0; if (nmsData.switchstate.switches[sw] == undefined || nmsData.switchstate.switches[sw].uplinks == undefined) { uplinks=0; @@ -139,9 +139,9 @@ function trafficUpdater() { if (!nms.switches_now["switches"]) return; - for (sw in nms.switches_now["switches"]) { + for (var sw in nms.switches_now["switches"]) { var speed = 0; - for (port in nms.switches_now["switches"][sw]["ports"]) { + for (var port in nms.switches_now["switches"][sw]["ports"]) { if (/ge-0\/0\/44$/.exec(port) || /ge-0\/0\/45$/.exec(port) || /ge-0\/0\/46$/.exec(port) || @@ -177,9 +177,9 @@ function trafficTotUpdater() { if (!nms.switches_now["switches"]) return; - for (sw in nms.switches_now["switches"]) { + for (var sw in nms.switches_now["switches"]) { var speed = 0; - for (port in nms.switches_now["switches"][sw]["ports"]) { + for (var port in nms.switches_now["switches"][sw]["ports"]) { if (!nms.switches_then["switches"][sw] || !nms.switches_then["switches"][sw]["ports"] || !nms.switches_then["switches"][sw]["ports"][port]) @@ -220,14 +220,14 @@ function tempUpdater() if(!nmsData.switches) return; - for (sw in nmsData.switches["switches"]) { + for ( var sw in nmsData.switches["switches"]) { var t = "white"; var temp = ""; if(!nmsData.snmp || !nmsData.snmp.snmp[sw]["misc"] || !nmsData.snmp.snmp[sw]["misc"]["enterprises.2636.3.1.13.1.7.7.1.0.0"]) continue; - tempObj = nmsData.snmp.snmp[sw]["misc"]["enterprises.2636.3.1.13.1.7.7.1.0.0"]; + var tempObj = nmsData.snmp.snmp[sw]["misc"]["enterprises.2636.3.1.13.1.7.7.1.0.0"]; Object.keys(tempObj).forEach(function (key) { if(key == "") { temp = tempObj[key] + "°C"; @@ -259,6 +259,7 @@ function pingUpdater() } for (var sw in nmsData.switches.switches) { try { + var c; if (nmsData.ping.switches[sw].age > 0) { c = red; } else { |