diff options
author | Kristian Lyngstol <kly@kly.no> | 2016-06-30 08:14:38 +0200 |
---|---|---|
committer | Kristian Lyngstol <kly@kly.no> | 2016-06-30 08:14:38 +0200 |
commit | 1cc733abf69cae25bfb3d7015884a95428e0f849 (patch) | |
tree | cb157bc70c8660f1a97bf546e4b07ea548751d62 /web/js | |
parent | 25bda93e085c809d021adfa588b08fbce00ad7ee (diff) |
Add DHCP-based client counter in front-end
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/nms-dhcp.js | 17 | ||||
-rw-r--r-- | web/js/nms.js | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/web/js/nms-dhcp.js b/web/js/nms-dhcp.js new file mode 100644 index 0000000..b852a45 --- /dev/null +++ b/web/js/nms-dhcp.js @@ -0,0 +1,17 @@ +"use strict"; + +var nmsDhcp = nmsDhcp || { + +} + +nmsDhcp.init = function() { + nmsData.addHandler("dhcpsummary", "nmsDhcpHandler", nmsDhcp.updateSummary); +} + +nmsDhcp.updateSummary = function() { + var e = document.getElementById("dhcp-summary"); + if (e == undefined) { + return; + } + e.innerHTML = nmsData.dhcpsummary.dhcp.clients + " clients"; +} diff --git a/web/js/nms.js b/web/js/nms.js index 9727c09..dc9ba96 100644 --- a/web/js/nms.js +++ b/web/js/nms.js @@ -398,6 +398,7 @@ function initNMS() { detectHandler(); setupKeyhandler(); nmsSearch.init(); + nmsDhcp.init(); } function detectHandler() { |