Compare commits

..
3 Commits
Author SHA1 Message Date
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
4 changed files with 17 additions and 7 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 toplogoy maps'
version = '0.4.4'
version = '0.4.5'
author = 'Mattijs Vanhaverbeke'
author_email = 'author@example.com'
base_url = 'topology-views'
+14 -4
View File
@@ -156,14 +156,24 @@ class SearchViewSet(GenericViewSet):
if dev_name is None:
dev_name = "device name unknown"
cable_role_name = device.device_type.display_name
if cable_role_name is None:
cable_role_name = "device role 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"] = dev_name
node["label"] = dev_name + " {" + cable_role_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.4",
"version": "0.4.5",
"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.4',
version='0.4.5',
description='An NetBox plugin to create Topology maps',
url='https://github.com/mattieserver/netbox-topology-views',
author='Mattijs Vanhaverbeke',