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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>