diff --git a/netbox/core/tables/__init__.py b/netbox/core/tables/__init__.py index cec7342f9..de6a07c52 100644 --- a/netbox/core/tables/__init__.py +++ b/netbox/core/tables/__init__.py @@ -4,3 +4,4 @@ from .data import * from .jobs import * from .tasks import * from .plugins import * +from .plugin import * diff --git a/netbox/core/tables/plugin.py b/netbox/core/tables/plugin.py new file mode 100644 index 000000000..4e0729a74 --- /dev/null +++ b/netbox/core/tables/plugin.py @@ -0,0 +1,34 @@ +import django_tables2 as tables +from django.utils.translation import gettext_lazy as _ +from netbox.tables import BaseTable + +__all__ = ( + 'CertifiedPluginTable', +) + + +class CertifiedPluginTable(BaseTable): + version = tables.Column( + verbose_name=_('Version') + ) + last_updated = tables.Column( + accessor=tables.A('date'), + verbose_name=_('Last Updated') + ) + min_version = tables.Column( + accessor=tables.A('netbox_min_version'), + verbose_name=_('Minimum NetBox Version') + ) + max_version = tables.Column( + accessor=tables.A('netbox_max_version'), + verbose_name=_('Maximum NetBox Version') + ) + + class Meta(BaseTable.Meta): + empty_text = _('No plugin data found') + fields = ( + 'version', 'last_updated', 'min_version', 'max_version', + ) + default_columns = ( + 'version', 'last_updated', 'min_version', 'max_version', + ) diff --git a/netbox/core/views.py b/netbox/core/views.py index 6885d6682..edced1af6 100644 --- a/netbox/core/views.py +++ b/netbox/core/views.py @@ -677,6 +677,7 @@ def get_local_plugins(plugins): 'is_installed': True, 'is_certified': False, 'is_community': False, + 'versions': None, } return plugins @@ -700,6 +701,9 @@ def get_catalog_plugins(plugins): for page in get_pages(): for data in page['data']: + versions = [] + versions.append(data['release_latest']) + versions.extend(data['release_recent_history']) if data['config_name'] in plugins: plugins[data['config_name']]['is_local'] = False plugins[data['config_name']]['is_certified'] = data['release_latest']['is_certified'] @@ -718,6 +722,7 @@ def get_catalog_plugins(plugins): 'is_installed': False, 'is_certified': data['release_latest']['is_certified'], 'is_community': not data['release_latest']['is_certified'], + 'versions': versions, } return plugins diff --git a/netbox/templates/core/plugin.html b/netbox/templates/core/plugin.html index 4f6381c44..5d49521b1 100644 --- a/netbox/templates/core/plugin.html +++ b/netbox/templates/core/plugin.html @@ -53,9 +53,32 @@ From {{ plugin.description_short }}
You can install this plugin from the command line with PyPi.
+The following commands may be helpful; always refer to the plugin's own documentation and the Installing a Plugin unit of the NetBox documentation.
+1. Enter the NetBox virtual environment and install the plugin package:
+
+ source /opt/netbox/venv/bin/activate
+ pip install netbox-acls
+
+ 2. In /opt/netbox/netbox/netbox/configuration.py, add the plugin to the PLUGINS list:
+
+PLUGINS=[
+"netbox_acls',
+]
+
+ 3. Still from the NetBox virtual environment, run database migrations and collect static files:
+
+python3
+/opt/netbox/netbox/netbox/manage.py migrate
+pythons
+/opt/netbox/netbox/netbox/manage.py collectstatic
+
+ 4. Restart the NetBox services to complete the plugin installation:
+
+sudo systemctl restart netbox netbox-rq
+