diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 4b5ababbc..835bf3ce6 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -6,6 +6,7 @@ * [#6197](https://github.com/netbox-community/netbox/issues/6197) - Introduced `SESSION_COOKIE_NAME` config parameter * [#6318](https://github.com/netbox-community/netbox/issues/6318) - Add OM5 MMF cable type +* [#6351](https://github.com/netbox-community/netbox/issues/6351) - Add aggregates count to tenant view ### Bug Fixes diff --git a/netbox/templates/tenancy/tenant.html b/netbox/templates/tenancy/tenant.html index 684b1d8b1..d231f7c9d 100644 --- a/netbox/templates/tenancy/tenant.html +++ b/netbox/templates/tenancy/tenant.html @@ -76,6 +76,10 @@

{{ stats.vrf_count }}

VRFs

+
+

{{ stats.aggregate_count }}

+

Aggregates

+

{{ stats.prefix_count }}

Prefixes

diff --git a/netbox/tenancy/views.py b/netbox/tenancy/views.py index 45dffb3c0..b4a29a2e6 100644 --- a/netbox/tenancy/views.py +++ b/netbox/tenancy/views.py @@ -1,6 +1,6 @@ from circuits.models import Circuit from dcim.models import Site, Rack, Device, RackReservation -from ipam.models import IPAddress, Prefix, VLAN, VRF +from ipam.models import Aggregate, IPAddress, Prefix, VLAN, VRF from netbox.views import generic from utilities.tables import paginate_table from virtualization.models import VirtualMachine, Cluster @@ -101,6 +101,7 @@ class TenantView(generic.ObjectView): 'device_count': Device.objects.restrict(request.user, 'view').filter(tenant=instance).count(), 'vrf_count': VRF.objects.restrict(request.user, 'view').filter(tenant=instance).count(), 'prefix_count': Prefix.objects.restrict(request.user, 'view').filter(tenant=instance).count(), + 'aggregate_count': Aggregate.objects.restrict(request.user, 'view').filter(tenant=instance).count(), 'ipaddress_count': IPAddress.objects.restrict(request.user, 'view').filter(tenant=instance).count(), 'vlan_count': VLAN.objects.restrict(request.user, 'view').filter(tenant=instance).count(), 'circuit_count': Circuit.objects.restrict(request.user, 'view').filter(tenant=instance).count(),