small cleanup and v0.4.5

This commit is contained in:
Mattijs Vanhaverbeke
2020-05-18 18:52:56 +02:00
parent e50945f8b5
commit 0d7052d83d
4 changed files with 13 additions and 10 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.4' version = '0.4.5'
author = 'Mattijs Vanhaverbeke' author = 'Mattijs Vanhaverbeke'
author_email = 'author@example.com' author_email = 'author@example.com'
base_url = 'topology-views' base_url = 'topology-views'
+10 -7
View File
@@ -156,15 +156,18 @@ class SearchViewSet(GenericViewSet):
if dev_name is None: if dev_name is None:
dev_name = "device name unknown" dev_name = "device name unknown"
cable_role_name = device.device_type.display_name node_content = ""
if cable_role_name is None:
cable_role_name = "device role name unknown" if device.device_type.display_name is not None:
dev_title = "<table><tr><th>Type:</th><td>" + cable_role_name + "</td></tr><tr><th>Role:</th><td>" + device.device_role.name 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 != "": if device.serial != "":
dev_title = dev_title + "</td></tr><tr><th>Serial:</th><td>" + device.serial node_content += "<tr><th>Serial: </th><td>" + device.serial + "</td></tr>"
if device.primary_ip is not None: if device.primary_ip is not None:
dev_title = dev_title + "</td></tr><tr><th>IP Address:</th><td>" + str(device.primary_ip.address) node_content += "<tr><th>IP Address: </th><td>" + str(device.primary_ip.address) + "</td></tr>"
dev_title = dev_title + "</td></tr></table>"
dev_title = "<table> %s </table>" % (node_content)
node = {} node = {}
node["id"] = device.id node["id"] = device.id
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"name": "netbox_topology_views", "name": "netbox_topology_views",
"version": "0.4.4", "version": "0.4.5",
"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.4', version='0.4.5',
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',