Commit Graph
54 Commits
Author SHA1 Message Date
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 <noreply@anthropic.com>
2026-09-25 11:07:03 +02:00
MrBlakeandClaude Opus 5.5 ae4b05d539 feat: integrate site prefix column from Netbox-Prefixes
Device and rack tables show the first word of the site name as the
first data column. Replaces the separate netbox_site_prefix plugin and
can be disabled with site_prefix_column_enabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 15:38:47 +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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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
MrBlake 37fc55449f fix: bind rack width form to device edit route 2026-08-12 12:43:54 +02:00
MrBlake 2a7459c460 fix: expose rack width fields on device edit form 2026-08-12 11:30:43 +02:00
MrBlake a504341442 feat: support partial-width rack devices 2026-08-12 10:38:54 +02:00
MrBlake 267a78d58d fix: skip patchpanel automation on edits 2026-08-06 16:07:47 +02:00
MrBlake 66d13292f2 fix: remove existing patchpanel backfill 2026-08-06 16:03:58 +02:00
MrBlake 8c6c48531e fix: retrace existing patchpanel cable paths 2026-08-06 15:38:06 +02:00
MrBlake e74d8fba31 fix: match patchpanel ports by identifier 2026-08-06 15:17:37 +02:00
MrBlake 0c4a737d41 feat: automate patchpanel mappings and cable tenancy 2026-08-06 15:09:08 +02:00
MrBlake e1153cfce4 fix: validate bulk JPEG uploads only once 2026-08-03 15:46:28 +02:00
MrBlake d54fc646ee feat: add bulk images and tenant autofill 2026-08-03 15:35:44 +02:00
MrBlake cd542f04f7 fix: keep navigation flyouts closed after reload 2026-07-31 11:27:17 +02:00
MrBlake 10e57c0514 fix: close collapsed navigation flyouts 2026-07-31 11:21:52 +02:00
MrBlake 5a2276aec9 fix: replace sidebar controls with resize handle 2026-07-31 11:11:19 +02:00
MrBlake 6b36184f9d feat: add collapsible resizable navigation 2026-07-31 10:25:47 +02:00
MrBlake 2cbce03206 feat: add atomic multi-device rack reordering 2026-07-31 10:06:14 +02:00
MrBlake 503df48ac7 feat: allow module quantity input 2026-07-30 16:10:15 +02:00
MrBlake 8a86ca28f7 feat: add bulk module installation 2026-07-30 16:00:31 +02:00
MrBlake 35e06ee004 feat: add tenant groups and required tenancy 2026-07-28 16:57:52 +02:00
MrBlake 54f6a3f6c9 feat: add personalized navigation and tenant filtering 2026-07-28 16:40:50 +02:00