|
|
@@ -69,6 +69,36 @@ def get_interface_state_attribute(record):
|
|
|
return "disabled"
|
|
|
|
|
|
|
|
|
+def get_interface_virtual_attribute(record):
|
|
|
+ """
|
|
|
+ Get interface virtual state as string to attach to <tr/> DOM element.
|
|
|
+ """
|
|
|
+ if record.is_virtual:
|
|
|
+ return "true"
|
|
|
+ else:
|
|
|
+ return "false"
|
|
|
+
|
|
|
+
|
|
|
+def get_interface_mark_connected_attribute(record):
|
|
|
+ """
|
|
|
+ Get interface enabled state as string to attach to <tr/> DOM element.
|
|
|
+ """
|
|
|
+ if record.mark_connected:
|
|
|
+ return "true"
|
|
|
+ else:
|
|
|
+ return "false"
|
|
|
+
|
|
|
+
|
|
|
+def get_interface_cable_status_attribute(record):
|
|
|
+ """
|
|
|
+ Get interface enabled state as string to attach to <tr/> DOM element.
|
|
|
+ """
|
|
|
+ if record.cable:
|
|
|
+ return record.cable.status
|
|
|
+ else:
|
|
|
+ return ""
|
|
|
+
|
|
|
+
|
|
|
#
|
|
|
# Device roles
|
|
|
#
|
|
|
@@ -673,6 +703,9 @@ class DeviceInterfaceTable(InterfaceTable):
|
|
|
'class': get_interface_row_class,
|
|
|
'data-name': lambda record: record.name,
|
|
|
'data-enabled': get_interface_state_attribute,
|
|
|
+ 'data-virtual': get_interface_virtual_attribute,
|
|
|
+ 'data-mark-connected': get_interface_mark_connected_attribute,
|
|
|
+ 'data-cable-status': get_interface_cable_status_attribute,
|
|
|
'data-type': lambda record: record.type,
|
|
|
}
|
|
|
|