diff --git a/README.md b/README.md index a51e723..8e4dced 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ The features the plugin provides should be listed here. | 3.5 | 0.1.0 | | 3.5.8 | 0.1.4 | | 3.6.0 | 0.1.5 | -| 3.7.0 | 0.1.7 | +| < 3.7.6 | 0.1.7 | +| >= 4.0.2 | 0.2.1 | ## Installation diff --git a/netbox_napalm_plugin/__init__.py b/netbox_napalm_plugin/__init__.py index 71d870a..3715a98 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.2.0" +__version__ = "0.2.1" 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.2' max_version = '4.0.99' diff --git a/netbox_napalm_plugin/project-static/js/util.ts b/netbox_napalm_plugin/project-static/js/util.ts index 9f6ff10..49b25c0 100644 --- a/netbox_napalm_plugin/project-static/js/util.ts +++ b/netbox_napalm_plugin/project-static/js/util.ts @@ -258,7 +258,8 @@ export function getNetboxData(key: string): string | null { if (!key.startsWith('data-')) { key = `data-${key}`; } - for (const element of getElements('body > div#netbox-data > *')) { + var parent_div = document.getElementById("netbox-data"); + for (const element of parent_div.children) { const value = element.getAttribute(key); if (isTruthy(value)) { return value; diff --git a/netbox_napalm_plugin/static/netbox_napalm_plugin/js/config.js b/netbox_napalm_plugin/static/netbox_napalm_plugin/js/config.js index fa33a24..858cb34 100644 --- a/netbox_napalm_plugin/static/netbox_napalm_plugin/js/config.js +++ b/netbox_napalm_plugin/static/netbox_napalm_plugin/js/config.js @@ -5270,7 +5270,8 @@ if (!key.startsWith("data-")) { key = `data-${key}`; } - for (const element of getElements("body > div#netbox-data > *")) { + var parent_div = document.getElementById("netbox-data"); + for (const element of parent_div.children) { const value = element.getAttribute(key); if (isTruthy(value)) { return value; diff --git a/netbox_napalm_plugin/static/netbox_napalm_plugin/js/lldp.js b/netbox_napalm_plugin/static/netbox_napalm_plugin/js/lldp.js index a3c2e71..7f9e5d8 100644 --- a/netbox_napalm_plugin/static/netbox_napalm_plugin/js/lldp.js +++ b/netbox_napalm_plugin/static/netbox_napalm_plugin/js/lldp.js @@ -5270,7 +5270,8 @@ if (!key.startsWith("data-")) { key = `data-${key}`; } - for (const element of getElements("body > div#netbox-data > *")) { + var parent_div = document.getElementById("netbox-data"); + for (const element of parent_div.children) { const value = element.getAttribute(key); if (isTruthy(value)) { return value; diff --git a/netbox_napalm_plugin/static/netbox_napalm_plugin/js/status.js b/netbox_napalm_plugin/static/netbox_napalm_plugin/js/status.js index a446530..1d0cfce 100644 --- a/netbox_napalm_plugin/static/netbox_napalm_plugin/js/status.js +++ b/netbox_napalm_plugin/static/netbox_napalm_plugin/js/status.js @@ -5851,7 +5851,8 @@ if (!key.startsWith("data-")) { key = `data-${key}`; } - for (const element of getElements("body > div#netbox-data > *")) { + var parent_div = document.getElementById("netbox-data"); + for (const element of parent_div.children) { const value = element.getAttribute(key); if (isTruthy(value)) { return value; diff --git a/netbox_napalm_plugin/templates/netbox_napalm_plugin/config.html b/netbox_napalm_plugin/templates/netbox_napalm_plugin/config.html index 84ee093..376b3a2 100644 --- a/netbox_napalm_plugin/templates/netbox_napalm_plugin/config.html +++ b/netbox_napalm_plugin/templates/netbox_napalm_plugin/config.html @@ -38,8 +38,8 @@