color the edges

When a cable has a color set, use this color for the edge which
repesents the cable, so that a cabling type or maybe a purpose of the cable
could be seen in the topology graph.
This commit is contained in:
Johannes Kreuzer
2020-05-18 19:03:18 +02:00
parent 0d7052d83d
commit 7f0dcd97f7
+2
View File
@@ -147,6 +147,8 @@ class SearchViewSet(GenericViewSet):
edge["from"] = cable.termination_a.device.id
edge["to"] = cable.termination_b.device.id
edge["title"] = "Connection between <br> " + cable_a_dev_name + " [" + cable_a_name + "]<br>" + cable_b_dev_name + " [" + cable_b_name + "]"
if cable.color != "":
edge["color"] = "#" + cable.color
edges.append(edge)
else:
pass