mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 16:48:16 -06:00
14731 plugin table
This commit is contained in:
parent
af601c53a9
commit
1a33b280f2
@ -4,3 +4,4 @@ from .data import *
|
|||||||
from .jobs import *
|
from .jobs import *
|
||||||
from .tasks import *
|
from .tasks import *
|
||||||
from .plugins import *
|
from .plugins import *
|
||||||
|
from .plugin import *
|
||||||
|
34
netbox/core/tables/plugin.py
Normal file
34
netbox/core/tables/plugin.py
Normal file
@ -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',
|
||||||
|
)
|
@ -677,6 +677,7 @@ def get_local_plugins(plugins):
|
|||||||
'is_installed': True,
|
'is_installed': True,
|
||||||
'is_certified': False,
|
'is_certified': False,
|
||||||
'is_community': False,
|
'is_community': False,
|
||||||
|
'versions': None,
|
||||||
}
|
}
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
@ -700,6 +701,9 @@ def get_catalog_plugins(plugins):
|
|||||||
for page in get_pages():
|
for page in get_pages():
|
||||||
for data in page['data']:
|
for data in page['data']:
|
||||||
|
|
||||||
|
versions = []
|
||||||
|
versions.append(data['release_latest'])
|
||||||
|
versions.extend(data['release_recent_history'])
|
||||||
if data['config_name'] in plugins:
|
if data['config_name'] in plugins:
|
||||||
plugins[data['config_name']]['is_local'] = False
|
plugins[data['config_name']]['is_local'] = False
|
||||||
plugins[data['config_name']]['is_certified'] = data['release_latest']['is_certified']
|
plugins[data['config_name']]['is_certified'] = data['release_latest']['is_certified']
|
||||||
@ -718,6 +722,7 @@ def get_catalog_plugins(plugins):
|
|||||||
'is_installed': False,
|
'is_installed': False,
|
||||||
'is_certified': data['release_latest']['is_certified'],
|
'is_certified': data['release_latest']['is_certified'],
|
||||||
'is_community': not data['release_latest']['is_certified'],
|
'is_community': not data['release_latest']['is_certified'],
|
||||||
|
'versions': versions,
|
||||||
}
|
}
|
||||||
|
|
||||||
return plugins
|
return plugins
|
||||||
|
@ -53,9 +53,32 @@ From
|
|||||||
{{ plugin.description_short }}
|
{{ plugin.description_short }}
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane" id="version-history" role="tabpanel" aria-labelledby="version-history-tab">
|
<div class="tab-pane" id="version-history" role="tabpanel" aria-labelledby="version-history-tab">
|
||||||
y
|
{{ plugin.versions }}
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane" id="install" role="tabpanel" aria-labelledby="install-tab">
|
<div class="tab-pane" id="install" role="tabpanel" aria-labelledby="install-tab">
|
||||||
z
|
<p>You can install this plugin from the command line with PyPi.</p>
|
||||||
|
<p>The following commands may be helpful; always refer to the plugin's own documentation and the Installing a Plugin unit of the NetBox documentation.</p>
|
||||||
|
<p>1. Enter the NetBox virtual environment and install the plugin package:</p>
|
||||||
|
<code>
|
||||||
|
source /opt/netbox/venv/bin/activate<br />
|
||||||
|
pip install netbox-acls
|
||||||
|
</code>
|
||||||
|
<p>2. In /opt/netbox/netbox/netbox/configuration.py, add the plugin to the PLUGINS list:</p>
|
||||||
|
<code>
|
||||||
|
PLUGINS=[<br />
|
||||||
|
"netbox_acls',<br />
|
||||||
|
]
|
||||||
|
</code>
|
||||||
|
<p>3. Still from the NetBox virtual environment, run database migrations and collect static files:</p>
|
||||||
|
<code>
|
||||||
|
python3<br />
|
||||||
|
/opt/netbox/netbox/netbox/manage.py migrate<br />
|
||||||
|
pythons<br />
|
||||||
|
/opt/netbox/netbox/netbox/manage.py collectstatic
|
||||||
|
</code>
|
||||||
|
<p>4. Restart the NetBox services to complete the plugin installation:</p>
|
||||||
|
<code>
|
||||||
|
sudo systemctl restart netbox netbox-rq
|
||||||
|
</code>
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
Loading…
Reference in New Issue
Block a user