added coords + bump version
This commit is contained in:
@@ -4,7 +4,7 @@ class TopologyViewsConfig(PluginConfig):
|
||||
name = 'netbox_topology_views'
|
||||
verbose_name = 'Topology views'
|
||||
description = 'An plugin to render topology maps'
|
||||
version = '0.5.3'
|
||||
version = '1.0.0-alpha.1'
|
||||
author = 'Mattijs Vanhaverbeke'
|
||||
author_email = 'author@example.com'
|
||||
base_url = 'netbox_topology_views'
|
||||
|
||||
@@ -8,7 +8,7 @@ menu_items = (
|
||||
buttons=(
|
||||
PluginMenuButton(
|
||||
link='plugins:netbox_topology_views:home',
|
||||
title='AS Numbers',
|
||||
title='Topology View',
|
||||
icon_class='mdi mdi-plus-thick',
|
||||
permissions=[],
|
||||
),
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user