#1010 Search port descriptions
This commit is contained in:
@@ -17,7 +17,7 @@ register_search_tab({
|
||||
api_endpoint => 1,
|
||||
api_parameters => [
|
||||
q => {
|
||||
description => 'Port name or VLAN or MAC address',
|
||||
description => 'Port name, VLAN, or MAC address',
|
||||
required => 1,
|
||||
},
|
||||
partial => {
|
||||
@@ -30,6 +30,11 @@ register_search_tab({
|
||||
type => 'boolean',
|
||||
default => 'false',
|
||||
},
|
||||
descr => {
|
||||
description => 'Search in the Port Description field',
|
||||
type => 'boolean',
|
||||
default => 'false',
|
||||
},
|
||||
ethernet => {
|
||||
description => 'Only Ethernet type interfaces in results',
|
||||
type => 'boolean',
|
||||
@@ -76,6 +81,9 @@ get '/ajax/content/search/port' => require_login sub {
|
||||
-and => [
|
||||
-or => [
|
||||
{ "me.name" => ( param('partial') ? $likeclause : $q ) },
|
||||
( param('descr') ? (
|
||||
{ "me.descr" => ( param('partial') ? $likeclause : $q ) },
|
||||
) : () ),
|
||||
( ((!defined $mac) or $mac->errstr)
|
||||
? \[ 'me.mac::text ILIKE ?', $likeval ]
|
||||
: { 'me.mac' => $mac->as_ieee }
|
||||
|
||||
@@ -108,6 +108,7 @@ sidebar_defaults:
|
||||
search_port:
|
||||
partial: { default: checked }
|
||||
uplink: { default: null }
|
||||
descr: { default: null }
|
||||
ethernet: { default: checked }
|
||||
search_device:
|
||||
matchall: { default: checked }
|
||||
|
||||
@@ -16,7 +16,16 @@
|
||||
name="uplink"[% ' checked="checked"' IF vars.sidebar_defaults.search_port.uplink %]/>
|
||||
</label>
|
||||
<label class="nd_checkboxlabel" for="port_uplink">
|
||||
<span class="nd_searchcheckbox uneditable-input">Uplinks</span>
|
||||
<span class="nd_searchcheckbox uneditable-input">Include Uplinks</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="clearfix input-prepend">
|
||||
<label class="add-on">
|
||||
<input type="checkbox" id="port_descr"
|
||||
name="descr"[% ' checked="checked"' IF vars.sidebar_defaults.search_port.descr %]/>
|
||||
</label>
|
||||
<label class="nd_checkboxlabel" for="port_descr">
|
||||
<span class="nd_searchcheckbox uneditable-input">Search Description</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="clearfix input-prepend">
|
||||
|
||||
Reference in New Issue
Block a user