From bb467972018baed21cd985c75a7ebac56b68a3d4 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Wed, 22 Jan 2020 21:23:57 +0000 Subject: [PATCH] smarter fix for vlan filter in netmap --- lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm b/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm index 874e36e3..13a74fc3 100644 --- a/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm +++ b/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm @@ -205,7 +205,7 @@ ajax '/ajax/data/device/netmap' => require_login sub { my $devices = schema('netdisco')->resultset('Device')->search({}, { '+select' => [\'floor(log(throughput.total))'], '+as' => ['log'], - join => 'throughput', + join => 'throughput', distinct => 1, })->with_times; # filter by vlan for all or neighbors only @@ -216,10 +216,7 @@ ajax '/ajax/data/device/netmap' => require_login sub { ); } - my %seen_node = (); DEVICE: while (my $device = $devices->next) { - next if $seen_node{$device->ip}; - # if in neighbors mode then use %ok_dev to filter next DEVICE if ($device->ip ne $qdev->ip) and ($mapshow eq 'neighbors') @@ -272,8 +269,6 @@ ajax '/ajax/data/device/netmap' => require_login sub { } push @{$data{'nodes'}}, $node; - ++$seen_node{$device->ip}; - $metadata{'centernode'} = $device->ip if $qdev and $qdev->in_storage and $device->ip eq $qdev->ip; }