diff options
-rwxr-xr-x | web/api/write/switch-add | 2 | ||||
-rw-r--r-- | web/index.html | 1 | ||||
-rw-r--r-- | web/js/nms-info-box.js | 9 |
3 files changed, 10 insertions, 2 deletions
diff --git a/web/api/write/switch-add b/web/api/write/switch-add index d210567..f77df0a 100755 --- a/web/api/write/switch-add +++ b/web/api/write/switch-add @@ -84,7 +84,7 @@ foreach my $tmp2 (@tmp) { $nms::web::dbh->do("INSERT INTO SWITCHES (mgmt_v4_addr, sysname, poll_frequency, community, lldp_chassis_id, mgmt_v6_addr, placement,subnet4,subnet6,distro_name) VALUES ($template{'mgmt_v4_addr'}, $template{'sysname'}, $template{'poll_frequency'}, $template{'community'}, $template{'lldp_chassis_id'}, $template{'mgmt_v6_addr'}, $template{'placement'},$template{'subnet4'},$template{'subnet6'},$template{'distro_name'});"); push @added, $switch{'sysname'}; - oplog($switch{'sysname'}, "Switch added: " . $switch{'sysname'}); + oplog("\"" . $switch{'sysname'} . "\"", "Switch added: " . $switch{'sysname'}); } } diff --git a/web/index.html b/web/index.html index dc6c7d4..f469c1f 100644 --- a/web/index.html +++ b/web/index.html @@ -158,6 +158,7 @@ <div class="input-group input-group-sm"> <input id="searchbox" type="text" class="form-control" placeholder="Filter" oninput="nmsInfoBox._search()" /> <span class="input-group-btn"> + <button id="searchbox-x" class="btn btn-default" type="button" onclick="var lol = document.getElementById('searchbox'); lol.value = ''; lol.oninput();">X</button> <button id="searchbox-help" class="btn btn-default" type="button" onclick="nmsInfoBox.showWindow('searchHelp');">?</button> <button id="searchbox-submit" class="btn btn-default" type="button" onclick="nmsInfoBox.showWindow('switchInfo',document.getElementById('searchbox').value);">Go!</button> </span> diff --git a/web/js/nms-info-box.js b/web/js/nms-info-box.js index 46762c2..9133d7f 100644 --- a/web/js/nms-info-box.js +++ b/web/js/nms-info-box.js @@ -965,9 +965,16 @@ nmsInfoBox.searchSmart = function(id, sw) { nmsInfoBox._searchSmart = function(id, sw) { try { - if(sw.toLowerCase().indexOf(id) > -1) { + if(sw.toLowerCase().indexOf(id.toLowerCase()) > -1) { return true; } + if (id[0] == "\"") { + if (("\"" + sw.toLowerCase() + "\"") == id.toLowerCase()) { + return true; + } else { + return false; + } + } try { if (nmsData.switches.switches[sw].distro_name.toLowerCase() == id) { return true; |