#974 show all chassis serials in device details
This commit is contained in:
@@ -29,14 +29,22 @@ ajax '/ajax/content/device/details' => require_login sub {
|
|||||||
= schema(vars->{'tenant'})->resultset('DevicePower')
|
= schema(vars->{'tenant'})->resultset('DevicePower')
|
||||||
->search( { 'me.ip' => $device->ip } )->with_poestats->hri->all;
|
->search( { 'me.ip' => $device->ip } )->with_poestats->hri->all;
|
||||||
|
|
||||||
my @interfaces
|
my @interfaces = $device->device_ips->hri->all;
|
||||||
= schema(vars->{'tenant'})->resultset('Device')
|
|
||||||
->find($device->ip)
|
my @serials = $device->modules->search({
|
||||||
->device_ips->hri->all;
|
class => 'chassis',
|
||||||
|
-bool => 'fru',
|
||||||
|
-and => [
|
||||||
|
{ serial => { '!=' => '' } },
|
||||||
|
{ serial => { '!=' => undef } },
|
||||||
|
],
|
||||||
|
})->order_by('pos')->get_column('serial')->all;
|
||||||
|
|
||||||
content_type('text/html');
|
content_type('text/html');
|
||||||
template 'ajax/device/details.tt', {
|
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 };
|
}, { layout => undef };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -63,8 +63,13 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Serial Number</td>
|
<td>Serial Number(s)</td>
|
||||||
<td>[% d.serial | html_entity %]</td>
|
<td>
|
||||||
|
[% FOREACH s IN serials %]
|
||||||
|
<a href="[% uri_for('/report/moduleinventory') | none %]?class=chassis&matchall=on&serial=[% s | uri %]">[% s | html_entity %]</a>
|
||||||
|
[% ' (master)' IF s == d.serial AND serials.size > 1 %]<br />
|
||||||
|
[% END %]
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Chassis ID</td>
|
<td>Chassis ID</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user