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>
This commit is contained in:
2026-09-17 14:22:04 +02:00
co-authored by Claude Sonnet 5
parent 35ca661ed0
commit 3768417be6
9 changed files with 186 additions and 6 deletions
+4
View File
@@ -15,6 +15,10 @@ def connection_vlans_enabled():
return bool(get_plugin_config("netbox_utilities", "connection_vlans_enabled"))
def offline_svg_export_enabled():
return bool(get_plugin_config("netbox_utilities", "offline_svg_export_enabled"))
def tenant_filter_enabled():
if not get_plugin_config("netbox_utilities", "tenant_filter_enabled"):
return False