Revert "Search device by CDP/LLDP advertised ID or Type"
This reverts commit 7411cf6cdd.
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
[NEW FEATURES]
|
[NEW FEATURES]
|
||||||
|
|
||||||
* netdisco-sshcollector script to get ARP data on devices without SNMP (C. Ramseyer)
|
* netdisco-sshcollector script to get ARP data on devices without SNMP (C. Ramseyer)
|
||||||
* Search device by CDP/LLDP advertised ID or Type
|
|
||||||
|
|
||||||
2.029005 - 2014-08-13
|
2.029005 - 2014-08-13
|
||||||
|
|
||||||
|
|||||||
@@ -177,17 +177,6 @@ __PACKAGE__->has_many(
|
|||||||
'ip', { join_type => 'RIGHT' }
|
'ip', { join_type => 'RIGHT' }
|
||||||
);
|
);
|
||||||
|
|
||||||
=head2 neighbor_ports
|
|
||||||
|
|
||||||
Returns the set of ports on other devices which connect to this device
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
__PACKAGE__->has_many(
|
|
||||||
neighbor_ports => 'App::Netdisco::DB::Result::DevicePort',
|
|
||||||
{ 'foreign.remote_ip' => 'self.ip' },
|
|
||||||
);
|
|
||||||
|
|
||||||
=head2 community
|
=head2 community
|
||||||
|
|
||||||
Returns the row from the community string table, if one exists.
|
Returns the row from the community string table, if one exists.
|
||||||
|
|||||||
@@ -176,14 +176,6 @@ Will match exactly the C<os_ver> field, which is the operating sytem software ve
|
|||||||
|
|
||||||
Will match exactly the C<vendor> (manufacturer).
|
Will match exactly the C<vendor> (manufacturer).
|
||||||
|
|
||||||
=item neighbor_id
|
|
||||||
|
|
||||||
Will match the device if it has advertised this ID to a CDP/LLDP neighbor.
|
|
||||||
|
|
||||||
=item neighbor_type
|
|
||||||
|
|
||||||
Will match the device if it has advertised this Type to a CDP/LLDP neighbor.
|
|
||||||
|
|
||||||
=item dns
|
=item dns
|
||||||
|
|
||||||
Can match any of the Device IP address aliases as a substring.
|
Can match any of the Device IP address aliases as a substring.
|
||||||
@@ -242,11 +234,6 @@ sub search_by_field {
|
|||||||
($p->{layers} ? ('me.layers' =>
|
($p->{layers} ? ('me.layers' =>
|
||||||
{ '-ilike' => "\%$layer_string" }) : ()),
|
{ '-ilike' => "\%$layer_string" }) : ()),
|
||||||
|
|
||||||
($p->{neighbor_id} ? ('neighbor_ports.remote_id' =>
|
|
||||||
{ '-ilike' => "\%$p->{neighbor_id}\%" }) : ()),
|
|
||||||
($p->{neighbor_type} ? ('neighbor_ports.remote_type' =>
|
|
||||||
{ '-ilike' => "\%$p->{neighbor_type}\%" }) : ()),
|
|
||||||
|
|
||||||
($p->{model} ? ('me.model' =>
|
($p->{model} ? ('me.model' =>
|
||||||
{ '-in' => $p->{model} }) : ()),
|
{ '-in' => $p->{model} }) : ()),
|
||||||
($p->{os_ver} ? ('me.os_ver' =>
|
($p->{os_ver} ? ('me.os_ver' =>
|
||||||
@@ -269,8 +256,8 @@ sub search_by_field {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
order_by => [qw/ me.dns me.ip /],
|
order_by => [qw/ me.dns me.ip /],
|
||||||
(($p->{dns} or $p->{ip} or $p->{neighbor_id} or $p->{neighbor_type}) ? (
|
(($p->{dns} or $p->{ip}) ? (
|
||||||
join => [qw/device_ips neighbor_ports/],
|
join => 'device_ips',
|
||||||
distinct => 1,
|
distinct => 1,
|
||||||
) : ()),
|
) : ()),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ register_search_tab(
|
|||||||
# device with various properties or a default match-all
|
# device with various properties or a default match-all
|
||||||
get '/ajax/content/search/device' => require_login sub {
|
get '/ajax/content/search/device' => require_login sub {
|
||||||
my $has_opt = List::MoreUtils::any { param($_) }
|
my $has_opt = List::MoreUtils::any { param($_) }
|
||||||
qw/name location dns ip description model os_ver vendor layers
|
qw/name location dns ip description model os_ver vendor layers/;
|
||||||
neighbor_id neighbor_type/;
|
|
||||||
my $rs;
|
my $rs;
|
||||||
|
|
||||||
if ($has_opt) {
|
if ($has_opt) {
|
||||||
|
|||||||
@@ -41,22 +41,6 @@
|
|||||||
type="text" name="description" value="[% params.description | html_entity %]"
|
type="text" name="description" value="[% params.description | html_entity %]"
|
||||||
rel="tooltip" data-placement="left" data-offset="5" data-title="Description"/>
|
rel="tooltip" data-placement="left" data-offset="5" data-title="Description"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix">
|
|
||||||
<i data-btn-for="neighbor_id" class="nd_field-copy-icon icon-copy icon-large"></i>
|
|
||||||
<i id="neighbor_id_clear_btn" data-btn-for="neighbor_id"
|
|
||||||
class="nd_field-clear-icon icon-trash icon-large"></i>
|
|
||||||
<input class="nd_side-input" placeholder="Neighbor ID"
|
|
||||||
type="text" name="neighbor_id" value="[% params.neighbor_id | html_entity %]"
|
|
||||||
rel="tooltip" data-placement="left" data-offset="5" data-title="Neighbor ID"/>
|
|
||||||
</div>
|
|
||||||
<div class="clearfix">
|
|
||||||
<i data-btn-for="neighbor_type" class="nd_field-copy-icon icon-copy icon-large"></i>
|
|
||||||
<i id="neighbor_type_clear_btn" data-btn-for="neighbor_type"
|
|
||||||
class="nd_field-clear-icon icon-trash icon-large"></i>
|
|
||||||
<input class="nd_side-input" placeholder="Neighbor Type"
|
|
||||||
type="text" name="neighbor_type" value="[% params.neighbor_type | html_entity %]"
|
|
||||||
rel="tooltip" data-placement="left" data-offset="5" data-title="Neighbor Type"/>
|
|
||||||
</div>
|
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<select class="nd_side-select" size="[% model_list.size > 5 ? 5 : model_list.size %]"
|
<select class="nd_side-select" size="[% model_list.size > 5 ? 5 : model_list.size %]"
|
||||||
multiple="on" name="model"
|
multiple="on" name="model"
|
||||||
|
|||||||
Reference in New Issue
Block a user