mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Fixes #6676: Fix device/VM counts per cluster under cluster type/group views
This commit is contained in:
parent
4292d88a92
commit
98ff00bc62
@ -12,6 +12,7 @@
|
|||||||
* [#6637](https://github.com/netbox-community/netbox/issues/6637) - Fix group assignment in "available VLANs" link under VLAN group view
|
* [#6637](https://github.com/netbox-community/netbox/issues/6637) - Fix group assignment in "available VLANs" link under VLAN group view
|
||||||
* [#6640](https://github.com/netbox-community/netbox/issues/6640) - Disallow numeric values in custom text fields
|
* [#6640](https://github.com/netbox-community/netbox/issues/6640) - Disallow numeric values in custom text fields
|
||||||
* [#6652](https://github.com/netbox-community/netbox/issues/6652) - Fix exception when adding components in bulk to multiple devices
|
* [#6652](https://github.com/netbox-community/netbox/issues/6652) - Fix exception when adding components in bulk to multiple devices
|
||||||
|
* [#6676](https://github.com/netbox-community/netbox/issues/6676) - Fix device/VM counts per cluster under cluster type/group views
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -34,6 +34,9 @@ class ClusterTypeView(generic.ObjectView):
|
|||||||
def get_extra_context(self, request, instance):
|
def get_extra_context(self, request, instance):
|
||||||
clusters = Cluster.objects.restrict(request.user, 'view').filter(
|
clusters = Cluster.objects.restrict(request.user, 'view').filter(
|
||||||
type=instance
|
type=instance
|
||||||
|
).annotate(
|
||||||
|
device_count=count_related(Device, 'cluster'),
|
||||||
|
vm_count=count_related(VirtualMachine, 'cluster')
|
||||||
)
|
)
|
||||||
|
|
||||||
clusters_table = tables.ClusterTable(clusters)
|
clusters_table = tables.ClusterTable(clusters)
|
||||||
@ -93,6 +96,9 @@ class ClusterGroupView(generic.ObjectView):
|
|||||||
def get_extra_context(self, request, instance):
|
def get_extra_context(self, request, instance):
|
||||||
clusters = Cluster.objects.restrict(request.user, 'view').filter(
|
clusters = Cluster.objects.restrict(request.user, 'view').filter(
|
||||||
group=instance
|
group=instance
|
||||||
|
).annotate(
|
||||||
|
device_count=count_related(Device, 'cluster'),
|
||||||
|
vm_count=count_related(VirtualMachine, 'cluster')
|
||||||
)
|
)
|
||||||
|
|
||||||
clusters_table = tables.ClusterTable(clusters)
|
clusters_table = tables.ClusterTable(clusters)
|
||||||
|
Loading…
Reference in New Issue
Block a user