From 67f4d8fab51c5ff4ed8452cdf37dec305042244b Mon Sep 17 00:00:00 2001 From: Saria Hajjar Date: Thu, 9 Jan 2020 17:16:58 +0000 Subject: [PATCH] Replaced with pagination --- netbox/ipam/views.py | 11 +++++++++-- netbox/templates/ipam/ipaddress.html | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index a8a6cd846..7a1a2901c 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -676,8 +676,15 @@ class IPAddressView(PermissionRequiredMixin, View): address=str(ipaddress.address) ).filter( vrf=ipaddress.vrf, address__net_contained_or_equal=str(ipaddress.address) - )[:50] - related_ips_table = tables.IPAddressTable(list(related_ips), orderable=False) + ) + + related_ips_table = tables.IPAddressTable(related_ips, orderable=False) + + paginate = { + 'paginator_class': EnhancedPaginator, + 'per_page': request.GET.get('per_page', settings.PAGINATE_COUNT) + } + RequestConfig(request, paginate).configure(related_ips_table) return render(request, 'ipam/ipaddress.html', { 'ipaddress': ipaddress, diff --git a/netbox/templates/ipam/ipaddress.html b/netbox/templates/ipam/ipaddress.html index cb04e14d5..aae819ceb 100644 --- a/netbox/templates/ipam/ipaddress.html +++ b/netbox/templates/ipam/ipaddress.html @@ -160,7 +160,7 @@ {% if duplicate_ips_table.rows %} {% include 'panel_table.html' with table=duplicate_ips_table heading='Duplicate IP Addresses' panel_class='danger' %} {% endif %} - {% include 'panel_table.html' with table=related_ips_table heading='Related IP Addresses' panel_class='default noprint' %} + {% include 'utilities/obj_table.html' with table=related_ips_table table_template='panel_table.html' heading='Related IP Addresses' panel_class='default noprint' %} {% endblock %}