Commit Graph
69 Commits
Author SHA1 Message Date
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 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 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 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
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 337cd28c23 feat: filter device and rack lists by site prefix
Adds a site_prefix filter to the device and rack filtersets and filter
forms. It matches the first word of the site name case-insensitively
and accepts several comma-separated prefixes. Bumps version to 0.14.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 11:07:03 +02:00
MrBlakeandClaude Opus 5 ad4085a2db feat: prefilter the B side of a cable by tenant group, tenant and site
Add three optional filter fields above the B-side termination selection.
They are never saved on the cable and can be cleared, so cabling across
tenant or site boundaries stays possible. Defaults come from the A side
or the global tenant filter.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-23 11:27:03 +02:00
MrBlakeandClaude Sonnet 5 ca1e38a1da ui: place offline SVG button directly beside "SVG herunterladen"
NetBox renders the native download link inside each per-face
elevation card, not through a plugin buttons() extension point, so
there's no server-side hook to inject a matching link next to it. The
right_page() extension now emits only a script (no separate sidebar
panel) that finds every a[href*="render=svg"] link, reads its face=
param, and inserts a matching "SVG offline" button right after it. The
button's href stays in sync with the rack-view select the same way
the previous panel's links did.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-17 16:13:40 +02:00
MrBlakeandClaude Sonnet 5 3cff66ad33 fix: target the correct classes for images-only/labels-only export
Decompiled NetBox core's own bundled JS (netbox.js) to find the real
toggle logic: its "images-only"/"labels-only" control only ever
hides image.device-image and text.device-image-label - it never
touches the plain text.label, relying on an opaque device image to
visually cover it. A device without a photo therefore still shows its
name live, even in "images-only".

apply_rack_view_mode() previously removed .label for images-only and
.device-image/.device-image-label for labels-only, which not only
targeted the wrong element for images-only but also left device-
image-label (the name overlaid on the image) around in labels-only.

For a static, non-interactive export there's no image left to cover
stray text, so per explicit request this deliberately does not mirror
NetBox's live fallback: images-only now always removes every label
(.label and .device-image-label) for a pure image view, and
labels-only removes the image layer (.device-image and
.device-image-label) to reproduce NetBox's own box-with-text view.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-17 15:54:53 +02:00
MrBlakeandClaude Sonnet 5 bfc4382403 feat: honor images-only/labels-only rack view mode in offline SVG export
The rack elevation page's "Bilder und Beschriftungen" dropdown only
toggles CSS visibility client-side after the browser already has the
SVG, so a freshly server-rendered export had no way to know which mode
was selected and always exported everything.

apply_rack_view_mode() replicates that filtering server-side by
removing the .label text elements (images-only) or the .device-image /
.device-image-label elements (labels-only) from the parsed SVG.
RackElevationOfflineSVGView now accepts a ?view= query param, and the
rack detail page panel syncs its download links to the page's own
"select.rack-view" dropdown so the exported file matches what's
currently shown.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-17 15:30:38 +02:00
MrBlakeandClaude Sonnet 5 20ec9453c2 feat: support netbox-export 0.3.14 and netbox-reorder-rack 1.1.5
Verified against the actually installed versions that the patched
hook signatures (serialize_object, is_exportable_model,
_defer_device_placement, _device_placement_conflicts,
_apply_device_placements, SaveViewSet.update, ReorderView.get) are
still compatible with our wrappers, then added both versions to the
supported sets so the width-aware patches stop being silently
skipped.

netbox-reorder-rack 1.1.5 changed ReorderView.get from
(self, request, pk) to (self, request, **kwargs). Our fallback path
called the original view with a positional pk, which would now raise
TypeError; width_aware_reorder_get now accepts pk as a keyword with
**kwargs passthrough so both the patched and native code paths work
regardless of which signature is installed.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-17 15:27:34 +02:00
MrBlakeandClaude Sonnet 5 ead171d546 fix: inline device images as data URIs in offline SVG export
strip_svg_hyperlinks() removed every href, including on <image>
elements that reference device-type photos, leaving devices with
images blank in the exported file. Non-anchor hrefs (currently only
<image>) are now resolved through an optional image_loader callback
and embedded as base64 data URIs instead of being stripped; anchor
unwrapping is unchanged. RackElevationOfflineSVGView wires this up to
NetBox's MEDIA storage.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-17 15:20:43 +02:00
MrBlakeandClaude Sonnet 5 23acebcf17 fix: handle plain HttpResponse from elevation SVG endpoint, unracked devices
- RackElevationOfflineSVGView called .render() unconditionally on the
  RackViewSet elevation action's response, but that action returns a
  plain HttpResponse (not a DRF Response) when render=svg is
  requested, causing AttributeError on every click.
