diff --git a/docs/release-notes/version-2.6.md b/docs/release-notes/version-2.6.md index bd9503008..ee6ea2e4d 100644 --- a/docs/release-notes/version-2.6.md +++ b/docs/release-notes/version-2.6.md @@ -20,6 +20,7 @@ * [#3857](https://github.com/netbox-community/netbox/issues/3857) - Fix group custom links rendering * [#3862](https://github.com/netbox-community/netbox/issues/3862) - Allow filtering device components by multiple device names * [#3864](https://github.com/netbox-community/netbox/issues/3864) - Disallow /0 masks +* [#3872](https://github.com/netbox-community/netbox/issues/3872) - Paginate related IPs of an address --- diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index 26df90c93..780bd51df 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -686,7 +686,14 @@ class IPAddressView(PermissionRequiredMixin, View): ).filter( vrf=ipaddress.vrf, address__net_contained_or_equal=str(ipaddress.address) ) - 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 %}