From 2324ae14d32390e62f042d4a164c8564888d7381 Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Thu, 19 Jun 2014 19:05:19 -0400 Subject: [PATCH] Use with_poestats in device details --- .../lib/App/Netdisco/Web/Plugin/Device/Details.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Details.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Details.pm index b37ce642..46edc359 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Details.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Device/Details.pm @@ -15,15 +15,19 @@ ajax '/ajax/content/device/details' => require_login sub { my $device = schema('netdisco')->resultset('Device') ->search_for_device($q) or send_error('Bad device', 400); - my $results + my @results = schema('netdisco')->resultset('Device') ->search( { 'me.ip' => $device->ip } )->with_times() - ->with_poestats_as_hashref; + ->hri->all; + + my @power + = schema('netdisco')->resultset('DevicePower') + ->search( { 'me.ip' => $device->ip } )->with_poestats->hri->all; content_type('text/html'); template 'ajax/device/details.tt', { - d => $results->[0], + d => $results[0], p => \@power }, { layout => undef }; }; -true; +1;