From b37a67d70cc90bfc15944ef8698d0eaf36cdbf25 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 6 May 2024 11:44:53 -0700 Subject: [PATCH] update for NetBox 4.0 --- CHANGELOG.md | 4 + netbox_napalm_plugin/__init__.py | 4 +- .../project-static/package.json | 14 ++- .../netbox_napalm_plugin/lldp_neighbors.html | 78 ++++++------- .../napalmplatformconfig.html | 22 ++-- .../netbox_napalm_plugin/status.html | 108 +++++++++--------- pyproject.toml | 7 +- 7 files changed, 118 insertions(+), 119 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c0179c..a113d63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.2.0 (2024-05-06) + +* For NetBox 4.0 + ## 0.1.9 (2024-04-29) * Fix js in distro diff --git a/netbox_napalm_plugin/__init__.py b/netbox_napalm_plugin/__init__.py index 4f17ee6..4393466 100644 --- a/netbox_napalm_plugin/__init__.py +++ b/netbox_napalm_plugin/__init__.py @@ -2,7 +2,7 @@ __author__ = """Arthur Hanson""" __email__ = "ahanson@netboxlabs.com" -__version__ = "0.1.9" +__version__ = "0.2.0" from netbox.plugins import PluginConfig @@ -21,7 +21,7 @@ class NapalmPlatformConfig(PluginConfig): 'NAPALM_TIMEOUT': 30, 'NAPALM_ARGS': {}, } - min_version = '4.0-beta1' + min_version = '4.0.0' max_version = '4.0.99' diff --git a/netbox_napalm_plugin/project-static/package.json b/netbox_napalm_plugin/project-static/package.json index 639fa6b..c5073b3 100644 --- a/netbox_napalm_plugin/project-static/package.json +++ b/netbox_napalm_plugin/project-static/package.json @@ -1,6 +1,6 @@ { "name": "netbox_napalm_plugin", - "version": "0.1.9", + "version": "0.2.0", "description": "Napalm Plugin for NetBox", "main": "index.js", "author": "Arthur Hanson", @@ -9,9 +9,13 @@ "build": "node build.mjs" }, "dependencies": { - "@popperjs/core": "^2.11.6", - "bootstrap": "~5.0.2", - "dayjs": "^1.11.5", - "esbuild": "^0.17.8" + "bootstrap": "~5.3.3", + "dayjs": "^1.11.5" + }, + "devDependencies": { + "esbuild": "^0.13.15" + }, + "resolutions": { + "@types/bootstrap/**/@popperjs/core": "^2.11.6" } } diff --git a/netbox_napalm_plugin/templates/netbox_napalm_plugin/lldp_neighbors.html b/netbox_napalm_plugin/templates/netbox_napalm_plugin/lldp_neighbors.html index 6f661e4..d03efd9 100644 --- a/netbox_napalm_plugin/templates/netbox_napalm_plugin/lldp_neighbors.html +++ b/netbox_napalm_plugin/templates/netbox_napalm_plugin/lldp_neighbors.html @@ -17,47 +17,45 @@
LLDP Neighbors
-
- - - - - - - - - - - - {% for iface in interfaces %} - - - {% with peer=iface.connected_endpoints.0 %} - {% if peer.device %} - - + {% endif %} + {% endwith %} + + + + {% endfor %} + +
InterfaceConfigured DeviceConfigured InterfaceLLDP DeviceLLDP Interface
{{ iface }} - {{ peer.device }} - - {{ peer }} + + + + + + + + + + + + {% for iface in interfaces %} + + + {% with peer=iface.connected_endpoints.0 %} + {% if peer.device %} + + + {% elif peer.circuit %} + {% with circuit=peer.circuit %} + - {% elif peer.circuit %} - {% with circuit=peer.circuit %} - - {% endwith %} - {% else %} - - {% endif %} - {% endwith %} - - - - {% endfor %} - -
InterfaceConfigured DeviceConfigured InterfaceLLDP DeviceLLDP Interface
{{ iface }} + {{ peer.device }} + + {{ peer }} + + + {{ circuit.provider }} {{ circuit }} - - {{ circuit.provider }} {{ circuit }} - None
- + {% endwith %} + {% else %} +
None
{% endblock %} diff --git a/netbox_napalm_plugin/templates/netbox_napalm_plugin/napalmplatformconfig.html b/netbox_napalm_plugin/templates/netbox_napalm_plugin/napalmplatformconfig.html index c0c257c..b10c1d6 100644 --- a/netbox_napalm_plugin/templates/netbox_napalm_plugin/napalmplatformconfig.html +++ b/netbox_napalm_plugin/templates/netbox_napalm_plugin/napalmplatformconfig.html @@ -9,18 +9,16 @@
NetBox Napalm Plugin
-
- - - - - - - - - -
Platform{{ object.platform|linkify|placeholder }}
NAPALM Driver{{ object.napalm_driver|placeholder }}
-
+ + + + + + + + + +
Platform{{ object.platform|linkify|placeholder }}
NAPALM Driver{{ object.napalm_driver|placeholder }}
{% include 'inc/panels/tags.html' %} {% include 'inc/panels/custom_fields.html' %} diff --git a/netbox_napalm_plugin/templates/netbox_napalm_plugin/status.html b/netbox_napalm_plugin/templates/netbox_napalm_plugin/status.html index 16c2b43..0f4cd12 100644 --- a/netbox_napalm_plugin/templates/netbox_napalm_plugin/status.html +++ b/netbox_napalm_plugin/templates/netbox_napalm_plugin/status.html @@ -17,41 +17,39 @@
Device Facts
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Hostname
FQDN
Vendor
Model
Serial Number
OS Version
Uptime -
-
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Hostname
FQDN
Vendor
Model
Serial Number
OS Version
Uptime +
+
+
@@ -62,27 +60,25 @@
Device Facts
Environment
-
- - - - - - - - - - - - - - - - - - -
CPU
Memory
Temperature
Fans
Power
-
+ + + + + + + + + + + + + + + + + + +
CPU
Memory
Temperature
Fans
Power
diff --git a/pyproject.toml b/pyproject.toml index 454ca22..0fd688c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta" [project] name = "netbox-napalm-plugin" -version = "0.1.9" +version = "0.2.0" authors = [ {name = "Arthur Hanson", email = "ahanson@netboxlabs.com"}, ] @@ -19,13 +19,12 @@ classifiers=[ 'Intended Audience :: Developers', 'Natural Language :: English', "Programming Language :: Python :: 3 :: Only", - 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', ] -requires-python = ">=3.8.1" +requires-python = ">=3.10.0" dependencies = [ 'napalm<5.0' ] @@ -47,7 +46,7 @@ Tracker = "https://github.com/netbox-community/netbox-napalm-plugin/issues" [tool.black] line-length = 120 -target_version = ['py39', 'py310', 'py311', 'py312'] +target_version = ['py310', 'py311', 'py312'] [tool.setuptools.package-data] netbox_napalm_plugin = ["templates/**"]