mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Added dedicated cable trace view; removed modal
This commit is contained in:
@@ -85,6 +85,7 @@ class CableTermination(models.Model):
|
||||
]
|
||||
"""
|
||||
def get_peer_port(termination, position=1):
|
||||
from circuits.models import CircuitTermination
|
||||
|
||||
# Map a front port to its corresponding rear port
|
||||
if isinstance(termination, FrontPort):
|
||||
@@ -102,6 +103,13 @@ class CableTermination(models.Model):
|
||||
)
|
||||
return peer_port, 1
|
||||
|
||||
# Follow a circuit to its other termination
|
||||
elif isinstance(termination, CircuitTermination):
|
||||
peer_termination = termination.get_peer_termination()
|
||||
if peer_termination is None:
|
||||
return None, None
|
||||
return peer_termination, position
|
||||
|
||||
# Termination is not a pass-through port
|
||||
else:
|
||||
return None, None
|
||||
|
Reference in New Issue
Block a user