diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/DeviceDnsMismatch.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/DeviceDnsMismatch.pm index 4aec2b25..96ecf5e0 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/DeviceDnsMismatch.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/DeviceDnsMismatch.pm @@ -15,22 +15,26 @@ register_report( ); get '/ajax/content/report/devicednsmismatch' => require_login sub { - + my $suffix = setting('domain_suffix') || ''; - my $rs = schema('netdisco')->resultset('Virtual::DeviceDnsMismatch') - ->search( undef, { bind => [ $suffix, $suffix ] } ); + my @results + = schema('netdisco')->resultset('Virtual::DeviceDnsMismatch') + ->search( undef, { bind => [ $suffix, $suffix ] } ) + ->columns( [qw/ ip dns name location contact /] )->hri->all; - return unless $rs->has_rows; + return unless scalar @results; if ( request->is_ajax ) { - template 'ajax/report/devicednsmismatch.tt', { results => $rs, }, + my $results = to_json( \@results ); + template 'ajax/report/devicednsmismatch.tt', { results => $results }, { layout => undef }; } else { header( 'Content-Type' => 'text/comma-separated-values' ); - template 'ajax/report/devicednsmismatch_csv.tt', { results => $rs, }, - { layout => undef }; + template 'ajax/report/devicednsmismatch_csv.tt', + { results => \@results }, + { layout => undef }; } }; diff --git a/Netdisco/share/views/ajax/report/devicednsmismatch.tt b/Netdisco/share/views/ajax/report/devicednsmismatch.tt index 0945f24d..95801014 100644 --- a/Netdisco/share/views/ajax/report/devicednsmismatch.tt +++ b/Netdisco/share/views/ajax/report/devicednsmismatch.tt @@ -1,4 +1,4 @@ -
| Name | @@ -8,16 +8,31 @@Location | |||
|---|---|---|---|---|
| - [% row.name | html_entity %] - | [% row.dns | html_entity %] | -[% row.ip | html_entity %] | -[% row.contact | html_entity %] | -[% row.location | html_entity %] | -