fix: single control for technician topology

The technician version needed a scope pill plus a separate granularity
selection; it is now enabled directly by choosing all/per site/per location.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
MrBlakeandClaude Opus 5.5 committed 2026-11-27 10:27:50 +01:00
1 parent daf8bc671b
commit a6715f1026
7 files changed
+12 -11

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ class CustomerExportConfig(PluginConfig):
name = "netbox_customer_export"
verbose_name = _("Customer Export")
description = _("Export customer documentation as PDF or Word")
version = "0.20.1"
version = "0.20.2"
author = "Claude"
base_url = "customer-export"
min_version = "4.6.8"
+2 -3
View File
@@ -82,7 +82,6 @@ class ExportForm(forms.Form):
("locations", _("Location overview (connections between locations)")),
("locations_all", _("Cross-site location overview (all locations in one diagram)")),
("rack", _("Per rack")),
("technician", _("Technician version (numbered connections + port list)")),
),
initial=["site"],
required=False,
@@ -95,10 +94,10 @@ class ExportForm(forms.Form):
("site", _("Per site")),
("location", _("Per location")),
),
initial=["all", "site"],
initial=[],
required=False,
widget=forms.CheckboxSelectMultiple,
label=_("Technician version"),
label=_("Technician version (numbered connections + port list)"),
)
topo_external = forms.BooleanField(
required=False, initial=True, label=_("Show provider circuits and devices outside the scope")
@@ -1597,5 +1597,5 @@ msgstr "Je Lokation"
msgid "Location %(name)s (%(site)s)"
msgstr "Lokation %(name)s (%(site)s)"
msgid "Only used if “Technician version” is selected above. Each connection is numbered and listed with exact ports in a table."
msgstr "Nur wirksam, wenn oben „Techniker-Version“ gewählt ist. Jede Verbindung wird nummeriert und mit genauen Ports in einer Tabelle aufgeführt."
msgid "For third parties (other IT companies, electricians): each connection is numbered in the diagram and listed in a table with exact ports, cable and patch panels. Nothing selected = no technician version."
msgstr "Für Dritte (andere IT-Firmen, Elektriker): Jede Verbindung wird im Diagramm nummeriert und in einer Tabelle mit genauen Ports, Kabel und Patchpanels aufgeführt. Nichts gewählt = keine Techniker-Version."
+5 -3
View File
@@ -610,7 +610,8 @@ def topology(scope, opts):
from .topology import build_graphs, build_location_graphs, render_png
title = H(1, _("Network topology"))
scopes = opts.get("topo_scope") or ["site"]
# Ohne Auswahl die Standortansicht – außer es ist nur die Techniker-Version gewählt
scopes = opts.get("topo_scope") or ([] if opts.get("topo_tech_per") else ["site"])
ports = "ports" in (opts.get("topo_details") or [])
pages = [] # (Überschriften, Graph) – je eine Querformat-Seite
if "site" in scopes:
@@ -625,12 +626,13 @@ def topology(scope, opts):
# Rack-Seiten unter einer gemeinsamen Zwischenüberschrift, Racks selbst eine Ebene tiefer (kürzeres Inhaltsverzeichnis)
pages += [(([H(2, _("Topology per rack"))] if i == 0 else []) + [H(3, g.title)], g) for i, g in enumerate(racks)]
tech = [] # Techniker-Ansicht: nummerierte Verbindungen + vollständige Portliste je Standort
if "technician" in scopes:
tech_per = opts.get("topo_tech_per") or []
if tech_per:
from .topology import number_connections
graphs = []
for per in ("all", "site", "location"):
if per in (opts.get("topo_tech_per") or ["all", "site"]):
if per in tech_per:
graphs += build_graphs(scope, opts, per=per)
for i, g in enumerate(graphs):
rows = number_connections(g)
@@ -179,7 +179,7 @@
<div class="form-text mb-2">{% trans "“Location overview” shows all locations of a site and the cables between them, from the server room to the last sub-distribution. “Cross-site” combines all sites in one diagram to show how buildings and their locations are connected. “Per rack” shows each rack separately. Connected devices outside appear dashed." %}</div>
<div class="ce-label">{{ form.topo_tech_per.label }}</div>
{% include 'netbox_customer_export/_pills.html' with field=form.topo_tech_per %}
<div class="form-text mb-2">{% trans "Only used if “Technician version” is selected above. Each connection is numbered and listed with exact ports in a table." %}</div>
<div class="form-text mb-2">{% trans "For third parties (other IT companies, electricians): each connection is numbered in the diagram and listed in a table with exact ports, cable and patch panels. Nothing selected = no technician version." %}</div>
<div class="ce-label">{{ form.topo_details.label }}</div>
{% include 'netbox_customer_export/_pills.html' with field=form.topo_details %}
<div class="ce-label">{% trans "More" %}</div>
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "netbox-customer-export"
version = "0.20.1"
version = "0.20.2"
description = "NetBox plugin: customer documentation (PDF/Word) for sites, locations, tenants and tenant groups"
readme = "README.md"
requires-python = ">=3.10"