Skip to content

Commit 21693e4

Browse files
authored
Make device name a link in a node tooltip (#44)
1 parent 2fc3f6c commit 21693e4

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

nextbox_ui_plugin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class NextBoxUIConfig(PluginConfig):
44
name = 'nextbox_ui_plugin'
55
verbose_name = 'NextBox UI'
66
description = 'A topology visualization plugin for Netbox powered by NextUI Toolkit.'
7-
version = '0.7.0'
7+
version = '0.7.1'
88
author = 'Igor Korotchenkov'
99
author_email = 'iDebugAll@gmail.com'
1010
base_url = 'nextbox-ui'

nextbox_ui_plugin/static/nextbox_ui_plugin/next_app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
content: [{
116116
tag: 'a',
117117
content: '{#node.model.name}',
118-
props: {"href": "{#node.model.dcimDeviceLink}"}
118+
props: {"href": "{#node.model.dcimDeviceLink}", "target": "_blank", "rel": "noopener noreferrer"}
119119
}],
120120
props: {
121121
"style": "border-bottom: dotted 1px; font-size:90%; word-wrap:normal; color:#003688"

nextbox_ui_plugin/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ def get_topology(nb_devices_qs):
238238
device_ids = [d.id for d in nb_devices_qs]
239239
for nb_device in nb_devices_qs:
240240
device_is_passive = False
241+
device_url = nb_device.get_absolute_url()
241242
primary_ip = ''
242243
if nb_device.primary_ip:
243244
primary_ip = str(nb_device.primary_ip.address)
@@ -264,6 +265,7 @@ def get_topology(nb_devices_qs):
264265
topology_dict['nodes'].append({
265266
'id': nb_device.id,
266267
'name': nb_device.name,
268+
'dcimDeviceLink': device_url,
267269
'primaryIP': primary_ip,
268270
'serial_number': nb_device.serial,
269271
'model': nb_device.device_type.model,

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
setup(
99
name='nextbox_ui_plugin',
10-
version='0.7.0',
10+
version='0.7.1',
1111
url='https://github.com/iDebugAll/nextbox-ui-plugin',
12-
download_url='https://github.com/iDebugAll/nextbox-ui-plugin/archive/v0.7.0.tar.gz',
12+
download_url='https://github.com/iDebugAll/nextbox-ui-plugin/archive/v0.7.1.tar.gz',
1313
description='A topology visualization plugin for Netbox powered by NextUI Toolkit.',
1414
long_description=long_description,
1515
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)