Commit Graph
105 Commits
Author SHA1 Message Date
MrBlakeandClaude Opus 5.5 5d6c4c9cd8 fix: apply global tenant scope directly in the asset filterset
The asset list ignored the global tenant and tenant group filter. The asset
filterset now applies the active scope itself (including inherited tenants)
instead of relying on the injected URL parameter; the REST API stays
unfiltered. The replaced tenant filters use model choice filters like the
original plugin filters.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 13:03:10 +01:00
MrBlakeandClaude Opus 5.5 bfcfff60e4 fix: global tenant filter includes assets with inherited tenant
The tenant_id and tenant_group_id filters of netbox-inventory assets now also
match assets without their own tenant via the tenant of the assigned device,
module, inventory item or rack, like the tenant column. The global tenant and
tenant group filter uses these filters and no longer hides such assets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 12:58:37 +01:00
MrBlakeandClaude Opus 5.5 204bb235a4 fix: asset tenant column falls back to the hardware's tenant
The tenant column of the netbox-inventory asset list stayed empty for assets
without their own tenant. It now shows the tenant of the assigned device,
module, inventory item or rack instead. reportlab is pinned below 5, which
pulled in pillow 13 and broke netbox-documentation's pillow<13 requirement.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 12:54:57 +01:00
MrBlakeandClaude Opus 5.5 f86306e686 feat: show tenant column in netbox-inventory asset list
The asset table of netbox-inventory gets a tenant column (registered if the
plugin does not provide one) that is part of the default columns, placed
right after the status.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 12:50:42 +01:00
MrBlakeandClaude Opus 5.5 cf1cafb632 feat: tenant-aware netbox-inventory assets
Assets without a tenant take the tenant of the device, module, inventory item or
rack they are assigned to, both in clean() and before save. The plugin's assign,
reassign and "create hardware from asset" views save assets without a tenant
field and failed with mandatory tenancy before. Asset forms are also pre-filled
from an assigned module or inventory item. Existing tenants are never changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-18 12:43:08 +01:00
MrBlakeandClaude Opus 5.5 4dd01b82e3 fix: skip hidden stack fields when reordering device form fields
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 16:23:11 +01:00
MrBlakeandClaude Opus 5.5 2ea1dcaec3 fix: device edit form crashed when stack fields are hidden
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 16:22:58 +01:00
MrBlakeandClaude Opus 5.5 cc2546b332 fix: show switch stack options only for devices with a switch role
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 16:20:51 +01:00
MrBlakeandClaude Opus 5.5 102b161356 feat: continue cable trace across wireless links
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 10:04:04 +01:00
MrBlakeandClaude Opus 5.5 d49c4c6ee7 feat: ignore LAG note in port labels for VLAN colours and checks
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 10:05:59 +01:00
MrBlakeandClaude Opus 5.5 5fcd7799e3 feat: REST API endpoint for switch stacks
/api/plugins/utilities/switch-stacks/ reads and writes stacks, filterable by
device_id and member_id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 09:25:52 +01:00
MrBlakeandClaude Opus 5.5 a87d3b1cdf fix: spacing between stack member name and its front panel
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 09:19:50 +01:00
MrBlakeandClaude Opus 5.5 356034fe98 fix: stack members show the whole switch stack in the port panel and PDF
The current device is marked in the panel.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 09:17:34 +01:00
MrBlakeandClaude Opus 5.5 ce174c6541 feat: switch port PDF covers the whole switch stack
Front panels and port lists are drawn per stack member with shared VLAN colours.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 09:12:22 +01:00
MrBlakeandClaude Opus 5.5 567daf7963 feat: switch stacks – stack members shown one below the other in the port panel
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 09:02:04 +01:00
MrBlakeandClaude Opus 5.5 6906bf6ed6 feat: switch panel and PDF also use the VLANs assigned to cables
Ports without a label show the VLANs of their cable. A label with exactly
one number counts as that VLAN ID, so "Server 30", "VLAN 30", "30" and a
cable with VLAN 30 share one colour and legend entry. A numeric label that
differs from the cable VLANs is flagged with an orange corner and a
warning; tooltips and the PDF port list show label and cable VLANs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 10:17:54 +01:00
MrBlakeandClaude Opus 5.5 e9c00f2b11 fix: MGMT label for management ports and light/dark theme for the switch panel
Management ports (management only, or named mgmt/management/oobm/me0 ...)
show "MGMT" instead of the overflowing full name and form their own group
at the end; other ports without a number are shortened. The faceplate,
jacks, notches and frames use theme variables for NetBox's light and dark
mode instead of a fixed dark design.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 10:12:13 +01:00
MrBlakeandClaude Opus 5.5 b1ecbbbb75 feat: Aruba-style switch front panel on the device page
Switches show a Ports panel above the Device and Management cards: a dark
faceplate with every physical port as RJ45/SFP jack (odd on top, even
below, per stack member), a status view (link, free, disabled) and a VLAN
view with the label colours of the PDF, contrast-aware text, legend,
tooltips with peer and description, key figures and a link to the PDF
export. Texts follow the user's NetBox language. The panel is rendered
into the left column and moved to the top by a small script.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 10:03:07 +01:00
MrBlakeandClaude Opus 5.5 7289c21684 feat: switch port PDF back in A4 landscape
A 48-port switch fits on one row again; the port list keeps the wider
columns without line breaks and the VLAN legend is kept on one page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 09:34:06 +01:00
MrBlakeandClaude Opus 5.5 f144f23b31 feat: switch port PDF in A4 portrait
The export uses A4 portrait: wide port groups are split evenly (a 48-port
switch into 1-24 and 25-48) with larger tiles, the legend has four
columns and the port list has wider columns and a smaller font so that
names, status and type no longer wrap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 09:28:56 +01:00
MrBlakeandClaude Opus 5.5 8eb075db9f feat: export switch port usage as PDF instead of a Ports tab
Switches get an "Export switch port usage" button that downloads an A4
landscape PDF: key figures, a front panel with one colour per VLAN label
(full colour = connected, pale = free, dashed with a cross = disabled,
text colour chosen for contrast), a VLAN legend and the full port list
with peers. The PDF follows the language of the user's NetBox
preferences (German or English). The Ports tab with its script and
styles is removed. ReportLab becomes a dependency.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 09:25:29 +01:00
MrBlakeandClaude Opus 5.5 8f2cc22f88 chore: bump version to 0.17.0
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 09:15:38 +01:00
MrBlakeandClaude Opus 5.5 9ecad07c96 feat: Ports tab for switches with front-panel view and VLAN colours
Devices with the role "Switch" get a Ports tab: key figures, a front-panel
view of all physical interfaces grouped per stack member/line card and
medium (odd ports on top, even below), coloured by usage or by the VLAN
noted in the interface label, with a VLAN legend and filter, tooltips with
peer and description, a searchable table of all interfaces, CSV export
and a print view. Peers follow the cable path through patch panels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 08:54:37 +01:00
MrBlakeandClaude Opus 5.5 9fd3e01cdf feat: clearer cluster capacity panel
Key figures (hosts, vCPU:core, RAM allocation, N+1) as tiles with
colours, warnings in one compact box and the host table across the full
width with RAM bars, coloured ratios and one-line VM figures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 12:50:05 +01:00
MrBlakeandClaude Opus 5.5 8aa8d3fe1e fix: do not spread unplaced VMs once a VM of the cluster is pinned
As soon as any VM of a cluster (in any status) is assigned to one of its
hosts, the placement is treated as managed by hand: VMs without a host
are no longer spread over the hosts and only count towards the cluster
totals. Cluster panel and host tab say which case applies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 11:12:15 +01:00
MrBlakeandClaude Opus 5.5 afa15eb46a feat: spread cluster VMs without a fixed host over the cluster hosts
VMs assigned only to a cluster now count towards every host of that
cluster in proportion to its size: vCPUs by threads, memory by host RAM,
evenly if no host has CPU & RAM recorded. The cluster host table and the
CPU & RAM tab of a host include this share; the cluster totals still
count each VM once. Hosts are matched by device ID instead of name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 11:02:35 +01:00
MrBlakeandClaude Opus 5.5 675574ee00 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]>
2026-10-29 11:00:30 +01:00
MrBlakeandClaude Opus 5.5 8624ddb62f docs: use the new Hardware menu name for the disk CSV import
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 10:53:45 +01:00
MrBlakeandClaude Opus 5.5 c8b581089c feat: CPU & RAM per server with a catalogue of Intel and AMD server CPUs
Devices get a CPU & RAM panel: CPU model from a built-in catalogue of
over 700 Intel Xeon and AMD Opteron/EPYC server CPUs since 2012 (cores,
threads, base/turbo clock, TDP, socket, year, max sockets; checked against
Intel ARK, AMD and server vendor data), CPU count and RAM with modules,
type and speed. The catalogue is loaded by migration 0011, can be edited
and extended in the UI and refreshed with netbox_utilities_cpu_catalog.

