add csv output to access point radios channel and power report
This commit is contained in:
@@ -11,6 +11,7 @@ register_report(
|
||||
{ category => 'Wireless',
|
||||
tag => 'apradiochannelpower',
|
||||
label => 'Access Point Radios Channel and Power',
|
||||
provides_csv => 1,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -47,16 +48,22 @@ sub port_tree {
|
||||
return \%ports;
|
||||
}
|
||||
|
||||
ajax '/ajax/content/report/apradiochannelpower' => require_login sub {
|
||||
get '/ajax/content/report/apradiochannelpower' => require_login sub {
|
||||
my @set
|
||||
= schema('netdisco')->resultset('Virtual::ApRadioChannelPower')->all;
|
||||
|
||||
my $results = port_tree( \@set );
|
||||
return unless scalar %$results;
|
||||
|
||||
content_type('text/html');
|
||||
if (request->is_ajax) {
|
||||
template 'ajax/report/apradiochannelpower.tt', { results => $results, },
|
||||
{ layout => undef };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/apradiochannelpower_csv.tt', { results => $results, },
|
||||
{ layout => undef };
|
||||
}
|
||||
};
|
||||
|
||||
true;
|
||||
|
||||
Reference in New Issue
Block a user