working folters and colors for host group and location

This commit is contained in:
Oliver Gorwits
2018-03-19 17:47:22 +00:00
parent bf87615a8a
commit a2ce65c8b8
6 changed files with 39 additions and 30 deletions

View File

@@ -41,7 +41,7 @@ hook 'before_template' => sub {
}
# used in the device search sidebar template to set selected items
foreach my $opt (qw/hgroup location/) {
foreach my $opt (qw/hgroup lgroup/) {
my $p = (ref [] eq ref param($opt) ? param($opt)
: (param($opt) ? [param($opt)] : []));
$tokens->{"${opt}_lkp"} = { map { $_ => 1 } @$p };
@@ -82,7 +82,7 @@ get '/device' => require_login sub {
params->{'tab'} ||= 'details';
template 'device', {
display_name => ($others ? $first->ip : ($first->dns || $first->ip)),
location_list => [ schema('netdisco')->resultset('Device')->get_distinct_col('location') ],
lgroup_list => [ schema('netdisco')->resultset('Device')->get_distinct_col('location') ],
hgroup_list => setting('host_group_displaynames'),
device => params->{'tab'},
};