diff --git a/lib/App/Netdisco/Web/Plugin/Device/Details.pm b/lib/App/Netdisco/Web/Plugin/Device/Details.pm index 24ff4d02..364b55a0 100644 --- a/lib/App/Netdisco/Web/Plugin/Device/Details.pm +++ b/lib/App/Netdisco/Web/Plugin/Device/Details.pm @@ -29,14 +29,22 @@ ajax '/ajax/content/device/details' => require_login sub { = schema(vars->{'tenant'})->resultset('DevicePower') ->search( { 'me.ip' => $device->ip } )->with_poestats->hri->all; - my @interfaces - = schema(vars->{'tenant'})->resultset('Device') - ->find($device->ip) - ->device_ips->hri->all; + my @interfaces = $device->device_ips->hri->all; + + my @serials = $device->modules->search({ + class => 'chassis', + -bool => 'fru', + -and => [ + { serial => { '!=' => '' } }, + { serial => { '!=' => undef } }, + ], + })->order_by('pos')->get_column('serial')->all; content_type('text/html'); template 'ajax/device/details.tt', { - d => $results[0], p => \@power, interfaces => \@interfaces, + d => $results[0], p => \@power, + interfaces => \@interfaces, + serials => [sort keys %{ { map {($_ => $_)} (@serials, ($device->serial ? $device->serial : ())) } }], }, { layout => undef }; }; diff --git a/share/views/ajax/device/details.tt b/share/views/ajax/device/details.tt index cdcf21ec..1ba69738 100644 --- a/share/views/ajax/device/details.tt +++ b/share/views/ajax/device/details.tt @@ -63,8 +63,13 @@