Add FRU filter option to Module Inventory Report

This commit is contained in:
Oliver Gorwits
2014-04-09 21:22:56 +01:00
parent 88ad3552c1
commit 10a6e33561
4 changed files with 37 additions and 16 deletions

View File

@@ -17,6 +17,14 @@ get '/report/*' => require_login sub {
elsif ( $tag eq 'moduleinventory' ) {
$class_list = [ schema('netdisco')->resultset('DeviceModule')
->get_distinct_col('class') ];
# this is a bit fragile... three params currently
if (3 == scalar keys params()) {
foreach my $col ( @{ var('module_options') } ) {
next unless $col->{default} eq 'on';
params->{ $col->{name} } = 'checked';
}
}
}
elsif ( $tag eq 'portssid' ) {
$ssid_list = [ schema('netdisco')->resultset('DevicePortSsid')