relocate repo files so ND2 is the only code

This commit is contained in:
Oliver Gorwits
2017-04-14 23:08:55 +01:00
parent 9a016ea6ba
commit d23b32500f
469 changed files with 0 additions and 6920 deletions

View File

@@ -0,0 +1,41 @@
package App::Netdisco::Web::Plugin::Report::ApChannelDist;
use Dancer ':syntax';
use Dancer::Plugin::DBIC;
use Dancer::Plugin::Auth::Extensible;
use App::Netdisco::Web::Plugin;
register_report(
{ category => 'Wireless',
tag => 'apchanneldist',
label => 'Access Point Channel Distribution',
provides_csv => 1,
}
);
get '/ajax/content/report/apchanneldist' => require_login sub {
my @results = schema('netdisco')->resultset('DevicePortWireless')->search(
{ channel => { '!=', '0' } },
{ select => [ 'channel', { count => 'channel' } ],
as => [qw/ channel ch_count /],
group_by => [qw/channel/],
order_by => { -desc => [qw/count/] },
},
)->hri->all;
return unless scalar @results;
if ( request->is_ajax ) {
my $json = to_json( \@results );
template 'ajax/report/apchanneldist.tt', { results => $json },
{ layout => undef };
}
else {
header( 'Content-Type' => 'text/comma-separated-values' );
template 'ajax/report/apchanneldist_csv.tt', { results => \@results },
{ layout => undef };
}
};
1;