From 729218f5770a0ff03db0f973854ffd2b93f362d7 Mon Sep 17 00:00:00 2001 From: rizlas Date: Tue, 11 Jan 2022 16:21:11 +0100 Subject: [PATCH] Added possibility to exclude interfaces panel --- netbox_interface_sync/__init__.py | 3 ++- .../number_of_interfaces_panel.html | 20 ++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/netbox_interface_sync/__init__.py b/netbox_interface_sync/__init__.py index 51b9b7a..eed32d5 100644 --- a/netbox_interface_sync/__init__.py +++ b/netbox_interface_sync/__init__.py @@ -9,7 +9,8 @@ class Config(PluginConfig): author = 'Victor Golovanenko' author_email = 'drygdryg2014@yandex.ru' default_settings = { - 'exclude_virtual_interfaces': True + 'exclude_virtual_interfaces': True, + 'include_interfaces_panel': False } diff --git a/netbox_interface_sync/templates/netbox_interface_sync/number_of_interfaces_panel.html b/netbox_interface_sync/templates/netbox_interface_sync/number_of_interfaces_panel.html index 98bc1ef..8d9b2ad 100644 --- a/netbox_interface_sync/templates/netbox_interface_sync/number_of_interfaces_panel.html +++ b/netbox_interface_sync/templates/netbox_interface_sync/number_of_interfaces_panel.html @@ -1,10 +1,12 @@ -
-
Number of interfaces
-
- Total interfaces: {{ interfaces|length }}
- {% if config.exclude_virtual_interfaces %} - Non-virtual interfaces: {{ real_interfaces|length }}
- {% endif %} - Interfaces in the assigned device type: {{ interface_templates|length }} +{% if config.include_interfaces_panel %} +
+
Number of interfaces
+
+ Total interfaces: {{ interfaces|length }}
+ {% if config.exclude_virtual_interfaces %} + Non-virtual interfaces: {{ real_interfaces|length }}
+ {% endif %} + Interfaces in the assigned device type: {{ interface_templates|length }} +
-
\ No newline at end of file +{% endif %} \ No newline at end of file