mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-17 21:18:16 -06:00
14728 remove plugins view from admin
This commit is contained in:
parent
85e93b839b
commit
fc3693e038
@ -15,9 +15,6 @@ plugin_api_patterns = [
|
||||
path('', views.PluginsAPIRootView.as_view(), name='api-root'),
|
||||
path('installed-plugins/', views.InstalledPluginsAPIView.as_view(), name='plugins-list')
|
||||
]
|
||||
plugin_admin_patterns = [
|
||||
path('installed-plugins/', staff_member_required(views.InstalledPluginsAdminView.as_view()), name='plugins_list')
|
||||
]
|
||||
|
||||
# Register base/API URL patterns for each plugin
|
||||
for plugin_path in settings.PLUGINS:
|
||||
|
@ -12,17 +12,6 @@ from rest_framework.reverse import reverse
|
||||
from rest_framework.views import APIView
|
||||
|
||||
|
||||
class InstalledPluginsAdminView(View):
|
||||
"""
|
||||
Admin view for listing all installed plugins
|
||||
"""
|
||||
def get(self, request):
|
||||
plugins = [apps.get_app_config(plugin) for plugin in settings.PLUGINS]
|
||||
return render(request, 'extras/admin/plugins_list.html', {
|
||||
'plugins': plugins,
|
||||
})
|
||||
|
||||
|
||||
@extend_schema(exclude=True)
|
||||
class InstalledPluginsAPIView(APIView):
|
||||
"""
|
||||
|
@ -9,7 +9,7 @@ from account.views import LoginView, LogoutView
|
||||
from netbox.api.views import APIRootView, StatusView
|
||||
from netbox.graphql.schema import schema
|
||||
from netbox.graphql.views import GraphQLView
|
||||
from netbox.plugins.urls import plugin_admin_patterns, plugin_patterns, plugin_api_patterns
|
||||
from netbox.plugins.urls import plugin_patterns, plugin_api_patterns
|
||||
from netbox.views import HomeView, StaticMediaFailureView, SearchView, htmx
|
||||
from .admin import admin_site
|
||||
|
||||
@ -73,7 +73,6 @@ _patterns = [
|
||||
|
||||
# Admin
|
||||
path('admin/background-tasks/', include('django_rq.urls')),
|
||||
path('admin/plugins/', include(plugin_admin_patterns)),
|
||||
path('admin/', admin_site.urls),
|
||||
]
|
||||
|
||||
|
@ -1,58 +0,0 @@
|
||||
{% extends "admin/base_site.html" %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "Installed Plugins" %} {{ block.super }}{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
<div class="breadcrumbs">
|
||||
<a href="{% url 'admin:index' %}">{% trans "Home" %}</a> ›
|
||||
<a href="{% url 'plugins_list' %}">{% trans "Installed Plugins" %}</a>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content_title %}<h1>{% trans "Installed Plugins" %}{{ queue.name }}</h1>{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="content-main">
|
||||
<div class="module" id="changelist">
|
||||
<div class="results">
|
||||
<table id="result_list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><div class="text"><span>{% trans "Name" %}</span></div></th>
|
||||
<th><div class="text"><span>{% trans "Package Name" %}</span></div></th>
|
||||
<th><div class="text"><span>{% trans "Author" %}</span></div></th>
|
||||
<th><div class="text"><span>{% trans "Author Email" %}</span></div></th>
|
||||
<th><div class="text"><span>{% trans "Description" %}</span></div></th>
|
||||
<th><div class="text"><span>{% trans "Version" %}</span></div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for plugin in plugins %}
|
||||
<tr class="{% cycle 'row1' 'row2' %}">
|
||||
<td>
|
||||
{{ plugin.verbose_name }}
|
||||
</td>
|
||||
<td>
|
||||
{{ plugin.name }}
|
||||
</td>
|
||||
<td>
|
||||
{{ plugin.author }}
|
||||
</td>
|
||||
<td>
|
||||
{{ plugin.author_email }}
|
||||
</td>
|
||||
<td>
|
||||
{{ plugin.description }}
|
||||
</td>
|
||||
<td>
|
||||
{{ plugin.version }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user