From c6ed10ceedf0c0665ff6d7ece9bca12236ca5d22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Solbj=C3=B8rg?= Date: Fri, 30 Mar 2018 07:52:26 +0200 Subject: 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. --- web/js/nms-map-handlers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/js') 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'])) { -- cgit v1.2.3