Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22ec4fb310 | ||
|
|
85b27895e2 | ||
|
|
940b37428c | ||
|
|
eedcf65bd8 | ||
|
|
bf28d2d2d1 |
@@ -54,4 +54,12 @@ If you add your own image you also need to add the slug to the `device_img` sett
|
|||||||
|
|
||||||
## Use
|
## Use
|
||||||
|
|
||||||
Go to the plugins tab in the navbar and click topology or go to NETBOX_URL/plugins/topology-views/ view your topologies
|
Go to the plugins tab in the navbar and click topology or go to `$NETBOX_URL/plugins/topology-views/` to view your topologies
|
||||||
|
|
||||||
|
### Update
|
||||||
|
|
||||||
|
Run `pip install netbox-topology-views --upgrade` in your venv.
|
||||||
|
|
||||||
|
Run `python3 manage.py collectstatic --no-input`
|
||||||
|
|
||||||
|
Clear you browser cache.
|
||||||
|
|||||||
@@ -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.2'
|
version = '0.4.3'
|
||||||
author = 'Mattijs Vanhaverbeke'
|
author = 'Mattijs Vanhaverbeke'
|
||||||
author_email = 'author@example.com'
|
author_email = 'author@example.com'
|
||||||
base_url = 'topology-views'
|
base_url = 'topology-views'
|
||||||
|
|||||||
@@ -128,19 +128,42 @@ class SearchViewSet(GenericViewSet):
|
|||||||
if cable.termination_a_type.name not in ignore_cable_type and cable.termination_b_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
|
||||||
|
|
||||||
|
cable_a_dev_name = cable.termination_a.device.name
|
||||||
|
if cable_a_dev_name is None:
|
||||||
|
cable_a_dev_name = "device A name unkown"
|
||||||
|
cable_a_name = cable.termination_a.name
|
||||||
|
if cable_a_name is None:
|
||||||
|
cable_a_name = "cable A name unkown"
|
||||||
|
cable_b_dev_name = cable.termination_b.device.name
|
||||||
|
if cable_b_dev_name is None:
|
||||||
|
cable_b_dev_name = "device B name unkown"
|
||||||
|
cable_b_name = cable.termination_b.name
|
||||||
|
if cable_b_name is None:
|
||||||
|
cable_b_name = "cable B name unkown"
|
||||||
|
|
||||||
edge = {}
|
edge = {}
|
||||||
edge["id"] = edge_ids
|
edge["id"] = edge_ids
|
||||||
edge["from"] = cable.termination_a.device.id
|
edge["from"] = cable.termination_a.device.id
|
||||||
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_a_dev_name + " [" + cable_a_name + "]<br>" + cable_b_dev_name + " [" + cable_b_name + "]"
|
||||||
edges.append(edge)
|
edges.append(edge)
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
#circuittermination not supported for now
|
#circuittermination not supported for now
|
||||||
|
|
||||||
|
dev_name = device.name
|
||||||
|
if dev_name is None:
|
||||||
|
dev_name = "device name unkown"
|
||||||
|
|
||||||
|
cable_role_name = device.device_type.display_name
|
||||||
|
if cable_role_name is None:
|
||||||
|
cable_role_name = "device role name unkown"
|
||||||
|
|
||||||
node = {}
|
node = {}
|
||||||
node["id"] = device.id
|
node["id"] = device.id
|
||||||
node["name"] = device.name
|
node["name"] = dev_name
|
||||||
node["label"] = device.name + " " + device.device_type.display_name
|
node["label"] = dev_name + " {" + cable_role_name + "}"
|
||||||
node["shape"] = 'image'
|
node["shape"] = 'image'
|
||||||
if device.device_role.slug in settings.PLUGINS_CONFIG["netbox_topology_views"]["device_img"]:
|
if device.device_role.slug in settings.PLUGINS_CONFIG["netbox_topology_views"]["device_img"]:
|
||||||
node["image"] = '../../static/netbox_topology_views/img/' + device.device_role.slug + ".png"
|
node["image"] = '../../static/netbox_topology_views/img/' + device.device_role.slug + ".png"
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"name": "netbox_topology_views",
|
"name": "netbox_topology_views",
|
||||||
"version": "0.4.2",
|
"version": "0.4.3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"resources": "gulp build",
|
"resources": "gulp build",
|
||||||
"resources_dev": "gulp build_dev"
|
"resources_dev": "gulp build_dev"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='netbox-topology-views',
|
name='netbox-topology-views',
|
||||||
version='0.4.2',
|
version='0.4.3',
|
||||||
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',
|
||||||
|
|||||||
Reference in New Issue
Block a user