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>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
from netbox.plugins import PluginConfig, get_plugin_config
|
from netbox.plugins import PluginConfig, get_plugin_config
|
||||||
|
|
||||||
__version__ = "0.11.0"
|
__version__ = "0.11.1"
|
||||||
|
|
||||||
|
|
||||||
class NetBoxUtilitiesConfig(PluginConfig):
|
class NetBoxUtilitiesConfig(PluginConfig):
|
||||||
|
|||||||
@@ -155,12 +155,12 @@ class ConnectionVLANContent(PluginTemplateExtension):
|
|||||||
class RackUtilitiesContent(PluginTemplateExtension):
|
class RackUtilitiesContent(PluginTemplateExtension):
|
||||||
models = ["dcim.rack"]
|
models = ["dcim.rack"]
|
||||||
|
|
||||||
def buttons(self):
|
def right_page(self):
|
||||||
if not offline_svg_export_enabled():
|
if not offline_svg_export_enabled():
|
||||||
return ""
|
return ""
|
||||||
rack = self.context["object"]
|
rack = self.context["object"]
|
||||||
return self.render(
|
return self.render(
|
||||||
"netbox_utilities/rack_offline_svg_buttons.html",
|
"netbox_utilities/rack_offline_svg_panel.html",
|
||||||
{"rack": rack},
|
{"rack": rack},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
<a href="{% url 'plugins:netbox_utilities:rack_elevation_offline_svg' pk=rack.pk %}?face=front"
|
|
||||||
class="btn btn-outline-secondary" title="Vorderseite als linkfreie SVG-Datei herunterladen">
|
|
||||||
<i class="mdi mdi-download" aria-hidden="true"></i>
|
|
||||||
SVG offline (vorne)
|
|
||||||
</a>
|
|
||||||
<a href="{% url 'plugins:netbox_utilities:rack_elevation_offline_svg' pk=rack.pk %}?face=rear"
|
|
||||||
class="btn btn-outline-secondary" title="Rückseite als linkfreie SVG-Datei herunterladen">
|
|
||||||
<i class="mdi mdi-download" aria-hidden="true"></i>
|
|
||||||
SVG offline (hinten)
|
|
||||||
</a>
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<div class="card">
|
||||||
|
<h2 class="card-header">SVG offline exportieren</h2>
|
||||||
|
<div class="card-body d-flex flex-column gap-2">
|
||||||
|
<a href="{% url 'plugins:netbox_utilities:rack_elevation_offline_svg' pk=rack.pk %}?face=front"
|
||||||
|
class="btn btn-outline-secondary" title="Vorderseite als linkfreie SVG-Datei herunterladen">
|
||||||
|
<i class="mdi mdi-download" aria-hidden="true"></i>
|
||||||
|
Vorderseite
|
||||||
|
</a>
|
||||||
|
<a href="{% url 'plugins:netbox_utilities:rack_elevation_offline_svg' pk=rack.pk %}?face=rear"
|
||||||
|
class="btn btn-outline-secondary" title="Rückseite als linkfreie SVG-Datei herunterladen">
|
||||||
|
<i class="mdi mdi-download" aria-hidden="true"></i>
|
||||||
|
Rückseite
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "netbox-utilities"
|
name = "netbox-utilities"
|
||||||
version = "0.11.0"
|
version = "0.11.1"
|
||||||
description = "Navigation, tenant utilities, connection VLANs, partial-width racks, and bulk operations for NetBox 4.6/4.7"
|
description = "Navigation, tenant utilities, connection VLANs, partial-width racks, and bulk operations for NetBox 4.6/4.7"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
|
|||||||
Reference in New Issue
Block a user