mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Closes #4386: Update admin links for Django RQ to reflect multiple queues
This commit is contained in:
parent
533521b29d
commit
05fdf5e9a0
@ -11,6 +11,7 @@
|
||||
* [#4380](https://github.com/netbox-community/netbox/issues/4380) - Enable webhooks for rack reservations
|
||||
* [#4381](https://github.com/netbox-community/netbox/issues/4381) - Enable export templates for rack reservations
|
||||
* [#4382](https://github.com/netbox-community/netbox/issues/4382) - Enable custom links for rack reservations
|
||||
* [#4386](https://github.com/netbox-community/netbox/issues/4386) - Update admin links for Django RQ to reflect multiple queues
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
@ -11,7 +11,6 @@ class NetBoxAdminSite(AdminSite):
|
||||
site_header = 'NetBox Administration'
|
||||
site_title = 'NetBox'
|
||||
site_url = '/{}'.format(settings.BASE_PATH)
|
||||
index_template = 'django_rq/index.html'
|
||||
|
||||
|
||||
admin_site = NetBoxAdminSite(name='admin')
|
||||
|
@ -1,6 +1,7 @@
|
||||
from django.conf import settings
|
||||
from django.conf.urls import include
|
||||
from django.urls import path, re_path
|
||||
from django.urls import path, re_path, reverse
|
||||
from django.views.generic.base import RedirectView
|
||||
from django.views.static import serve
|
||||
from drf_yasg import openapi
|
||||
from drf_yasg.views import get_schema_view
|
||||
@ -9,6 +10,18 @@ from netbox.views import APIRootView, HomeView, StaticMediaFailureView, SearchVi
|
||||
from users.views import LoginView, LogoutView
|
||||
from .admin import admin_site
|
||||
|
||||
|
||||
# TODO: Remove in v2.9
|
||||
class RQRedirectView(RedirectView):
|
||||
"""
|
||||
Temporary 301 redirect from the old URL to the new one.
|
||||
"""
|
||||
permanent = True
|
||||
|
||||
def get_redirect_url(self, *args, **kwargs):
|
||||
return reverse('rq_home')
|
||||
|
||||
|
||||
openapi_info = openapi.Info(
|
||||
title="NetBox API",
|
||||
default_version='v2',
|
||||
@ -61,7 +74,9 @@ _patterns = [
|
||||
|
||||
# Admin
|
||||
path('admin/', admin_site.urls),
|
||||
path('admin/webhook-backend-status/', include('django_rq.urls')),
|
||||
path('admin/background-tasks/', include('django_rq.urls')),
|
||||
# TODO: Remove in v2.9
|
||||
path('admin/webhook-backend-status/', RQRedirectView.as_view()),
|
||||
|
||||
# Errors
|
||||
path('media-failure/', StaticMediaFailureView.as_view(), name='media_failure'),
|
||||
|
19
netbox/templates/admin/index.html
Normal file
19
netbox/templates/admin/index.html
Normal file
@ -0,0 +1,19 @@
|
||||
{% extends "admin/index.html" %}
|
||||
|
||||
{% block content_title %}{% endblock %}
|
||||
|
||||
{% block sidebar %}
|
||||
{{ block.super }}
|
||||
<div class="module">
|
||||
<table style="width: 100%">
|
||||
<caption>Utilities</caption>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>
|
||||
<a href="{% url 'rq_home' %}">Background Tasks</a>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user