Compare commits

...
14 Commits
Author SHA1 Message Date
Mattijs Vanhaverbeke 6d28ce2da4 v0.4.6 2020-05-18 19:12:32 +02:00
mattieserver 8a97923bb2 Merge pull request #19 from JohannesKreuzer/color-edges
color the edges
2020-05-18 19:10:10 +02:00
Johannes Kreuzer 7f0dcd97f7 color the edges
When a cable has a color set, use this color for the edge which
repesents the cable, so that a cabling type or maybe a purpose of the cable
could be seen in the topology graph.
2020-05-18 19:03:18 +02:00
Mattijs Vanhaverbeke 0d7052d83d small cleanup and v0.4.5 2020-05-18 18:52:56 +02:00
mattieserver e50945f8b5 Merge pull request #18 from JohannesKreuzer/add-dev-details
Shorter Label and more details for device
2020-05-18 18:19:57 +02:00
Johannes Kreuzer 987aab772f move device type name to title and add more device details to title 2020-05-18 18:14:23 +02:00
Mattijs Vanhaverbeke 2ef6e7cb96 v0.4.4 2020-05-17 17:08:38 +02:00
mattieserver 570d241b7f Merge pull request #17 from mattieserver/17052020_dev_3
fixed spelling of the word 'unknown'
2020-05-17 17:06:47 +02:00
Mattijs Vanhaverbeke 2025bba6a1 fixed spelling of the word 'unknown' 2020-05-17 17:05:14 +02:00
mattieserver 22ec4fb310 Merge pull request #16 from mattieserver/17052020_dev_2
17052020 dev 2
2020-05-17 16:46:36 +02:00
Mattijs Vanhaverbeke 85b27895e2 v0.4.3 2020-05-17 16:45:19 +02:00
Mattijs Vanhaverbeke 940b37428c #15 check for NoneType in cables & devices 2020-05-17 16:41:51 +02:00
mattieserver eedcf65bd8 Update README.md 2020-05-17 14:59:55 +02:00
mattieserver bf28d2d2d1 Update README.md 2020-05-17 14:59:03 +02:00
5 changed files with 50 additions and 7 deletions
+9 -1
View File
@@ -54,4 +54,12 @@ If you add your own image you also need to add the slug to the `device_img` sett
## 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.
+1 -1
View File
@@ -4,7 +4,7 @@ class TopologyViewsConfig(PluginConfig):
name = 'netbox_topology_views'
verbose_name = 'Topology views'
description = 'An plugin to render toplogoy maps'
version = '0.4.2'
version = '0.4.6'
author = 'Mattijs Vanhaverbeke'
author_email = 'author@example.com'
base_url = 'topology-views'
+38 -3
View File
@@ -128,19 +128,54 @@ 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:
cable_ids.append(cable.id)
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 unknown"
cable_a_name = cable.termination_a.name
if cable_a_name is None:
cable_a_name = "cable A name unknown"
cable_b_dev_name = cable.termination_b.device.name
if cable_b_dev_name is None:
cable_b_dev_name = "device B name unknown"
cable_b_name = cable.termination_b.name
if cable_b_name is None:
cable_b_name = "cable B name unknown"
edge = {}
edge["id"] = edge_ids
edge["from"] = cable.termination_a.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 + "]"
if cable.color != "":
edge["color"] = "#" + cable.color
edges.append(edge)
else:
pass
#circuittermination not supported for now
dev_name = device.name
if dev_name is None:
dev_name = "device name unknown"
node_content = ""
if device.device_type.display_name is not None:
node_content += "<tr><th>Type: </th><td>" + device.device_type.display_name + "</td></tr>"
if device.device_role.name is not None:
node_content += "<tr><th>Role: </th><td>" + device.device_role.name + "</td></tr>"
if device.serial != "":
node_content += "<tr><th>Serial: </th><td>" + device.serial + "</td></tr>"
if device.primary_ip is not None:
node_content += "<tr><th>IP Address: </th><td>" + str(device.primary_ip.address) + "</td></tr>"
dev_title = "<table> %s </table>" % (node_content)
node = {}
node["id"] = device.id
node["name"] = device.name
node["label"] = device.name + " " + device.device_type.display_name
node["name"] = dev_name
node["label"] = dev_name
node["title"] = dev_title
node["shape"] = 'image'
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"
+1 -1
View File
@@ -1,7 +1,7 @@
{
"private": true,
"name": "netbox_topology_views",
"version": "0.4.2",
"version": "0.4.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='0.4.2',
version='0.4.6',
description='An NetBox plugin to create Topology maps',
url='https://github.com/mattieserver/netbox-topology-views',
author='Mattijs Vanhaverbeke',