From 53bd49c84b301601296f483739a4cbcc964334e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Pola=C5=84ski?= Date: Tue, 26 Nov 2024 23:59:02 +0100 Subject: [PATCH] Show device in OSPF Interfaces table --- netbox_routing/tables/ospf.py | 7 ++++++- netbox_routing/templates/netbox_routing/ospfinterface.html | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/netbox_routing/tables/ospf.py b/netbox_routing/tables/ospf.py index 5460e79..71361a6 100644 --- a/netbox_routing/tables/ospf.py +++ b/netbox_routing/tables/ospf.py @@ -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 @@ -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') diff --git a/netbox_routing/templates/netbox_routing/ospfinterface.html b/netbox_routing/templates/netbox_routing/ospfinterface.html index 7916afa..8e649b5 100644 --- a/netbox_routing/templates/netbox_routing/ospfinterface.html +++ b/netbox_routing/templates/netbox_routing/ospfinterface.html @@ -22,6 +22,12 @@
{{ object.area|linkify }} + + Device + + {{ object.interface.device.name }} + + Interface