diff --git a/docs/release-notes/version-3.1.md b/docs/release-notes/version-3.1.md index ee49a9b64..fa590215e 100644 --- a/docs/release-notes/version-3.1.md +++ b/docs/release-notes/version-3.1.md @@ -8,6 +8,7 @@ * [#8367](https://github.com/netbox-community/netbox/issues/8367) - Add ASNs to global search function * [#8368](https://github.com/netbox-community/netbox/issues/8368) - Enable controlling the order of custom script form fields with `field_order` * [#8381](https://github.com/netbox-community/netbox/issues/8381) - Add contacts to global search function +* [#8476](https://github.com/netbox-community/netbox/issues/8476) - Bring the ASN Web UI up to the standard set by other objects ### Bug Fixes diff --git a/netbox/ipam/tables/ip.py b/netbox/ipam/tables/ip.py index 49892f557..df2d97dac 100644 --- a/netbox/ipam/tables/ip.py +++ b/netbox/ipam/tables/ip.py @@ -119,15 +119,20 @@ class ASNTable(BaseTable): url_params={'asn_id': 'pk'}, verbose_name='Sites' ) + tenant = TenantColumn() + tags = TagColumn( + url_name='ipam:asn_list' + ) + actions = ButtonsColumn(ASN) class Meta(BaseTable.Meta): model = ASN fields = ( 'pk', 'asn', 'asn_asdot', 'rir', 'site_count', 'tenant', 'description', 'actions', 'created', - 'last_updated', + 'last_updated', 'tags', ) - default_columns = ('pk', 'asn', 'rir', 'site_count', 'sites', 'tenant', 'actions') + default_columns = ('pk', 'asn', 'rir', 'site_count', 'sites', 'description', 'tenant', 'actions') # diff --git a/netbox/templates/tenancy/tenant.html b/netbox/templates/tenancy/tenant.html index 083cc4777..b64438866 100644 --- a/netbox/templates/tenancy/tenant.html +++ b/netbox/templates/tenancy/tenant.html @@ -71,6 +71,10 @@

{{ stats.aggregate_count }}

Aggregates

+
+

{{ stats.asn_count }}

+

ASNs

+

{{ stats.prefix_count }}

Prefixes

diff --git a/netbox/tenancy/views.py b/netbox/tenancy/views.py index b0f550304..e219a5670 100644 --- a/netbox/tenancy/views.py +++ b/netbox/tenancy/views.py @@ -4,7 +4,7 @@ from django.shortcuts import get_object_or_404 from circuits.models import Circuit from dcim.models import Site, Rack, Device, RackReservation, Cable -from ipam.models import Aggregate, IPAddress, Prefix, VLAN, VRF +from ipam.models import Aggregate, IPAddress, Prefix, VLAN, VRF, ASN from netbox.views import generic from utilities.tables import paginate_table from utilities.utils import count_related @@ -113,6 +113,7 @@ class TenantView(generic.ObjectView): 'virtualmachine_count': VirtualMachine.objects.restrict(request.user, 'view').filter(tenant=instance).count(), 'cluster_count': Cluster.objects.restrict(request.user, 'view').filter(tenant=instance).count(), 'cable_count': Cable.objects.restrict(request.user, 'view').filter(tenant=instance).count(), + 'asn_count': ASN.objects.restrict(request.user, 'view').filter(tenant=instance).count(), } return {