Virtualization: clusters show their capacity (cores, threads and RAM of
the hosts against the vCPUs and memory of the VMs, vCPU:core ratio, RAM
allocation, N+1 reserve) with a per-host table, hosts list their VMs and
VMs show the CPU of their host. Optional columns for the device and
cluster lists, CSV import, REST API, GraphQL and search are included.
The plugin menu is now called "Hardware".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 10:53:36 +01:00
MrBlakeandClaude Opus 5.5 8396b7c64a docs: add screenshots and generalise README
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 20:58:18 +01:00
MrBlakeandClaude Opus 5.5 95fd28f2a4 feat: MSA import reads disk group exports and loosely named columns
The disk group export of an HPE MSA sets RAID level and pool on the RAID
groups of the selected devices. Column names are matched case- and
punctuation-insensitively with common aliases, positions are accepted as
1.4, 1:4, 1/4 or "Enclosure 1, Slot 4" or as separate enclosure and slot
columns, and both export kinds are detected in the regular disk import.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 15:02:46 +02:00
MrBlakeandClaude Opus 5.5 2b40fbfae0 fix: MSA import wizard posted back to the disk CSV import
When the CSV import handed an MSA export to the wizard, its forms had no
action and submitted to /disks/import/, which failed with KeyError 'format'.
All wizard forms now post to the MSA import URL.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 14:16:26 +02:00
MrBlakeandClaude Opus 5.5 2a6abc396d feat: hand HPE MSA exports from the disk CSV import to the MSA wizard
An MSA disk export pasted or uploaded in Disks > Import failed with
"Unknown header: Location". The import now recognises the MSA columns and
opens the shelf assignment step of the MSA import instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 14:13:10 +02:00
MrBlakeandClaude Opus 5.5 7754e823cb fix: disk CSV import crashed with "Disk.bay must be a DiskBayLayout instance"
The bay and raid_group cleaners returned the plain name, which reached the
model instance as a string whenever clean() stopped early on another error.
They now keep the name aside and leave None behind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 14:10:24 +02:00
MrBlakeandClaude Opus 5.5 a7801ec297 feat: import the disk CSV export of an HPE MSA
A three-step wizard reads the MSA disk export, maps each enclosure (shelf)
to a device and previews new, updated, replaced, skipped and conflicting
disks. Devices without slot areas get one created during the import,
pre-filled from the device type template or the export. Disk groups can
become RAID groups and the install date can be estimated from the power
on hours.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 14:06:22 +02:00
MrBlakeandClaude Opus 5.5 d45afa5e54 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]>
2026-10-19 14:46:48 +02:00
MrBlakeandClaude Opus 5.5 14cb5d5829 feat: own Disks main menu and disk list grouped by device
The disk entries move from the Plugins menu into a top-level Disks menu with
Disks, RAID groups and Disk templates. The Disks entry opens a new page that
groups all disks by device in collapsible sections with per-device summary,
search, warning and removed-disk switches and expand/collapse all. The flat
table with filters, export and bulk actions remains available.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 14:14:58 +02:00
MrBlakeandClaude Opus 5.5 e6be0ed294 fix: RAID group list crashed because format_html() was called without arguments
Django 6 raises a TypeError when format_html() gets no arguments.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 12:51:44 +02:00
MrBlakeandClaude Opus 5.5 3ac6a53fa8 docs: use English UI names in the disks README section
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 12:51:10 +02:00
MrBlake 8b804cb8ce Merge branch 'feat/disks'
# Conflicts:
#	netbox_utilities/__init__.py
#	pyproject.toml
2026-10-19 12:35:52 +02:00
MrBlakeandClaude Opus 5.5 2980500f53 docs: describe drag and drop of disks in README
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 12:32:09 +02:00
MrBlakeandClaude Opus 5.5 595d6a2b71 feat: drag and drop disks between slots; fix RAID group form on NetBox 4.7
Disks on the slot grid can be dragged onto a free slot to move them or onto
an occupied slot to swap both disks. Moves are saved immediately with
changelog entries and require netbox_utilities.change_disk.

