aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/js/nms-info-box.js
diff options
context:
space:
mode:
authorNicolai Tellefsen <niccofyren@gmail.com>2016-03-21 20:33:44 +0100
committerNicolai Tellefsen <niccofyren@gmail.com>2016-03-21 20:33:44 +0100
commit5ba657e0bca0e4970b08583f6dfc94bfae34741c (patch)
tree44ed77deecd40ca984aae4bfa1bb949cb87bf7a0 /web/nms.gathering.org/js/nms-info-box.js
parentd528cad67897dd2c3b98ec15a82868ac2764e2c7 (diff)
parent727e4ab31aa6d1a754711d4cd29dbcefae2e952a (diff)
Merge branch 'master' of https://github.com/tech-server/tgmanage
Diffstat (limited to 'web/nms.gathering.org/js/nms-info-box.js')
-rw-r--r--web/nms.gathering.org/js/nms-info-box.js52
1 files changed, 28 insertions, 24 deletions
diff --git a/web/nms.gathering.org/js/nms-info-box.js b/web/nms.gathering.org/js/nms-info-box.js
index 8527a03..cbdf942 100644
--- a/web/nms.gathering.org/js/nms-info-box.js
+++ b/web/nms.gathering.org/js/nms-info-box.js
@@ -393,33 +393,37 @@ nmsInfoBox._makeCommentTable = function(content) {
}
nmsInfoBox._searchSmart = function(id, sw) {
- if (nmsData.smanagement.switches[sw].distro == id) {
- console.log("ieh");
- return true;
- }
- if (id.match("[a-z]+.active")) {
- console.log("hei: " + sw);
- var family = id.match("[a-z]+");
- var limit = id;
- limit = limit.replace(family + ".active>","");
- limit = limit.replace(family + ".active<","");
- limit = limit.replace(family + ".active=","");
- var operator = id.replace(family + ".active","")[0];
- if (limit == parseInt(limit)) {
- if (operator == ">" ) {
- if (nmsData.switchstate.switches[sw][family].live > limit) {
- return true;
- }
- } else if (operator == "<") {
- if (nmsData.switchstate.switches[sw][family].live < limit) {
- return true;
- }
- } else if (operator == "=") {
- if (nmsData.switchstate.switches[sw][family].live == limit) {
- return true;
+ try {
+ if (nmsData.smanagement.switches[sw].distro == id) {
+ return true;
+ }
+ if (id.match("active")) {
+ var limit = id;
+ limit = limit.replace("active>","");
+ limit = limit.replace("active<","");
+ limit = limit.replace("active=","");
+ var operator = id.replace("active","")[0];
+ if (limit == parseInt(limit)) {
+ if (operator == ">" ) {
+ if (nmsData.switchstate.switches[sw]['totals'].live > limit) {
+ return true;
+ }
+ } else if (operator == "<") {
+ if (nmsData.switchstate.switches[sw]['totals'].live < limit) {
+ return true;
+ }
+ } else if (operator == "=") {
+ if (nmsData.switchstate.switches[sw]['totals'].live == limit) {
+ return true;
+ }
}
}
}
+ if (nmsData.snmp.snmp[sw].misc.sysDescr[0].match(id)) {
+ return true;
+ }
+ } catch (e) {
+ return false;
}
return false;
}