mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Add Hide Disconnected Button to Interface Summary, Remove Unused Table Caption Descriptor - Close #12732
This commit is contained in:
committed by
Jeremy Stretch
parent
685ac5f571
commit
27297c7556
@@ -64,9 +64,19 @@ def get_interface_state_attribute(record):
|
||||
Get interface enabled state as string to attach to <tr/> DOM element.
|
||||
"""
|
||||
if record.enabled:
|
||||
return "enabled"
|
||||
return 'enabled'
|
||||
else:
|
||||
return "disabled"
|
||||
return 'disabled'
|
||||
|
||||
|
||||
def get_interface_connected_attribute(record):
|
||||
"""
|
||||
Get interface disconnected state as string to attach to <tr/> DOM element.
|
||||
"""
|
||||
if record.mark_connected or record.cable:
|
||||
return 'connected'
|
||||
else:
|
||||
return 'disconnected'
|
||||
|
||||
|
||||
#
|
||||
@@ -674,6 +684,7 @@ class DeviceInterfaceTable(InterfaceTable):
|
||||
'data-name': lambda record: record.name,
|
||||
'data-enabled': get_interface_state_attribute,
|
||||
'data-type': lambda record: record.type,
|
||||
'data-connected': get_interface_connected_attribute
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user