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:
1 parent
daf8bc671b
commit
a6715f1026
7 files changed
+12
-11
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user