Compare commits

..
Author SHA1 Message Date
Mattijs Vanhaverbeke 962e219325 fixed coords check 2022-02-24 10:21:55 +01:00
Mattijs Vanhaverbeke 2387e5d0cc removed distutils 2022-02-24 10:05:37 +01:00
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ class TopologyViewsConfig(PluginConfig):
name = 'netbox_topology_views'
verbose_name = 'Topology views'
description = 'An plugin to render topology maps'
version = '1.0.0-alpha.4'
version = '1.0.0-alpha.6'
author = 'Mattijs Vanhaverbeke'
author_email = 'author@example.com'
base_url = 'netbox_topology_views'
+6 -6
View File
@@ -10,7 +10,6 @@ from .forms import DeviceFilterForm
from .filters import DeviceFilterSet
import json
import distutils
from dcim.models import Device, Cable, DeviceRole, DeviceType
from extras.models import Tag
@@ -151,10 +150,11 @@ def get_topology_data(queryset, hide_unconnected):
if "coordinates" in 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
if ';' in qs_device.custom_field_data["coordinates"]:
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 = {}
@@ -182,7 +182,7 @@ class TopologyHomeView(PermissionRequiredMixin, View):
hide_unconnected = True
if 'draw_init' in request.GET:
if bool(distutils.util.strtobool(request.GET["draw_init"])):
if request.GET["draw_init"].lower() == 'true':
topo_data = get_topology_data(self.queryset, hide_unconnected)
else:
topo_data = get_topology_data(self.queryset, hide_unconnected)
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "netbox_topology_views",
"version": "1.0.0-alpha.4",
"version": "1.0.0-alpha.6",
"lockfileVersion": 2,
"requires": true,
"packages": {
+1 -1
View File
@@ -1,7 +1,7 @@
{
"private": true,
"name": "netbox_topology_views",
"version": "1.0.0-alpha.4",
"version": "1.0.0-alpha.6",
"scripts": {
"resources": "gulp build",
"resources_dev": "gulp build_dev"
+1 -1
View File
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup(
name='netbox-topology-views',
version='1.0.0-alpha.4',
version='1.0.0-alpha.6',
description='An NetBox plugin to create Topology maps',
url='https://github.com/mattieserver/netbox-topology-views',
author='Mattijs Vanhaverbeke',