allow undiscovered neighbors report to use discover_{waps,phones} setting
This commit is contained in:
@@ -15,6 +15,7 @@ __PACKAGE__->result_source_instance->view_definition(<<'ENDSQL');
|
|||||||
d.ip, d.name, d.dns,
|
d.ip, d.name, d.dns,
|
||||||
p.port, p.name AS port_description,
|
p.port, p.name AS port_description,
|
||||||
p.remote_ip, p.remote_id, p.remote_type, p.remote_port,
|
p.remote_ip, p.remote_id, p.remote_type, p.remote_port,
|
||||||
|
dpp.remote_is_wap, dpp.remote_is_phone,
|
||||||
l.log AS comment,
|
l.log AS comment,
|
||||||
a.log, a.finished
|
a.log, a.finished
|
||||||
|
|
||||||
@@ -23,6 +24,7 @@ __PACKAGE__->result_source_instance->view_definition(<<'ENDSQL');
|
|||||||
INNER JOIN device d USING (ip)
|
INNER JOIN device d USING (ip)
|
||||||
LEFT OUTER JOIN device_skip ds
|
LEFT OUTER JOIN device_skip ds
|
||||||
ON ('discover' = ANY(ds.actionset) AND p.remote_ip = ds.device)
|
ON ('discover' = ANY(ds.actionset) AND p.remote_ip = ds.device)
|
||||||
|
LEFT OUTER JOIN device_port_properties dpp USING (ip, port)
|
||||||
LEFT OUTER JOIN device_port_log l USING (ip, port)
|
LEFT OUTER JOIN device_port_log l USING (ip, port)
|
||||||
LEFT OUTER JOIN admin a
|
LEFT OUTER JOIN admin a
|
||||||
ON (p.remote_ip = a.device AND a.action = 'discover')
|
ON (p.remote_ip = a.device AND a.action = 'discover')
|
||||||
@@ -58,6 +60,10 @@ __PACKAGE__->add_columns(
|
|||||||
{ data_type => "text", is_nullable => 1 },
|
{ data_type => "text", is_nullable => 1 },
|
||||||
"remote_id",
|
"remote_id",
|
||||||
{ data_type => "text", is_nullable => 1 },
|
{ data_type => "text", is_nullable => 1 },
|
||||||
|
"remote_is_wap",
|
||||||
|
{ data_type => "boolean", is_nullable => 1 },
|
||||||
|
"remote_is_phone",
|
||||||
|
{ data_type => "boolean", is_nullable => 1 },
|
||||||
"comment",
|
"comment",
|
||||||
{ data_type => "text", is_nullable => 1 },
|
{ data_type => "text", is_nullable => 1 },
|
||||||
"log",
|
"log",
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ get '/ajax/content/admin/undiscoveredneighbors' => require_role admin => sub {
|
|||||||
# create a new row object to avoid hitting the DB in get_device()
|
# create a new row object to avoid hitting the DB in get_device()
|
||||||
my $dev = schema('netdisco')->resultset('Device')->new({ip => $r->{remote_ip}});
|
my $dev = schema('netdisco')->resultset('Device')->new({ip => $r->{remote_ip}});
|
||||||
next unless is_discoverable( $dev, $r->{remote_type} );
|
next unless is_discoverable( $dev, $r->{remote_type} );
|
||||||
|
next if (not setting('discover_waps')) and $r->{remote_is_wap};
|
||||||
|
next if (not setting('discover_phones')) and $r->{remote_is_phone};
|
||||||
push @discoverable_results, $r;
|
push @discoverable_results, $r;
|
||||||
}
|
}
|
||||||
return unless scalar @discoverable_results;
|
return unless scalar @discoverable_results;
|
||||||
|
|||||||
Reference in New Issue
Block a user