mirror of
https://github.com/netbox-community/netbox.git
synced 2026-04-08 18:33:48 +02:00
This commit is contained in:
@@ -382,6 +382,17 @@ class PathEndpointTable(CableTerminationTable):
|
||||
orderable=False
|
||||
)
|
||||
|
||||
def value_connection(self, value):
|
||||
if value:
|
||||
connections = []
|
||||
for termination in value:
|
||||
if hasattr(termination, 'parent_object'):
|
||||
connections.append(f'{termination.parent_object} > {termination}')
|
||||
else:
|
||||
connections.append(str(termination))
|
||||
return ', '.join(connections)
|
||||
return None
|
||||
|
||||
|
||||
class ConsolePortTable(ModularDeviceComponentTable, PathEndpointTable):
|
||||
device = tables.Column(
|
||||
@@ -683,6 +694,15 @@ class InterfaceTable(BaseInterfaceTable, ModularDeviceComponentTable, PathEndpoi
|
||||
orderable=False
|
||||
)
|
||||
|
||||
def value_connection(self, record, value):
|
||||
if record.is_virtual and hasattr(record, 'virtual_circuit_termination') and record.virtual_circuit_termination:
|
||||
connections = [
|
||||
f"{t.interface.parent_object} > {t.interface} via {t.parent_object}"
|
||||
for t in record.connected_endpoints
|
||||
]
|
||||
return ', '.join(connections)
|
||||
return super().value_connection(value)
|
||||
|
||||
class Meta(DeviceComponentTable.Meta):
|
||||
model = models.Interface
|
||||
fields = (
|
||||
|
||||
Reference in New Issue
Block a user