mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Fixes #16756: Fix table pagination for custom script results
This commit is contained in:
parent
cac92352ca
commit
50839fcb6b
@ -1258,6 +1258,9 @@ class ScriptResultView(TableMixin, generic.ObjectView):
|
|||||||
|
|
||||||
# If this is an HTMX request, return only the result HTML
|
# If this is an HTMX request, return only the result HTML
|
||||||
if htmx_partial(request):
|
if htmx_partial(request):
|
||||||
|
if request.GET.get('log'):
|
||||||
|
# If log=True, render only the log table
|
||||||
|
return render(request, 'htmx/table.html', context)
|
||||||
response = render(request, 'extras/htmx/script_result.html', context)
|
response = render(request, 'extras/htmx/script_result.html', context)
|
||||||
if job.completed or not job.started:
|
if job.completed or not job.started:
|
||||||
response.status_code = 286
|
response.status_code = 286
|
||||||
|
@ -41,7 +41,11 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="table-responsive" id="object_list">
|
<div class="table-responsive" id="object_list">
|
||||||
<h5 class="card-header">{% trans "Log" %}</h5>
|
<h5 class="card-header">{% trans "Log" %}</h5>
|
||||||
{% include 'htmx/table.html' %}
|
<div class="htmx-container table-responsive"
|
||||||
|
hx-get="{% url 'extras:script_result' job_pk=job.pk %}?embedded=True&log=True"
|
||||||
|
hx-target="this"
|
||||||
|
hx-trigger="load" hx-select=".htmx-container" hx-swap="outerHTML"
|
||||||
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -90,14 +90,6 @@
|
|||||||
</div>
|
</div>
|
||||||
{# /Object list tab #}
|
{# /Object list tab #}
|
||||||
|
|
||||||
{# Filters tab #}
|
|
||||||
{% if filter_form %}
|
|
||||||
<div class="tab-pane show" id="filters-form" role="tabpanel" aria-labelledby="filters-form-tab">
|
|
||||||
{% include 'inc/filter_list.html' %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{# /Filters tab #}
|
|
||||||
|
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
||||||
{% block modals %}
|
{% block modals %}
|
||||||
|
Loading…
Reference in New Issue
Block a user