feat: technician topology with numbered connections and full port list
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
27673ee68f
commit
677590f52c
8 files changed
+145
-7
No files matched your search
@@ -624,10 +624,25 @@ def topology(scope, opts):
|
||||
racks = build_graphs(scope, opts, per="rack")
|
||||
# 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)]
|
||||
if not pages:
|
||||
tech = [] # Techniker-Ansicht: nummerierte Verbindungen + vollständige Portliste je Standort
|
||||
if "technician" in scopes:
|
||||
from .topology import number_connections
|
||||
|
||||
for i, g in enumerate(build_graphs(scope, opts, per="site")):
|
||||
rows = number_connections(g)
|
||||
head = ([H(2, _("Technician version"))] if i == 0 else []) + [H(3, g.title)]
|
||||
tech.append((head, g, rows))
|
||||
if not pages and not tech:
|
||||
return _empty(opts, [title], _("No cabled devices found."))
|
||||
# Die Abschnittsüberschrift steht mit auf der ersten Seite
|
||||
return [
|
||||
blocks = [
|
||||
LANDSCAPE(([title] if i == 0 else []) + headings, render_png(g, show_ports=ports))
|
||||
for i, (headings, g) in enumerate(pages)
|
||||
]
|
||||
headers = [_("No."), _("Device A"), _("Port A"), _("Cable"), _("Via (patch panel)"), _("Device B"), _("Port B")]
|
||||
for head, g, rows in tech:
|
||||
if not blocks:
|
||||
head = [title] + head
|
||||
blocks.append(LANDSCAPE(head, render_png(g)))
|
||||
blocks += [H(4, _("Connections – %(name)s") % {"name": g.title}), T(headers, rows)]
|
||||
return blocks
|
||||
Reference in new issue
Block a user