add ifindex column for show

This commit is contained in:
Oliver Gorwits
2022-08-14 21:13:27 +01:00
parent a004db2951
commit 3684451f2a
5 changed files with 31 additions and 10 deletions

View File

@@ -379,6 +379,14 @@ Returns true if the remote LLDP neighbor has reported Telephone capability.
sub remote_is_phone { return (shift)->get_column('remote_is_phone') }
=head2 ifindex
Returns the interface index (C<ifIndex>) of the port.
=cut
sub ifindex { return (shift)->get_column('ifindex') }
=head2 remote_inventory
Returns a synthesized description of the remote LLDP device if inventory

View File

@@ -136,6 +136,8 @@ will add the following additional synthesized columns to the result set:
=item remote_is_phone (boolean)
=item ifindex
=back
=cut
@@ -152,10 +154,12 @@ sub with_properties {
properties.remote_is_discoverable
properties.remote_is_wap
properties.remote_is_phone
properties.ifindex
/],
'+as' => [qw/
error_disable_cause
remote_is_discoverable remote_is_wap remote_is_phone
ifindex
/],
join => 'properties',
});

View File

@@ -116,16 +116,17 @@ sidebar_defaults:
c_descr: { label: 'Description', default: null, idx: 2 }
c_comment: { label: 'Last Comment', default: null, idx: 3 }
c_type: { label: 'Type', default: null, idx: 4 }
c_lastchange: { label: 'Last Change', default: null, idx: 5 }
c_name: { label: 'Name', default: checked, idx: 6 }
c_speed_admin: { label: 'Speed (configured)', default: null, idx: 7 }
c_speed: { label: 'Speed (running)', default: null, idx: 8 }
c_duplex: { label: 'Duplex', default: null, idx: 9 }
c_error: { label: 'Error Message', default: null, idx: 10 }
c_mac: { label: 'Port MAC', default: null, idx: 11 }
c_mtu: { label: 'MTU', default: null, idx: 12 }
c_pvid: { label: 'Native VLAN', default: checked, idx: 13 }
c_vmember: { label: 'VLAN Membership', default: checked, idx: 14 }
c_ifindex: { label: 'Interface Index', default: null, idx: 5 }
c_lastchange: { label: 'Last Change', default: null, idx: 6 }
c_name: { label: 'Name', default: checked, idx: 7 }
c_speed_admin: { label: 'Speed (configured)', default: null, idx: 8 }
c_speed: { label: 'Speed (running)', default: null, idx: 9 }
c_duplex: { label: 'Duplex', default: null, idx: 10 }
c_error: { label: 'Error Message', default: null, idx: 11 }
c_mac: { label: 'Port MAC', default: null, idx: 12 }
c_mtu: { label: 'MTU', default: null, idx: 13 }
c_pvid: { label: 'Native VLAN', default: checked, idx: 14 }
c_vmember: { label: 'VLAN Membership', default: checked, idx: 15 }
c_power: { label: 'PoE', default: null, idx: 16 }
c_ssid: { label: 'SSID', default: null, idx: 17 }
c_nodes: { label: 'Connected Nodes', default: null, idx: 18 }

View File

@@ -153,6 +153,10 @@
</td>
[% END %]
[% IF params.c_ifindex %]
<td>[% row.ifindex | html_entity %]</td>
[% END %]
[% IF params.c_lastchange %]
<td>[% row.lastchange_stamp | html_entity %]</td>
[% END %]

View File

@@ -79,6 +79,10 @@
[% END %]
[% END %]
[% IF params.c_ifindex %]
[% myport.push(row.ifindex) %]
[% END %]
[% IF params.c_lastchange %]
[% myport.push(row.lastchange_stamp) %]
[% END %]