diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index c3eac0fd7..3fbceee53 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -527,7 +527,8 @@ class IPAddressView(ObjectView): # Exclude anycast IPs if this IP is anycast if ipaddress.role == IPAddressRoleChoices.ROLE_ANYCAST: duplicate_ips = duplicate_ips.exclude(role=IPAddressRoleChoices.ROLE_ANYCAST) - duplicate_ips_table = tables.IPAddressTable(list(duplicate_ips), orderable=False) + # Limit to a maximum of 10 duplicates displayed here + duplicate_ips_table = tables.IPAddressTable(duplicate_ips[:10], orderable=False) # Related IP table related_ips = IPAddress.objects.restrict(request.user, 'view').exclude( @@ -547,6 +548,7 @@ class IPAddressView(ObjectView): 'ipaddress': ipaddress, 'parent_prefixes_table': parent_prefixes_table, 'duplicate_ips_table': duplicate_ips_table, + 'more_duplicate_ips': duplicate_ips.count() > 10, 'related_ips_table': related_ips_table, }) diff --git a/netbox/templates/ipam/ipaddress.html b/netbox/templates/ipam/ipaddress.html index ff83061cf..f213a275a 100644 --- a/netbox/templates/ipam/ipaddress.html +++ b/netbox/templates/ipam/ipaddress.html @@ -3,6 +3,7 @@ {% load custom_links %} {% load helpers %} {% load plugins %} +{% load render_table from django_tables2 %} {% block header %}