diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/ModuleInventory.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/ModuleInventory.pm index ce730ff8..4e955512 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/ModuleInventory.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/ModuleInventory.pm @@ -96,12 +96,14 @@ get '/ajax/content/report/moduleinventory' => require_login sub { return unless $rs->has_rows; if ( request->is_ajax ) { - template 'ajax/report/moduleinventory.tt', { results => $rs, }, + template 'ajax/report/moduleinventory.tt', + { results => $rs, opt => $has_opt }, { layout => undef }; } else { header( 'Content-Type' => 'text/comma-separated-values' ); - template 'ajax/report/moduleinventory_csv.tt', { results => $rs, }, + template 'ajax/report/moduleinventory_csv.tt', + { results => $rs, opt => $has_opt }, { layout => undef }; } }; diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/Netbios.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/Netbios.pm index d731bc25..61df286c 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/Netbios.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/Netbios.pm @@ -42,11 +42,10 @@ get '/ajax/content/report/netbios' => require_login sub { if ( defined $domain ) { $domain = '' if $domain eq 'blank'; - $rs = $rs->search( { domain => $domain } )->order_by( - [ { -asc => 'domain' }, - { -desc => 'time_last' } - ] - )->hri; + $rs + = $rs->search( { domain => $domain } ) + ->order_by( [ { -asc => 'domain' }, { -desc => 'time_last' } ] ) + ->hri; } else { $rs = $rs->search( @@ -62,12 +61,13 @@ get '/ajax/content/report/netbios' => require_login sub { return unless $rs->has_rows; if ( request->is_ajax ) { - template 'ajax/report/netbios.tt', { results => $rs, }, + template 'ajax/report/netbios.tt', { results => $rs, opt => $domain }, { layout => undef }; } else { header( 'Content-Type' => 'text/comma-separated-values' ); - template 'ajax/report/netbios_csv.tt', { results => $rs, }, + template 'ajax/report/netbios_csv.tt', + { results => $rs, opt => $domain }, { layout => undef }; } }; diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/PortSsid.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/PortSsid.pm index 3c1aed23..b5936329 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/PortSsid.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/PortSsid.pm @@ -57,12 +57,13 @@ get '/ajax/content/report/portssid' => require_login sub { return unless $rs->has_rows; if ( request->is_ajax ) { - template 'ajax/report/portssid.tt', { results => $rs, }, + template 'ajax/report/portssid.tt', { results => $rs, opt => $ssid }, { layout => undef }; } else { header( 'Content-Type' => 'text/comma-separated-values' ); - template 'ajax/report/portssid_csv.tt', { results => $rs, }, + template 'ajax/report/portssid_csv.tt', + { results => $rs, opt => $ssid }, { layout => undef }; } }; diff --git a/Netdisco/share/views/ajax/report/moduleinventory.tt b/Netdisco/share/views/ajax/report/moduleinventory.tt index c904c2c7..7f898270 100644 --- a/Netdisco/share/views/ajax/report/moduleinventory.tt +++ b/Netdisco/share/views/ajax/report/moduleinventory.tt @@ -1,6 +1,5 @@ [% USE Number.Format %] -[% IF results.first.ip %] - [% row = results.reset %] +[% IF opt %]