diff options
| author | Kristian Lyngstol <kly@kly@.no> | 2016-03-22 13:04:23 +0100 | 
|---|---|---|
| committer | Kristian Lyngstol <kly@kly@.no> | 2016-03-22 13:04:23 +0100 | 
| commit | ef480bf237b88e667ff525a1dfb881cb8bd7cf0a (patch) | |
| tree | e33742414ae72d41d39e38a924f2b86bc6376754 /web/nms.gathering.org/js/nms-info-box.js | |
| parent | 2d19233ba32fd23ad7182d3cccb58cec9e377a75 (diff) | |
NMS: Ping increase delay, better search
Diffstat (limited to 'web/nms.gathering.org/js/nms-info-box.js')
| -rw-r--r-- | web/nms.gathering.org/js/nms-info-box.js | 29 | 
1 files changed, 16 insertions, 13 deletions
| diff --git a/web/nms.gathering.org/js/nms-info-box.js b/web/nms.gathering.org/js/nms-info-box.js index 7975bae..e3956d8 100644 --- a/web/nms.gathering.org/js/nms-info-box.js +++ b/web/nms.gathering.org/js/nms-info-box.js @@ -422,6 +422,15 @@ nmsInfoBox._searchSmart = function(id, sw) {  				}  			}  		} +		if (nmsData.smanagement.switches[sw].ip.match(id)) { +			return true; +		} +		if (nmsData.smanagement.switches[sw].subnet4.match(id)) { +			return true; +		} +		if (nmsData.smanagement.switches[sw].subnet6.match(id)) { +			return true; +		}  		if (nmsData.snmp.snmp[sw].misc.sysDescr[0].match(id)) {  			return true;  		} @@ -445,20 +454,14 @@ nmsInfoBox._search = function() {  	if(id) {  		nmsMap.enableHighlights();  		for(var sw in nmsData.switches.switches) { -			if (id[0] == "/") { -				if (nmsInfoBox._searchSmart(id.slice(1),sw)) { -					matches.push(sw); -					nmsMap.setSwitchHighlight(sw,true); -				} else { -					nmsMap.setSwitchHighlight(sw,false); -				} +			if(sw.indexOf(id) > -1) { +				matches.push(sw); +				nmsMap.setSwitchHighlight(sw,true); +			} else if (nmsInfoBox._searchSmart(id,sw)) { +				matches.push(sw); +				nmsMap.setSwitchHighlight(sw,true);  			} else { -				if(sw.indexOf(id) > -1) { -					matches.push(sw); -					nmsMap.setSwitchHighlight(sw,true); -				} else { -					nmsMap.setSwitchHighlight(sw,false); -				} +				nmsMap.setSwitchHighlight(sw,false);  			}  		}  	} else { | 
