aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/nms-map-handlers.js
diff options
context:
space:
mode:
authorHåkon Solbjørg <hlsolbjorg@gmail.com>2018-03-30 07:52:26 +0200
committerGitHub <noreply@github.com>2018-03-30 07:52:26 +0200
commitc6ed10ceedf0c0665ff6d7ece9bca12236ca5d22 (patch)
tree35568f116bf7b497976c0f5fb30823fadf48cf51 /web/js/nms-map-handlers.js
parent05e09f3b63269a48d1beb0dc9900b180101cec7f (diff)
Set Client ports description to "None configured" if no configured client ports.
This fixes a bug where "Client ports" value could be "0 / NaN" if no client ports were configured.
Diffstat (limited to 'web/js/nms-map-handlers.js')
-rw-r--r--web/js/nms-map-handlers.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/web/js/nms-map-handlers.js b/web/js/nms-map-handlers.js
index f9fe52b..521b8a7 100644
--- a/web/js/nms-map-handlers.js
+++ b/web/js/nms-map-handlers.js
@@ -184,7 +184,7 @@ function uplinkInfo(sw)
var tu = parseInt(nmsData.switchstate.switches[sw].clients.live);
var tt = parseInt(nmsData.switchstate.switches[sw].clients.total);
ret.data[1] = {};
- ret.data[1].value = (tu) + " / " + (tt);
+ ret.data[1].value = (tu && tt) ? (tu) + " / " + (tt) : "None configured";
ret.data[1].description = "Client ports (live/total)";
}
if (testTree(nmsData,['switchstate','switches',sw,'totals','live'])) {