File tree Expand file tree Collapse file tree 10 files changed +24
-17
lines changed
static/netbox_napalm_plugin/js
templates/netbox_napalm_plugin Expand file tree Collapse file tree 10 files changed +24
-17
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ The features the plugin provides should be listed here.
1818| 3.5 | 0.1.0 |
1919| 3.5.8 | 0.1.4 |
2020| 3.6.0 | 0.1.5 |
21- | 3.7.0 | 0.1.7 |
21+ | < 3.7.6 | 0.1.7 |
22+ | >= 4.0.2 | 0.2.1 |
2223
2324## Installation
2425
Original file line number Diff line number Diff line change 22
33__author__ = """Arthur Hanson"""
445- __version__ = "0.2.0 "
5+ __version__ = "0.2.1 "
66
77
88from netbox .plugins import PluginConfig
@@ -21,7 +21,7 @@ class NapalmPlatformConfig(PluginConfig):
2121 'NAPALM_TIMEOUT' : 30 ,
2222 'NAPALM_ARGS' : {},
2323 }
24- min_version = '4.0-beta1 '
24+ min_version = '4.0.2 '
2525 max_version = '4.0.99'
2626
2727
Original file line number Diff line number Diff line change @@ -258,7 +258,8 @@ export function getNetboxData(key: string): string | null {
258258 if ( ! key . startsWith ( 'data-' ) ) {
259259 key = `data-${ key } ` ;
260260 }
261- for ( const element of getElements ( 'body > div#netbox-data > *' ) ) {
261+ var parent_div = document . getElementById ( "netbox-data" ) ;
262+ for ( const element of parent_div . children ) {
262263 const value = element . getAttribute ( key ) ;
263264 if ( isTruthy ( value ) ) {
264265 return value ;
Original file line number Diff line number Diff line change 52705270 if ( ! key . startsWith ( "data-" ) ) {
52715271 key = `data-${ key } ` ;
52725272 }
5273- for ( const element of getElements ( "body > div#netbox-data > *" ) ) {
5273+ var parent_div = document . getElementById ( "netbox-data" ) ;
5274+ for ( const element of parent_div . children ) {
52745275 const value = element . getAttribute ( key ) ;
52755276 if ( isTruthy ( value ) ) {
52765277 return value ;
Original file line number Diff line number Diff line change 52705270 if ( ! key . startsWith ( "data-" ) ) {
52715271 key = `data-${ key } ` ;
52725272 }
5273- for ( const element of getElements ( "body > div#netbox-data > *" ) ) {
5273+ var parent_div = document . getElementById ( "netbox-data" ) ;
5274+ for ( const element of parent_div . children ) {
52745275 const value = element . getAttribute ( key ) ;
52755276 if ( isTruthy ( value ) ) {
52765277 return value ;
Original file line number Diff line number Diff line change 58515851 if ( ! key . startsWith ( "data-" ) ) {
58525852 key = `data-${ key } ` ;
58535853 }
5854- for ( const element of getElements ( "body > div#netbox-data > *" ) ) {
5854+ var parent_div = document . getElementById ( "netbox-data" ) ;
5855+ for ( const element of parent_div . children ) {
58555856 const value = element . getAttribute ( key ) ;
58565857 if ( isTruthy ( value ) ) {
58575858 return value ;
Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ <h5 class="card-header">Device Configuration</h5>
3838 </ div >
3939 </ div >
4040</ div >
41- {% endblock %}
41+ < div id ="netbox-data " style ="display: none!important; visibility: hidden!important ">
42+ < span data-object-url ="{% url 'plugins-api:netbox_napalm_plugin-api:napalmplatformconfig-napalm' pk=object.pk %}?method=get_config "> </ span >
43+ </ div >
4244
43- {% block data %}
44- < span data-object-url ="{% url 'plugins-api:netbox_napalm_plugin-api:napalmplatformconfig-napalm' pk=object.pk %}?method=get_config "> </ span >
4545{% endblock %}
Original file line number Diff line number Diff line change @@ -57,8 +57,9 @@ <h5 class="d-inline">LLDP Neighbors</h5>
5757 </ tbody >
5858 </ table >
5959 </ div >
60+ < div id ="netbox-data " style ="display: none!important; visibility: hidden!important ">
61+ < span data-object-url ="{% url 'plugins-api:netbox_napalm_plugin-api:napalmplatformconfig-napalm' pk=object.pk %}?method=get_lldp_neighbors_detail "> </ span >
62+ </ div >
6063{% endblock %}
6164
62- {% block data %}
63- < span data-object-url ="{% url 'plugins-api:netbox_napalm_plugin-api:napalmplatformconfig-napalm' pk=object.pk %}?method=get_lldp_neighbors_detail "> </ span >
64- {% endblock %}
65+
Original file line number Diff line number Diff line change @@ -82,8 +82,9 @@ <h5 class="card-header">Environment</h5>
8282 </ div >
8383 </ div >
8484 </ div >
85- {% endblock %}
85+ < div id ="netbox-data " style ="display: none!important; visibility: hidden!important ">
86+ < span data-object-url ="{% url 'plugins-api:netbox_napalm_plugin-api:napalmplatformconfig-napalm' pk=object.pk %}?method=get_facts&method=get_environment "> </ span >
87+ </ div >
8688
87- {% block data %}
88- < span data-object-url ="{% url 'plugins-api:netbox_napalm_plugin-api:napalmplatformconfig-napalm' pk=object.pk %}?method=get_facts&method=get_environment "> </ span >
8989{% endblock %}
90+
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77
88[project ]
99name = " netbox-napalm-plugin"
10- version = " 0.2.0 "
10+ version = " 0.2.1 "
1111authors = [
1212 {
name =
" Arthur Hanson" ,
email =
" [email protected] " },
1313]
You can’t perform that action at this time.
0 commit comments