From d2bdf4e8229ac8391cfcef938183fc6b276424eb Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 6 Oct 2021 10:12:44 -0400 Subject: [PATCH] Closes #7462: Include count of assigned virtual machines under platform view --- docs/release-notes/version-3.0.md | 4 ++++ netbox/dcim/views.py | 1 + netbox/templates/dcim/platform.html | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/docs/release-notes/version-3.0.md b/docs/release-notes/version-3.0.md index f315ffbf7..23d655c6c 100644 --- a/docs/release-notes/version-3.0.md +++ b/docs/release-notes/version-3.0.md @@ -2,6 +2,10 @@ ## v3.0.6 (FUTURE) +### Enhancements + +* [#7462](https://github.com/netbox-community/netbox/issues/7462) - Include count of assigned virtual machines under platform view + ### Bug Fixes * [#7442](https://github.com/netbox-community/netbox/issues/7442) - Fix missing actions column on user-configured tables diff --git a/netbox/dcim/views.py b/netbox/dcim/views.py index a82d7dadf..16f88b9c3 100644 --- a/netbox/dcim/views.py +++ b/netbox/dcim/views.py @@ -1229,6 +1229,7 @@ class PlatformView(generic.ObjectView): return { 'devices_table': devices_table, + 'virtualmachine_count': VirtualMachine.objects.filter(platform=instance).count() } diff --git a/netbox/templates/dcim/platform.html b/netbox/templates/dcim/platform.html index 3a45905e9..7229d8078 100644 --- a/netbox/templates/dcim/platform.html +++ b/netbox/templates/dcim/platform.html @@ -46,6 +46,12 @@ {{ devices_table.rows|length }} + + Virtual Machines + + {{ virtualmachine_count }} + +