NetBoxModelForm.clean() returns None on NetBox 4.7, which broke creating
RAID groups with an AttributeError. The disk forms now read
self.cleaned_data instead of the return value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 12:31:56 +02:00
MrBlakeandClaude Opus 5.5 a296c57536 fix: drop unsupported user argument from disk tables and show disk count in tab badge
NetBox 4.7 tables no longer accept a user keyword argument, which broke the
Datenträger tab with a TypeError. The tab badge now shows the number of
installed disks instead of used/total slots or "neu".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 12:09:29 +02:00
MrBlakeandClaude Opus 5.5 adbd697c0a feat: add disk management tab for servers, NAS, SAN and MSA devices
Devices whose role is one of disk_device_roles (default Server, NAS, SAN,
MSA) get a "Datenträger" tab with slot layout, disks, RAID groups,
warranty and age warnings, replacement history, CSV import, REST API and
GraphQL.

- First-visit wizard for slot count, rows, first slot number, numbering
  and form factor; layouts can be saved as device type templates and
  applied with one click.
- Slot grid drawn like the device front, coloured by status, with
  warning icons; free slots open a pre-filled disk form.
- Bulk fill of selected slots with shared attributes and one serial per
  line (barcode scanner friendly), with live count and duplicate checks.
- Sizes in vendor notation (960 GB, 4 TB, 1,92 TB, 2 TiB); the tenant is
  always taken from the device and follows tenant changes.
