From be83c1a10121d98e0acf6f8a74cb322901d1818a Mon Sep 17 00:00:00 2001 From: Nicolai Tellefsen Date: Thu, 24 Mar 2016 03:40:27 +0100 Subject: 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. --- web/nms.gathering.org/js/nms-info-box.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'web/nms.gathering.org/js/nms-info-box.js') 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)) { -- cgit v1.2.3