From 94bd27bcf5e63283164e55b9c1a330a88ed667ed Mon Sep 17 00:00:00 2001 From: Miguel Teixeira <816267+CironAkono@users.noreply.github.com> Date: Sun, 24 Oct 2021 03:24:54 +0100 Subject: [PATCH 1/3] Fix interface icons on the device interfaces table --- netbox/dcim/tables/devices.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/dcim/tables/devices.py b/netbox/dcim/tables/devices.py index c22e673b78c..8939c01be56 100644 --- a/netbox/dcim/tables/devices.py +++ b/netbox/dcim/tables/devices.py @@ -501,8 +501,8 @@ class Meta(DeviceComponentTable.Meta): class DeviceInterfaceTable(InterfaceTable): name = tables.TemplateColumn( - template_code=' {{ value }}', order_by=Accessor('_name'), attrs={'td': {'class': 'text-nowrap'}} From b07e88869aa382fa45643470f05bd6f7abbb1780 Mon Sep 17 00:00:00 2001 From: Miguel Teixeira <816267+CironAkono@users.noreply.github.com> Date: Sun, 24 Oct 2021 03:31:29 +0100 Subject: [PATCH 2/3] Fix interfaces row colors on device interfaces table --- netbox/dcim/tables/devices.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/netbox/dcim/tables/devices.py b/netbox/dcim/tables/devices.py index 8939c01be56..51202267991 100644 --- a/netbox/dcim/tables/devices.py +++ b/netbox/dcim/tables/devices.py @@ -53,6 +53,16 @@ def get_cabletermination_row_class(record): return '' +def get_interface_row_class(record): + if not record.enabled: + return 'danger' + elif not record.is_connectable: + return 'primary' + else: + return get_cabletermination_row_class(record) + return '' + + def get_interface_state_attribute(record): """ Get interface enabled state as string to attach to