From 5fd229bd1d499e664098beb11a1588543da59d57 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 2 Apr 2025 14:34:59 -0400 Subject: [PATCH] Introduce AnnotatedIPAddressTable for PrefixIPAddressesView --- netbox/ipam/tables/ip.py | 15 +++++++++++++-- netbox/ipam/views.py | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/netbox/ipam/tables/ip.py b/netbox/ipam/tables/ip.py index 4cdcebe5b..d285927d3 100644 --- a/netbox/ipam/tables/ip.py +++ b/netbox/ipam/tables/ip.py @@ -10,6 +10,7 @@ from .template_code import * __all__ = ( 'AggregateTable', + 'AnnotatedIPAddressTable', 'AssignedIPAddressesTable', 'IPAddressAssignTable', 'IPAddressTable', @@ -308,8 +309,8 @@ class IPRangeTable(TenancyColumnsMixin, NetBoxTable): # class IPAddressTable(TenancyColumnsMixin, NetBoxTable): - address = tables.TemplateColumn( - template_code=IPADDRESS_LINK, + address = tables.Column( + linkify=True, verbose_name=_('IP Address') ) vrf = tables.TemplateColumn( @@ -374,6 +375,16 @@ class IPAddressTable(TenancyColumnsMixin, NetBoxTable): } +class AnnotatedIPAddressTable(IPAddressTable): + address = tables.TemplateColumn( + template_code=IPADDRESS_LINK, + verbose_name=_('IP Address') + ) + + class Meta(IPAddressTable.Meta): + pass + + class IPAddressAssignTable(NetBoxTable): address = tables.TemplateColumn( template_code=IPADDRESS_ASSIGN_LINK, diff --git a/netbox/ipam/views.py b/netbox/ipam/views.py index 31c15ed69..c722f1fea 100644 --- a/netbox/ipam/views.py +++ b/netbox/ipam/views.py @@ -619,7 +619,7 @@ class PrefixIPRangesView(generic.ObjectChildrenView): class PrefixIPAddressesView(generic.ObjectChildrenView): queryset = Prefix.objects.all() child_model = IPAddress - table = tables.IPAddressTable + table = tables.AnnotatedIPAddressTable filterset = filtersets.IPAddressFilterSet filterset_form = forms.IPAddressFilterForm template_name = 'ipam/prefix/ip_addresses.html'