fix defaults for module_options

This commit is contained in:
Oliver Gorwits
2017-12-09 19:20:21 +00:00
parent 4eafd0cad9
commit 5768b26e5c

View File

@@ -18,13 +18,8 @@ get '/report/*' => require_login sub {
$class_list = [ schema('netdisco')->resultset('DeviceModule') $class_list = [ schema('netdisco')->resultset('DeviceModule')
->get_distinct_col('class') ]; ->get_distinct_col('class') ];
# this is a bit fragile... three params currently foreach my $col ( @{ var('module_options') } ) {
my %params = request->params(); params->{$col->{name}} = 'checked' if $col->{default} eq 'on';
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' ) { elsif ( $tag eq 'portssid' ) {