- effective_width_positions() crashed with decimal.InvalidOperation
  when a device had no rack position set (e.g. surfaced via NetBox
  Topology Views, which includes unracked devices). Such devices now
  get the default full-width result instead of entering the Decimal
  conversion.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-17 15:16:09 +02:00
MrBlakeandClaude Sonnet 5 c722abe497 fix: move offline SVG export from buttons() to right_page()
The buttons() plugin-template-extension hook was registered for
dcim.rack and rendered without error, but the button HTML never
appeared on the rendered rack detail page in production — NetBox's
Rack detail template apparently doesn't wire the buttons() slot into
its controls row. right_page() is confirmed working for this plugin
already (the device rack-width panel uses it), so the export links
now render there as a small card instead.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-17 15:10:33 +02:00
MrBlakeandClaude Sonnet 5 3768417be6 feat: add offline SVG export for rack elevations
Adds a "SVG offline" download button on the rack detail page. It
reuses NetBox's own rack-elevation REST endpoint to render the SVG,
then strips embedded <a>/xlink:href links (which point at internal,
relative NetBox URLs and are useless once the file is saved) so the
result renders identically when opened standalone in any SVG viewer.

Gated by the new offline_svg_export_enabled plugin setting (on by
default).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-17 14:22:04 +02:00
MrBlakeandClaude Sonnet 5 35ca661ed0 compat: raise max_version to support NetBox 4.7
Extends the declared version range (min_version stays 4.6.5) and
updates the plugin description to reflect 4.7 support. The plugin's
internal-API monkeypatches (rack elevation SVG, DeviceEditView form)
should be regression-tested against a live NetBox 4.7.1 install, as
those are the areas most likely to break across minor releases.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-09-17 09:21:42 +02:00
MrBlake ff8dacc68c fix: pair LC patchpanel ports by number 2026-08-31 11:22:53 +02:00
MrBlake f3d658b52b feat: filter connection VLANs by group 2026-08-25 12:11:18 +02:00
MrBlake d245ae0f79 ui: place connection VLANs below cable B side 2026-08-25 12:03:45 +02:00
MrBlake 4421000409 fix: ignore reverse relations during tenant autofill 2026-08-19 12:40:17 +02:00
MrBlake bd748ef985 feat: assign VLANs to network connections 2026-08-19 12:24:40 +02:00
MrBlake 1c6708216c fix: preserve shared rack units during import 2026-08-19 10:53:44 +02:00
MrBlake 7216dad2b4 fix: separate rack width import locks 2026-08-19 10:43:33 +02:00
MrBlake 639dc958a5 feat: preserve rack widths in netbox export 2026-08-19 10:33:17 +02:00
MrBlake 839b076d94 fix: preserve reorder drag width and images 2026-08-13 16:10:47 +02:00
MrBlake 79a071597c fix: restore visible rack integration widgets 2026-08-13 11:21:48 +02:00
MrBlake e42580d651 fix: bind rack integrations to rendered devices 2026-08-13 10:51:59 +02:00
MrBlake 270d821219 fix: render rack integrations server-side 2026-08-13 10:15:13 +02:00
MrBlake 33490d40c4 fix: preserve native reorder rack devices 2026-08-13 09:58:34 +02:00
MrBlake a5f8cb62c7 fix: restore populated rack and reorder views 2026-08-13 09:37:59 +02:00
MrBlake bc2024ac13 fix: render all devices sharing rack units 2026-08-13 09:09:55 +02:00
MrBlake a0358136b2 fix: restore rack and reorder width views 2026-08-13 08:35:21 +02:00
MrBlake 70825c4040 feat: integrate rack widths across plugins 2026-08-12 17:12:19 +02:00
MrBlake ec67e6b7d0 revert: defer rack images to NetBox 2026-08-12 16:02:43 +02:00
MrBlake 4ee78ae4fe fix: update rack width controls and images 2026-08-12 15:57:22 +02:00
MrBlake c663069825 fix: render partial-width devices in rack SVG 2026-08-12 15:41:40 +02:00
MrBlake 7dc9b4d91d fix: handle NetBox device form clean result 2026-08-12 15:24:01 +02:00
MrBlake c38ab30acc fix: render rack width fields in device template 2026-08-12 14:28:35 +02:00
MrBlake 008a69ed79 fix: render rack width fields in grouped device forms 2026-08-12 13:19:58 +02:00