Only query database for select lists when they will be used by the report
This commit is contained in:
@@ -8,14 +8,20 @@ get '/report/*' => require_login sub {
|
|||||||
my ($tag) = splat;
|
my ($tag) = splat;
|
||||||
|
|
||||||
# used in the report search sidebar to populate select inputs
|
# used in the report search sidebar to populate select inputs
|
||||||
my $domain_list
|
my ( $domain_list, $class_list, $ssid_list );
|
||||||
= [
|
|
||||||
schema('netdisco')->resultset('NodeNbt')->get_distinct_col('domain')
|
if ( $tag eq 'netbios' ) {
|
||||||
];
|
$domain_list = [ schema('netdisco')->resultset('NodeNbt')
|
||||||
my $class_list = [ schema('netdisco')->resultset('DeviceModule')
|
->get_distinct_col('domain') ];
|
||||||
->get_distinct_col('class') ];
|
}
|
||||||
my $ssid_list = [ schema('netdisco')->resultset('DevicePortSsid')
|
elsif ( $tag eq 'moduleinventory' ) {
|
||||||
->get_distinct_col('ssid') ];
|
$class_list = [ schema('netdisco')->resultset('DeviceModule')
|
||||||
|
->get_distinct_col('class') ];
|
||||||
|
}
|
||||||
|
elsif ( $tag eq 'portssid' ) {
|
||||||
|
$ssid_list = [ schema('netdisco')->resultset('DevicePortSsid')
|
||||||
|
->get_distinct_col('ssid') ];
|
||||||
|
}
|
||||||
|
|
||||||
# trick the ajax into working as if this were a tabbed page
|
# trick the ajax into working as if this were a tabbed page
|
||||||
params->{tab} = $tag;
|
params->{tab} = $tag;
|
||||||
|
|||||||
Reference in New Issue
Block a user