- RAID groups (RAID 0/1/5/6/10/50/60, RAID-Z1/Z2/Z3, JBOD) with hot
  spares, usable capacity, tolerated failures and degraded state.
- "Ersetzen" marks a disk as removed and opens the successor form;
  removed disks stay as per-slot history.
- Warnings for failed disks, expired or expiring warranties and disks
  older than disk_age_warning_years.
- Global disk list with filters, export, global search by serial,
  optional device list column, CSV import, REST API and GraphQL.
- New settings: disks_enabled, disk_device_roles,
  disk_age_warning_years, disk_warranty_warning_days.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 12:01:56 +02:00
MrBlakeandClaude Opus 5.5 2aab3d14ee Enable NetBox-Export integration for 0.3.12-0.3.14 and fix stale tests
The rack width integration only accepted NetBox-Export 0.3.11 and 0.3.14, but the published version was 0.3.13, so the patches were silently skipped. Accept 0.3.12 to 0.3.14; the patcher still checks that all hooked functions exist before patching. Verified on NetBox 4.7.2 that the patch is applied.

Update four outdated tests: compare asset versions against __version__ instead of 0.10.4, allow the read-only tenant group lookup in the connection scope test, and check the prefix column in NetBox's table column registry, where register_table_column() stores it.

All 174 tests pass on NetBox 4.7.2. Bump version to 0.14.4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 15:08:43 +02:00
MrBlakeandClaude Opus 5.5 1ed16c542a Fix fresh-install migrations on PostgreSQL
Reading the runtime settings while other migrations run failed because the settings table did not exist yet. The error was caught, but it aborted the surrounding migration transaction on PostgreSQL. Run the query inside a savepoint. Verified with NetBox 4.7.2. Bump version to 0.14.3.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 14:13:18 +02:00
MrBlakeandClaude Opus 5.5 cbb8128385 fix: downscale oversized bulk uploads so NetBox can render thumbnails
NetBox renders image attachment thumbnails under its global 25 MP Pillow
limit, so 50 MP photos uploaded via the bulk form showed no preview.
Scale images above that limit down (applying EXIF orientation) before
saving. Also resolve leftover merge conflict markers in the README.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 10:19:19 +02:00
MrBlake f7c9ce995f Merge branch 'main' of https://git.mrblake.cc/MrBlake/Netbox-Utilities 2026-10-02 10:14:54 +02:00
MrBlakeandClaude Opus 5.5 a9fd36f31c fix: allow 50 MP smartphone photos in bulk image upload
NetBox sets Pillow's MAX_IMAGE_PIXELS to 25 MP, so Pillow rejects images
above 50 MP as decompression bombs. Raise the limit to 100 MP while the
bulk upload is processed and surface the underlying Pillow error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-02 10:14:13 +02:00
MrBlakeandClaude Opus 5.5 a85e4d6375 docs: rewrite README in English with standard structure
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-30 13:36:57 +02:00