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>
This commit is contained in:
2026-09-17 16:13:40 +02:00
co-authored by Claude Sonnet 5
parent 3cff66ad33
commit ca1e38a1da
4 changed files with 45 additions and 29 deletions
+4
View File
@@ -156,6 +156,10 @@ class RackUtilitiesContent(PluginTemplateExtension):
models = ["dcim.rack"]
def right_page(self):
# Injects a script (no visible panel here) which places an "SVG
# offline" button right next to each native "SVG herunterladen"
# link, since NetBox renders those inside the per-face elevation
# cards rather than through a plugin buttons() extension point.
if not offline_svg_export_enabled():
return ""
rack = self.context["object"]