diff options
author | Nicolai Tellefsen <niccofyren@gmail.com> | 2016-03-24 03:40:27 +0100 |
---|---|---|
committer | Nicolai Tellefsen <niccofyren@gmail.com> | 2016-03-24 03:40:27 +0100 |
commit | be83c1a10121d98e0acf6f8a74cb322901d1818a (patch) | |
tree | f39b9a2f16dde6657b985d3c9fe97131fd06083b /web/nms.gathering.org/js/nms-info-box.js | |
parent | 91e4dcd96203f12c67936ed5d3fa7a890ea2cf55 (diff) |
NMS: Change search to all lowercase
Does not convert number only fields to lowercase. Is primarily useful
when searching system descriptions for version information or similar.
Diffstat (limited to 'web/nms.gathering.org/js/nms-info-box.js')
-rw-r--r-- | web/nms.gathering.org/js/nms-info-box.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/web/nms.gathering.org/js/nms-info-box.js b/web/nms.gathering.org/js/nms-info-box.js index 85b5d81..a9eda2a 100644 --- a/web/nms.gathering.org/js/nms-info-box.js +++ b/web/nms.gathering.org/js/nms-info-box.js @@ -558,7 +558,7 @@ nmsInfoBox._makeCommentTable = function(content) { nmsInfoBox._searchSmart = function(id, sw) { try { - if (nmsData.switches.switches[sw].distro_name == id) { + if (nmsData.switches.switches[sw].distro_name.toLowerCase() == id) { return true; } if (id.match("active")) { @@ -599,7 +599,7 @@ nmsInfoBox._searchSmart = function(id, sw) { return true; } } catch (e) {} - if (nmsData.snmp.snmp[sw].misc.sysDescr[0].match(id)) { + if (nmsData.snmp.snmp[sw].misc.sysDescr[0].toLowerCase().match(id)) { return true; } } catch (e) { @@ -617,12 +617,12 @@ nmsInfoBox._search = function() { var id = false; var matches = []; if (el) { - id = el.value; + id = el.value.toLowerCase(); } if(id) { nmsMap.enableHighlights(); for(var sw in nmsData.switches.switches) { - if(sw.indexOf(id) > -1) { + if(sw.toLowerCase().indexOf(id) > -1) { matches.push(sw); nmsMap.setSwitchHighlight(sw,true); } else if (nmsInfoBox._searchSmart(id,sw)) { |