From 62581f99e45f8c738aff0bd1766bd32152b412f0 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Mon, 19 May 2014 20:59:17 +0100 Subject: [PATCH] Improve VLAN Inventory performance and show all VLANs (C. Stromsoe) --- Netdisco/Changes | 6 ++++++ .../App/Netdisco/Web/Plugin/Report/VlanInventory.pm | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index dc235650..22573345 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -1,3 +1,9 @@ +2.027005 - 2014-05-15 + + [BUG FIXES] + + * Improve VLAN Inventory performance and show all VLANs (C. Stromsoe) + 2.027004 - 2014-05-15 [BUG FIXES] diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/VlanInventory.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/VlanInventory.pm index fcd6bc2c..ff14bd1c 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/VlanInventory.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/VlanInventory.pm @@ -16,19 +16,19 @@ register_report( get '/ajax/content/report/vlaninventory' => require_login sub { my $set = schema('netdisco')->resultset('DeviceVlan')->search( - { 'vlan.description' => { '!=', 'NULL' } }, + { 'me.description' => { '!=', 'NULL' } }, { join => { 'ports' => 'vlan' }, select => [ - 'vlan.vlan', - 'vlan.description', + 'me.vlan', + 'me.description', { count => { distinct => 'ports.ip' } }, { count => 'ports.vlan' } ], as => [qw/ vlan description dcount pcount /], - group_by => [qw/ vlan.vlan vlan.description /], + group_by => [qw/ me.vlan me.description /], } ); - return unless $set->count; + return unless $set->has_rows; if ( request->is_ajax ) { template 'ajax/report/vlaninventory.tt', { results => $set, },