mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-18 05:28:16 -06:00
14729 add modal
This commit is contained in:
parent
3da1efd23e
commit
282ee42457
@ -251,8 +251,8 @@ class BackgroundQueuesListView(UserPassesTestMixin, View):
|
|||||||
return self.request.user.is_staff
|
return self.request.user.is_staff
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
table = tables.BackgroundQueueTable(get_statistics(run_maintenance_tasks=True)["queues"])
|
table = tables.BackgroundQueueTable(get_statistics(run_maintenance_tasks=True)["queues"], user=request.user)
|
||||||
table.configure(request, user=request.user)
|
table.configure(request)
|
||||||
return render(request, 'core/background_tasks.html', {
|
return render(request, 'core/background_tasks.html', {
|
||||||
'table': table,
|
'table': table,
|
||||||
})
|
})
|
||||||
@ -272,8 +272,8 @@ class BackgroundTasksListView(UserPassesTestMixin, View):
|
|||||||
else:
|
else:
|
||||||
jobs = []
|
jobs = []
|
||||||
|
|
||||||
table = tables.BackgroundTaskTable(data=jobs, queue_index=queue_index)
|
table = tables.BackgroundTaskTable(data=jobs, user=request.user, queue_index=queue_index)
|
||||||
table.configure(request, user=request.user)
|
table.configure(request)
|
||||||
return render(request, 'core/background_tasks_queue.html', {
|
return render(request, 'core/background_tasks_queue.html', {
|
||||||
'table': table,
|
'table': table,
|
||||||
'queue': queue,
|
'queue': queue,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{% extends 'generic/_base.html' %}
|
{% extends 'generic/_base.html' %}
|
||||||
|
{% load helpers %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load render_table from django_tables2 %}
|
{% load render_table from django_tables2 %}
|
||||||
|
|
||||||
@ -13,5 +14,22 @@
|
|||||||
{% endblock tabs %}
|
{% endblock tabs %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-auto ms-auto d-print-none">
|
||||||
|
{# Table configuration button #}
|
||||||
|
<div class="table-configure input-group">
|
||||||
|
<button type="button" data-bs-toggle="modal" title="{% trans "Configure Table" %}" data-bs-target="#ObjectTable_config" class="btn">
|
||||||
|
<i class="mdi mdi-cog"></i> {% trans "Configure Table" %}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
{% render_table table %}
|
{% render_table table %}
|
||||||
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
||||||
|
{% block modals %}
|
||||||
|
{% table_config_form table table_name="ObjectTable" %}
|
||||||
|
{% endblock modals %}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{% extends 'generic/_base.html' %}
|
{% extends 'generic/_base.html' %}
|
||||||
|
{% load helpers %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load render_table from django_tables2 %}
|
{% load render_table from django_tables2 %}
|
||||||
|
|
||||||
@ -25,5 +26,22 @@
|
|||||||
{% endblock tabs %}
|
{% endblock tabs %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col-auto ms-auto d-print-none">
|
||||||
|
{# Table configuration button #}
|
||||||
|
<div class="table-configure input-group">
|
||||||
|
<button type="button" data-bs-toggle="modal" title="{% trans "Configure Table" %}" data-bs-target="#ObjectTable_config" class="btn">
|
||||||
|
<i class="mdi mdi-cog"></i> {% trans "Configure Table" %}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
{% render_table table %}
|
{% render_table table %}
|
||||||
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
||||||
|
{% block modals %}
|
||||||
|
{% table_config_form table table_name="ObjectTable" %}
|
||||||
|
{% endblock modals %}
|
||||||
|
Loading…
Reference in New Issue
Block a user