fix bug on device port view (speed-up) to avoid DB query on every node
This commit is contained in:
3
Changes
3
Changes
@@ -6,6 +6,7 @@
|
||||
* #311 added duplicate devices report with option to delete
|
||||
* #263 discover neighbors advertising ipv6 management addresses
|
||||
* #286 support only/no ACLs for snmp_auth stanza, update docs
|
||||
* support NETDISCO_DBNAME in "netdisco-do psql"
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
@@ -14,7 +15,7 @@
|
||||
* #317 #265 #311 when renumbering on discover, delete likely duplicate devices
|
||||
* #316 neighbor map should fall back to device sysname after dns
|
||||
* #310 allow multiple LLDP management addresses
|
||||
* support NETDISCO_DBNAME in "netdisco-do psql"
|
||||
* fix bug on device port view (speed-up) to avoid DB query on every node
|
||||
|
||||
2.036001 - 2017-06-22
|
||||
|
||||
|
||||
@@ -138,14 +138,14 @@ get '/ajax/content/device/ports' => require_login sub {
|
||||
my $nodes_name = (param('n_archived') ? 'nodes' : 'active_nodes');
|
||||
$nodes_name .= '_with_age' if param('n_age');
|
||||
|
||||
if (param('c_nodes')) {
|
||||
my $ips = ((param('n_ip4') and param('n_ip6')) ? 'ips'
|
||||
: param('n_ip4') ? 'ip4s'
|
||||
: 'ip6s');
|
||||
my $ips_name = ((param('n_ip4') and param('n_ip6')) ? 'ips'
|
||||
: param('n_ip4') ? 'ip4s'
|
||||
: 'ip6s');
|
||||
|
||||
if (param('c_nodes')) {
|
||||
# retrieve active/all connected nodes, if asked for
|
||||
$set = $set->search_rs({}, { prefetch => [{$nodes_name => $ips}] });
|
||||
$set = $set->search_rs({}, { order_by => ["${nodes_name}.vlan", "${nodes_name}.mac", "${ips}.ip"] });
|
||||
$set = $set->search_rs({}, { prefetch => [{$nodes_name => $ips_name}] });
|
||||
$set = $set->search_rs({}, { order_by => ["${nodes_name}.vlan", "${nodes_name}.mac", "${ips_name}.ip"] });
|
||||
|
||||
# retrieve wireless SSIDs, if asked for
|
||||
$set = $set->search_rs({}, { prefetch => [{$nodes_name => 'wireless'}] })
|
||||
@@ -175,6 +175,7 @@ get '/ajax/content/device/ports' => require_login sub {
|
||||
template 'ajax/device/ports.tt', {
|
||||
results => $results,
|
||||
nodes => $nodes_name,
|
||||
ips => $ips_name,
|
||||
device => $device,
|
||||
vmember_ok => $vmember_ok,
|
||||
}, { layout => undef };
|
||||
|
||||
@@ -331,19 +331,8 @@
|
||||
)
|
||||
[% END %]
|
||||
[% ' (' _ node.time_last_age _ ')' IF params.n_age %]
|
||||
[% IF params.n_ip4 %]
|
||||
[% FOREACH ip IN node.ip4s %]
|
||||
<br/> [% '<i class="icon-book"></i> ' IF NOT ip.active %]
|
||||
[% SET dns = ip.dns %]
|
||||
[% IF dns %]
|
||||
<a href="[% search_node %]&q=[% ip.ip | uri %]">[% dns %] ([% ip.ip | html_entity %])</a>
|
||||
[% ELSE %]
|
||||
<a href="[% search_node %]&q=[% ip.ip | uri %]">[% ip.ip | html_entity %]</a>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF params.n_ip6 %]
|
||||
[% FOREACH ip IN node.ip6s %]
|
||||
[% IF params.n_ip4 OR params.n_ip6 %]
|
||||
[% FOREACH ip IN node.$ips %]
|
||||
<br/> [% '<i class="icon-book"></i> ' IF NOT ip.active %]
|
||||
[% SET dns = ip.dns %]
|
||||
[% IF dns %]
|
||||
|
||||
Reference in New Issue
Block a user