#974 show all chassis serials in device details

This commit is contained in:
Oliver Gorwits
2023-03-08 22:56:18 +00:00
parent 91e783e96f
commit 9fd1e71b8b
2 changed files with 20 additions and 7 deletions

View File

@@ -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 };
};