Port search also searches on the Remote ID and Type

This commit is contained in:
Oliver Gorwits
2014-08-25 15:13:21 +01:00
parent f6b854f99f
commit 3b6ae9e58e
3 changed files with 9 additions and 1 deletions

View File

@@ -4,6 +4,10 @@
* netdisco-sshcollector script to get ARP data on devices without SNMP (C. Ramseyer)
[ENHANCEMENTS]
* Port search also searches on the Remote ID and Type
2.029005 - 2014-08-13
[ENHANCEMENTS]

View File

@@ -37,6 +37,8 @@ get '/ajax/content/search/port' => require_login sub {
? { "me.mac" => $q }
: \[ 'me.mac::text ILIKE ?', $likeval ]
),
{ "me.remote_id" => $likeclause },
{ "me.remote_type" => $likeclause },
]
},
{ '+columns' => [qw/ device.dns device.name port_vlans.vlan /],

View File

@@ -32,7 +32,9 @@ $(document).ready(function() {
if (row.device.dns || row.device.name) {
ddns = ' (' + he.encode(row.device.dns || row.device.name) + ')';
}
return '<a href="[% device_ports %]&q=' + encodeURIComponent(data) + '&f=' + encodeURIComponent(row.port) + '">' + he.encode(data) + '[' + he.encode(row.port) + ']</a>' + ddns;
return '<a href="[% device_ports %]&q=' + encodeURIComponent(data)
+ '&f=' + encodeURIComponent(row.port) + '">' + he.encode(data)
+ ' [' + he.encode(row.port) + ']</a>' + ddns;
}
}, {
"data": 'descr',