From 9030aec6fa888546e40c67c3f4bae37985fcd1e4 Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Sat, 15 Feb 2014 23:27:12 -0500 Subject: [PATCH] SSID Inventory report now uses the same method and templates as the Port SSID Inventory report --- .../Netdisco/Web/Plugin/Report/SsidInventory.pm | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/SsidInventory.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/SsidInventory.pm index c0e71f2f..85decf3c 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/SsidInventory.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/SsidInventory.pm @@ -15,25 +15,18 @@ register_report( ); get '/ajax/content/report/ssidinventory' => require_login sub { - my $set = schema('netdisco')->resultset('DevicePortSsid')->search( - {}, - { select => [ 'ssid', 'broadcast', { count => 'ssid' } ], - as => [qw/ ssid broadcast scount /], - group_by => [qw/ ssid broadcast /], - order_by => { -desc => [qw/count/] }, - } - ); - return unless $set->count; + my $rs = schema('netdisco')->resultset('DevicePortSsid')->get_ssids->hri; + return unless $rs->has_rows; if ( request->is_ajax ) { - template 'ajax/report/ssidinventory.tt', { results => $set, }, + template 'ajax/report/portssid.tt', { results => $rs, }, { layout => undef }; } else { header( 'Content-Type' => 'text/comma-separated-values' ); - template 'ajax/report/ssidinventory_csv.tt', { results => $set, }, + template 'ajax/report/portssid_csv.tt', { results => $rs, }, { layout => undef }; } }; -true; +1;