Add a url to cable trace for logical connections

Fixes #254
This commit is contained in:
Roy Vegard Ovesen
2023-01-29 11:52:50 +00:00
parent c0b36ca8d3
commit b3b94f63d9
+3 -2
View File
@@ -178,7 +178,7 @@ def create_edge(
cable: Optional[Cable] = None, cable: Optional[Cable] = None,
wireless: Optional[Dict] = None, wireless: Optional[Dict] = None,
power: Optional[bool] = None, power: Optional[bool] = None,
interface: Optional[bool] = None, interface: Optional[Interface] = None,
): ):
cable_a_name = ( cable_a_name = (
"device A name unknown" "device A name unknown"
@@ -225,6 +225,7 @@ def create_edge(
edge["dashes"] = [1, 10, 1, 10] edge["dashes"] = [1, 10, 1, 10]
edge["arrows"] = {"to": {"enabled": True, "scaleFactor": 0.5}, "from": {"enabled": True, "scaleFactor": 0.5}} edge["arrows"] = {"to": {"enabled": True, "scaleFactor": 0.5}, "from": {"enabled": True, "scaleFactor": 0.5}}
edge["color"] = '#f1c232' edge["color"] = '#f1c232'
edge["href"] = interface.get_absolute_url() + "/trace"
edge[ edge[
"title" "title"
@@ -445,7 +446,7 @@ def get_topology_data(
edge_ids += 1 edge_ids += 1
termination_a = { "termination_name": interface.name, "termination_device_name": interface.device.name, "device_id": interface.device.id } termination_a = { "termination_name": interface.name, "termination_device_name": interface.device.name, "device_id": interface.device.id }
termination_b = { "termination_name": destination.name, "termination_device_name": destination.device.name, "device_id": destination.device.id } termination_b = { "termination_name": destination.name, "termination_device_name": destination.device.name, "device_id": destination.device.id }
edges.append(create_edge(edge_id=edge_ids, termination_a=termination_a, termination_b=termination_b, interface=True)) edges.append(create_edge(edge_id=edge_ids, termination_a=termination_a, termination_b=termination_b, interface=interface))
nodes_devices[interface.device.id] = interface.device nodes_devices[interface.device.id] = interface.device
nodes_devices[destination.device.id] = destination.device nodes_devices[destination.device.id] = destination.device