diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/DeviceAddrNoDNS.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/DeviceAddrNoDNS.pm index b7eb57e6..d1e86323 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/DeviceAddrNoDNS.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/DeviceAddrNoDNS.pm @@ -17,18 +17,18 @@ register_report( get '/ajax/content/report/deviceaddrnodns' => require_login sub { my @results = schema('netdisco')->resultset('Device')->search( { 'device_ips.dns' => undef }, - { result_class => 'DBIx::Class::ResultClass::HashRefInflator', - select => [ 'ip', 'dns', 'name', 'location', 'contact' ], + { select => [ 'ip', 'dns', 'name', 'location', 'contact' ], join => [qw/device_ips/], '+columns' => [ { 'alias' => 'device_ips.alias' }, ], order_by => { -asc => [qw/me.ip device_ips.alias/] }, } - )->all; + )->hri->all; return unless scalar @results; if ( request->is_ajax ) { - template 'ajax/report/deviceaddrnodns.tt', { results => \@results, }, + my $results = to_json (\@results); + template 'ajax/report/deviceaddrnodns.tt', { results => $results, }, { layout => undef }; } else { diff --git a/Netdisco/share/views/ajax/report/deviceaddrnodns.tt b/Netdisco/share/views/ajax/report/deviceaddrnodns.tt index 2e674aea..8d3e992f 100644 --- a/Netdisco/share/views/ajax/report/deviceaddrnodns.tt +++ b/Netdisco/share/views/ajax/report/deviceaddrnodns.tt @@ -1,4 +1,4 @@ -
| Device | @@ -7,15 +7,26 @@Location | ||
|---|---|---|---|
| - [% row.dns || row.name || row.ip | html_entity %] - | [% row.alias | html_entity %] | -[% row.contact | html_entity %] | -[% row.location | html_entity %] | -