use remote_is_discoverable instead of local netdisco config

This commit is contained in:
Oliver Gorwits
2022-05-17 06:27:45 +01:00
parent e1bfd917a9
commit 4d0e0cc613
3 changed files with 9 additions and 7 deletions

View File

@@ -19,9 +19,6 @@ set('connected_properties' => [
hook 'before_template' => sub {
my $tokens = shift;
# allow checking of discoverability of remote connected device
$tokens->{has_snmp} = sub { not match_to_setting(shift, 'discover_no_type') };
my $defaults = var('sidebar_defaults')->{'device_ports'}
or return;

View File

@@ -16,6 +16,11 @@ register_admin_task(
}
);
# just to note a problem with this query:
# using DeviceSkip to see if discover is blocked, but that table only shows
# blocked actions on backends not permitted, so there may be a backend running
# that permits the action, we would not know.
get '/ajax/content/admin/undiscoveredneighbors' => require_role admin => sub {
my @results
= schema('netdisco')->resultset('Virtual::UndiscoveredNeighbors')->hri->all;

View File

@@ -294,7 +294,7 @@
[% END %]
<a href="[% device_ports | none %]&q=[% row.get_column('neighbor_ip') | uri %]">
[% row.get_column('neighbor_dns').remove(settings.domain_suffix) || row.get_column('neighbor_ip') | html_entity %]</a>
[% IF row.remote_port and has_snmp(row.remote_type) %]
[% IF row.remote_port and row.remote_is_discoverable %]
-
<a href="[% device_ports | none %]&q=[% row.get_column('neighbor_ip') | uri %]&f=[% row.remote_port | uri %]&prefer=port">
[% row.remote_port | html_entity %]</a>
@@ -308,7 +308,7 @@
[% ' type: '_ row.remote_type IF row.remote_type %])<br/>
[% END %]
[% ELSIF row.remote_ip %]
[% '<i class="icon-unlink text-error"></i>&nbsp;' IF has_snmp(row.remote_type) %]
[% '<i class="icon-unlink text-error"></i>&nbsp;' IF row.remote_is_discoverable %]
[% IF row.remote_is_phone %]
<i class="icon-phone"></i>&nbsp;
[% ELSIF row.remote_is_wap %]
@@ -316,7 +316,7 @@
[% END %]
<a href="[% search_node | none %]&q=[% row.remote_ip | uri %]">
[% row.remote_ip | html_entity %]
[% IF row.remote_port and has_snmp(row.remote_type) %]
[% IF row.remote_port and row.remote_is_discoverable %]
- [% row.remote_port | html_entity %]
[% END %]
</a><br/>
@@ -328,7 +328,7 @@
[% ' type: '_ row.remote_type IF row.remote_type %])<br/>
[% END %]
[% ELSE %]
[% '<i class="icon-unlink text-error"></i>&nbsp; (possible uplink)' IF has_snmp(row.remote_type) %]
[% '<i class="icon-unlink text-error"></i>&nbsp; (possible uplink)' IF row.remote_is_discoverable %]
[% END %]
[% END %]
[% IF params.c_nodes %]