Compare commits

...
3 Commits
Author SHA1 Message Date
mattieserver 1c9d4d8a1e Merge pull request #11 from mattieserver/17052020_dev
17052020 dev
2020-05-17 14:22:34 +02:00
Mattijs Vanhaverbeke 6fc32b9bfa v0.4.1 2020-05-17 14:20:30 +02:00
Mattijs Vanhaverbeke e0624effc2 exclude "circuit termination" type for now 2020-05-17 14:14:53 +02:00
5 changed files with 19 additions and 15 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ class TopologyViewsConfig(PluginConfig):
name = 'netbox_topology_views' name = 'netbox_topology_views'
verbose_name = 'Topology views' verbose_name = 'Topology views'
description = 'An plugin to render toplogoy maps' description = 'An plugin to render toplogoy maps'
version = '0.4.0' version = '0.4.1'
author = 'Mattijs Vanhaverbeke' author = 'Mattijs Vanhaverbeke'
author_email = 'author@example.com' author_email = 'author@example.com'
base_url = 'topology-views' base_url = 'topology-views'
+5 -1
View File
@@ -123,8 +123,9 @@ class SearchViewSet(GenericViewSet):
for device in devices: for device in devices:
cables = device.get_cables() cables = device.get_cables()
for cable in cables: for cable in cables:
if cable.termination_a_type.name != "circuit termination" and cable.termination_b_type.name != "circuit termination":
if cable.id not in cable_ids: if cable.id not in cable_ids:
if cable.termination_a_type.name not in ignore_cable_type: if cable.termination_a_type.name not in ignore_cable_type and cable.termination_b_type.name not in ignore_cable_type:
cable_ids.append(cable.id) cable_ids.append(cable.id)
edge_ids += 1 edge_ids += 1
edge = {} edge = {}
@@ -133,6 +134,9 @@ class SearchViewSet(GenericViewSet):
edge["to"] = cable.termination_b.device.id edge["to"] = cable.termination_b.device.id
edge["title"] = "Connection between <br> " + cable.termination_a.device.name + " [" + cable.termination_a.name + "]<br>" + cable.termination_b.device.name + " [" + cable.termination_b.name + "]" edge["title"] = "Connection between <br> " + cable.termination_a.device.name + " [" + cable.termination_a.name + "]<br>" + cable.termination_b.device.name + " [" + cable.termination_b.name + "]"
edges.append(edge) edges.append(edge)
else:
pass
#circuittermination not supported for now
node = {} node = {}
node["id"] = device.id node["id"] = device.id
node["name"] = device.name node["name"] = device.name
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"name": "netbox_topology_views", "name": "netbox_topology_views",
"version": "0.4.0", "version": "0.4.1",
"scripts": { "scripts": {
"resources": "gulp build", "resources": "gulp build",
"resources_dev": "gulp build_dev" "resources_dev": "gulp build_dev"
+1 -1
View File
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
setup( setup(
name='netbox-topology-views', name='netbox-topology-views',
version='0.4.0', version='0.4.1',
description='An NetBox plugin to create Topology maps', description='An NetBox plugin to create Topology maps',
url='https://github.com/mattieserver/netbox-topology-views', url='https://github.com/mattieserver/netbox-topology-views',
author='Mattijs Vanhaverbeke', author='Mattijs Vanhaverbeke',