Skip to content

Commit

Permalink
Show device in OSPF Interfaces table
Browse files Browse the repository at this point in the history
  • Loading branch information
LuPo committed Nov 28, 2024
1 parent dfda841 commit 53bd49c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion netbox_routing/tables/ospf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ class OSPFInterfaceTable(NetBoxTable):
verbose_name=_('Area'),
linkify=True
)
device = tables.Column(
verbose_name=_('Device'),
accessor='interface.device.name',
linkify=False
)
interface = tables.Column(
verbose_name=_('Interface'),
linkify=True
Expand All @@ -45,4 +50,4 @@ class Meta(NetBoxTable.Meta):
fields = (
'pk', 'id', 'instance', 'area', 'interface', 'passive', 'priority', 'bfd', 'authentication', 'passphrase'
)
default_columns = ('pk', 'id', 'instance', 'area', 'interface', 'passive')
default_columns = ('pk', 'id', 'instance', 'area', 'device', 'interface', 'passive')
6 changes: 6 additions & 0 deletions netbox_routing/templates/netbox_routing/ospfinterface.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ <h5 class="card-header"></h5>
{{ object.area|linkify }}
</td>
</tr>
<tr>
<th scope="row">Device</th>
<td>
{{ object.interface.device.name }}
</td>
</tr>
<tr>
<th scope="row">Interface</th>
<td>
Expand Down

0 comments on commit 53bd49c

Please sign in to comment.