added coords + bump version

This commit is contained in:
Mattijs Vanhaverbeke
2022-02-21 18:14:39 +01:00
parent 683e125cd5
commit deedee78bd
6 changed files with 13 additions and 5 deletions
+8
View File
@@ -131,6 +131,14 @@ def get_topology_data(queryset):
if qs_device.device_role.color != "":
node["color.border"] = "#" + qs_device.device_role.color
if "coordinates" in qs_device.custom_field_data:
print(qs_device.custom_field_data)
if qs_device.custom_field_data["coordinates"] is not None:
cords = qs_device.custom_field_data["coordinates"].split(";")
node["x"] = int(cords[0])
node["y"] = int(cords[1])
node["physics"] = False
nodes.append(node)
results = {}