diff options
author | Kristian Lyngstol <kristian@bohemians.org> | 2016-05-28 03:20:27 +0200 |
---|---|---|
committer | Kristian Lyngstol <kristian@bohemians.org> | 2016-05-28 03:20:27 +0200 |
commit | 392ad3284d9e686ee49b51565490d665ca7e4284 (patch) | |
tree | 11ee393eb179cbd62b77c29936d1983e53ec7982 /web/js/nms-map-handlers.js | |
parent | 6cab3bad114fd0806fd1d3feb562a53138c91708 (diff) |
front: More visual tweaks and tuneups
- Time in oplog is now localtime and properly padded (00:10, not 0:10)
- Health map instead of combo/aggregated
- Tweak the menu slightly
- Rotate and resize the random switch in guess_placement
Diffstat (limited to 'web/js/nms-map-handlers.js')
-rw-r--r-- | web/js/nms-map-handlers.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/web/js/nms-map-handlers.js b/web/js/nms-map-handlers.js index dea0b6e..61a5a05 100644 --- a/web/js/nms-map-handlers.js +++ b/web/js/nms-map-handlers.js @@ -69,11 +69,11 @@ var handler_cpu = { name:"CPU utilization" }; -var handler_combo = { - init:comboInit, - getInfo:comboInfo, - tag:"combo", - name:"Aggregated health" +var handler_health = { + init:healthInit, + getInfo:healthInfo, + tag:"health", + name:"Health" }; var handler_mgmt = { @@ -112,7 +112,7 @@ var handlerInfo = function(tag,desc) { * Order matches what's seen in the infobox */ var handlers = [ - handler_combo, + handler_health, handler_mgmt, handler_uplinks, handler_temp, @@ -591,12 +591,12 @@ function cpuInit() { setLegend(5,"white","N/A"); } -function comboInfo(sw) { - var worst = new handlerInfo("combo", "Combo"); +function healthInfo(sw) { + var worst = new handlerInfo("health", "Health"); worst.score = 0; worst.why = "All good"; for (var h in handlers) { - if (handlers[h].tag== "combo") + if (handlers[h].tag== "health") continue; if (handlers[h].getInfo == undefined) continue; @@ -612,18 +612,18 @@ function comboInfo(sw) { return worst; } -function comboUpdater() { +function healthUpdater() { if (nmsData.switches == undefined || nmsData.switches.switches == undefined) return; for (var sw in nmsData.switches.switches) { - var worst = comboInfo(sw); + var worst = healthInfo(sw); nmsMap.setSwitchColor(sw, nmsColor.getColorStop(worst.score)); nmsMap.setSwitchInfo(sw, worst.tag); } } -function comboInit() { - nmsData.addHandler("ping", "mapHandler", comboUpdater); +function healthInit() { + nmsData.addHandler("ping", "mapHandler", healthUpdater); nmsColor.drawGradient([nmsColor.green,nmsColor.orange,nmsColor.red]); setLegend(1,nmsColor.getColorStop(0),"All good"); setLegend(2,nmsColor.getColorStop(250),"Ok-ish"); |