diff --git a/lib/App/Netdisco/Web/Device.pm b/lib/App/Netdisco/Web/Device.pm index 97012464..5573c75b 100644 --- a/lib/App/Netdisco/Web/Device.pm +++ b/lib/App/Netdisco/Web/Device.pm @@ -82,7 +82,8 @@ get '/device' => require_login sub { params->{'tab'} ||= 'details'; template 'device', { display_name => ($others ? $first->ip : ($first->dns || $first->ip)), - hgroup_list => setting('host_group_displaynames'), + location_list => [ schema('netdisco')->resultset('Device')->get_distinct_col('location') ], + hgroup_list => setting('host_group_displaynames'), device => params->{'tab'}, }; }; diff --git a/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm b/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm index 03800b3a..5a150592 100644 --- a/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm +++ b/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm @@ -122,8 +122,8 @@ ajax '/ajax/data/device/netmap' => require_login sub { grep { defined } @{ $hgroup }; # list of locations selected by user and passed in param - my $locgrp = (ref [] eq ref param('locgrp') ? param('locgrp') : [param('locgrp')]); - my @lgrplist = List::MoreUtils::uniq grep { defined } @{ $locgrp }; + my $lgroup = (ref [] eq ref param('lgroup') ? param('lgroup') : [param('lgroup')]); + my @lgrplist = List::MoreUtils::uniq grep { defined } @{ $lgroup }; my %ok_dev = (); my %logvals = (); diff --git a/share/views/sidebar/device/netmap.tt b/share/views/sidebar/device/netmap.tt index 10d650a8..8079371d 100644 --- a/share/views/sidebar/device/netmap.tt +++ b/share/views/sidebar/device/netmap.tt @@ -60,7 +60,7 @@
- +
[% IF hgroup_list.size %] @@ -72,7 +72,7 @@ - + [% IF hgroup_list.size %] @@ -88,6 +88,31 @@ [% END %] + [% IF location_list.size %] +
+ [% ELSE %] +
+ [% END %] + + +
+ + [% IF location_list.size %] +
+ +
+ [% END %] +