feat: CPU & RAM as a device tab next to Disks
The CPU & RAM panel on the device page becomes its own tab with the total core count as badge. Besides CPU and RAM it shows the capacity of a virtualization host and the list of VMs running on it. Saving the form returns to the tab. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
8624ddb62f
commit
675574ee00
6 files changed
+124
-52
No files matched your search
@@ -111,9 +111,6 @@ class DeviceUtilitiesContent(PluginTemplateExtension):
|
||||
return self.render("netbox_utilities/device_bulk_module_button.html")
|
||||
|
||||
def right_page(self):
|
||||
return self._hardware_panel() + self._rack_width_panel()
|
||||
|
||||
def _rack_width_panel(self):
|
||||
placement = DeviceRackPlacement.objects.filter(device=self.context["object"]).first()
|
||||
if placement is None:
|
||||
return ""
|
||||
@@ -125,18 +122,6 @@ class DeviceUtilitiesContent(PluginTemplateExtension):
|
||||
},
|
||||
)
|
||||
|
||||
def _hardware_panel(self):
|
||||
request, device = self.context["request"], self.context["object"]
|
||||
if not hardware_enabled() or not request.user.has_perm("netbox_utilities.view_devicehardware"):
|
||||
return ""
|
||||
from . import hardware
|
||||
from .hardware_views import device_hardware_context
|
||||
|
||||
context = device_hardware_context(request, device)
|
||||
if context["record"] is None and not hardware.supports_hardware(device):
|
||||
return ""
|
||||
return self.render("netbox_utilities/device_hardware_panel.html", context)
|
||||
|
||||
|
||||
class ClusterHardwareContent(PluginTemplateExtension):
|
||||
models = ["virtualization.cluster"]
|
||||
|
||||
Reference in new issue
Block a user