feat: several slot areas per device, e.g. front bays and a PCIe card
Disks that are not in the front bays, such as NVMe SSDs on a PCIe card or M.2 SSDs on a boot card, can now be documented in their own slot area. - A device can have several areas, each with name, order, slot count, rows, first slot, numbering and form factor; the tab shows one grid per area with its own fill, select and edit actions. - Add area, edit area and delete empty areas on the Disks tab. - Slot numbers are unique per area; drag and drop also moves or swaps disks between areas. - Device type templates store all areas; Apply template creates the missing ones. - Disks get a bay field in forms, CSV import (bay column, optional when the device has one area), REST API, GraphQL, filters and tables. - Migration 0010 turns every existing layout into the area "Front" and assigns the existing disks to it. - The grouped disk overview shows the area in its own column and centres the slot number. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
14cb5d5829
commit
d45afa5e54
19 files changed
+644
-238
No files matched your search
@@ -5,7 +5,7 @@ from tenancy.api.serializers import TenantSerializer
|
||||
|
||||
from ..models import Disk, DiskBayLayout, DiskBayTemplate, RAIDGroup
|
||||
|
||||
LAYOUT_FIELDS = ("slot_count", "rows", "first_slot", "numbering", "form_factor")
|
||||
LAYOUT_FIELDS = ("name", "weight", "slot_count", "rows", "first_slot", "numbering", "form_factor")
|
||||
|
||||
|
||||
class RAIDGroupSerializer(NetBoxModelSerializer):
|
||||
@@ -39,6 +39,9 @@ class RAIDGroupSerializer(NetBoxModelSerializer):
|
||||
class DiskSerializer(NetBoxModelSerializer):
|
||||
url = serializers.HyperlinkedIdentityField(view_name="plugins-api:netbox_utilities-api:disk-detail")
|
||||
device = DeviceSerializer(nested=True)
|
||||
bay = serializers.PrimaryKeyRelatedField(
|
||||
queryset=DiskBayLayout.objects.all(), required=False, allow_null=True, help_text="ID des Bereichs"
|
||||
)
|
||||
raid_group = RAIDGroupSerializer(nested=True, required=False, allow_null=True)
|
||||
tenant = TenantSerializer(nested=True, read_only=True)
|
||||
warnings = serializers.SerializerMethodField()
|
||||
@@ -51,6 +54,7 @@ class DiskSerializer(NetBoxModelSerializer):
|
||||
"display_url",
|
||||
"display",
|
||||
"device",
|
||||
"bay",
|
||||
"slot",
|
||||
"status",
|
||||
"disk_type",
|
||||
@@ -99,7 +103,7 @@ class DiskBayLayoutSerializer(NetBoxModelSerializer):
|
||||
"created",
|
||||
"last_updated",
|
||||
)
|
||||
brief_fields = ("id", "url", "display", "device", "slot_count")
|
||||
brief_fields = ("id", "url", "display", "device", "name", "slot_count")
|
||||
|
||||
|
||||
class DiskBayTemplateSerializer(NetBoxModelSerializer):
|
||||
@@ -120,4 +124,4 @@ class DiskBayTemplateSerializer(NetBoxModelSerializer):
|
||||
"created",
|
||||
"last_updated",
|
||||
)
|
||||
brief_fields = ("id", "url", "display", "device_type", "slot_count")
|
||||
brief_fields = ("id", "url", "display", "device_type", "name", "slot_count")
|
||||
Reference in new issue
Block a user