Compare commits
2
Commits
38b3ec2a27
...
d7c86289b1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7c86289b1 | ||
|
|
9735164da1 |
No files matched your search
@@ -259,6 +259,7 @@ style of Cisco Packet Tracer:
|
||||
- Lines are routed **orthogonally** on bus bars, coloured per upstream device. Port names sit at the target device; multiple uplinks are drawn thicker and marked "2×".
|
||||
- **Scope**: *entire network* (one page per site), *location overview* and/or *per rack* (one page per rack). In the rack view, directly connected devices outside the rack appear faded and dashed, with their rack.
|
||||
- The **location overview** draws one diagram per site with the **locations as nodes** (server room, halls, sub-distributions …). Lines are the physical cables between locations, labelled with count and cable type (e.g. `2× SMF, 4× CAT6a`), so you can follow the cabling from the server room to the last sub-distribution. Locations containing firewalls, routers or core switches are placed at the top; each node shows its parent location and the number of racks and devices.
|
||||
- The **cross-site location overview** puts all locations of all sites in scope into **one diagram**; each node shows its site (and parent location), so you can see how buildings and their locations are connected to each other.
|
||||
- Each topology gets its **own landscape page** (PDF and Word) and is scaled as large as possible.
|
||||
- Provider circuits appear as a cloud, devices of other sites dashed (can be disabled).
|
||||
- Selectable labels: management IP, model, ports on links.
|
||||
|
||||
@@ -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.17.0"
|
||||
version = "0.18.0"
|
||||
author = "Claude"
|
||||
base_url = "customer-export"
|
||||
min_version = "4.6.8"
|
||||
|
||||
@@ -80,6 +80,7 @@ class ExportForm(forms.Form):
|
||||
choices=(
|
||||
("site", _("Whole network (per site)")),
|
||||
("locations", _("Location overview (connections between locations)")),
|
||||
("locations_all", _("Cross-site location overview (all locations in one diagram)")),
|
||||
("rack", _("Per rack")),
|
||||
),
|
||||
initial=["site"],
|
||||
|
||||
Binary file not shown.
@@ -1507,13 +1507,16 @@ msgstr "vCPU je Kern"
|
||||
|
||||
msgid ""
|
||||
"“Location overview” shows all locations of a site and the cables between "
|
||||
"them, from the server room to the last sub-distribution. “Per rack” shows "
|
||||
"each rack separately. Connected devices outside appear dashed."
|
||||
"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."
|
||||
msgstr ""
|
||||
"„Lokationsübersicht“ zeigt alle Lokationen eines Standorts und die Kabel "
|
||||
"zwischen ihnen, vom Serverraum bis zur letzten Unterverteilung. „Je Rack“ "
|
||||
"zeigt jedes Rack einzeln. Verbundene Geräte außerhalb erscheinen "
|
||||
"gestrichelt."
|
||||
"zwischen ihnen, vom Serverraum bis zur letzten Unterverteilung. "
|
||||
"„Standortübergreifend“ fasst alle Standorte in einem Diagramm zusammen, um "
|
||||
"zu sehen, wie Gebäude und ihre Lokationen verbunden sind. „Je Rack“ zeigt "
|
||||
"jedes Rack einzeln. Verbundene Geräte außerhalb erscheinen gestrichelt."
|
||||
|
||||
msgid "%(n)d device"
|
||||
msgid_plural "%(n)d devices"
|
||||
@@ -1529,3 +1532,12 @@ msgid "%(n)d rack"
|
||||
msgid_plural "%(n)d racks"
|
||||
msgstr[0] "%(n)d Rack"
|
||||
msgstr[1] "%(n)d Racks"
|
||||
|
||||
msgid "Cross-site location overview (all locations in one diagram)"
|
||||
msgstr "Lokationsübersicht standortübergreifend (alle Lokationen in einem Diagramm)"
|
||||
|
||||
msgid "Cross-site location overview"
|
||||
msgstr "Standortübergreifende Lokationsübersicht"
|
||||
|
||||
msgid "All sites"
|
||||
msgstr "Alle Standorte"
|
||||
@@ -618,6 +618,8 @@ def topology(scope, opts):
|
||||
if "locations" in scopes:
|
||||
locs = build_location_graphs(scope, opts)
|
||||
pages += [(([H(2, _("Location overview"))] if i == 0 else []) + [H(3, g.title)], g) for i, g in enumerate(locs)]
|
||||
if "locations_all" in scopes:
|
||||
pages += [([H(2, _("Cross-site location overview"))], g) for g in build_location_graphs(scope, opts, combined=True)]
|
||||
if "rack" in scopes:
|
||||
racks = build_graphs(scope, opts, per="rack")
|
||||
# Rack-Seiten unter einer gemeinsamen Zwischenüberschrift, Racks selbst eine Ebene tiefer (kürzeres Inhaltsverzeichnis)
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
<div class="card-body">
|
||||
<div class="ce-label mt-0">{{ form.topo_scope.label }}</div>
|
||||
{% include 'netbox_customer_export/_pills.html' with field=form.topo_scope %}
|
||||
<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. “Per rack” shows each rack separately. Connected devices outside appear dashed." %}</div>
|
||||
<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_details.label }}</div>
|
||||
{% include 'netbox_customer_export/_pills.html' with field=form.topo_details %}
|
||||
<div class="ce-label">{% trans "More" %}</div>
|
||||
|
||||
@@ -211,9 +211,12 @@ def _collect(scope, opts):
|
||||
return by_pk, drawn, links, external
|
||||
|
||||
|
||||
def build_location_graphs(scope, opts):
|
||||
def build_location_graphs(scope, opts, combined=False):
|
||||
"""Lokationsübersicht: ein Graph je Standort, Knoten = Lokationen, Linien = Kabel zwischen Lokationen.
|
||||
|
||||
Mit `combined=True` entsteht ein einziger standortübergreifender Graph über alle Lokationen im Scope, an
|
||||
jedem Knoten steht der Standort – so sieht man, wie Gebäude und ihre Lokationen untereinander verbunden sind.
|
||||
|
||||
Gezählt werden physische Kabel (Interfaces, Front- und Rear-Ports), deren Enden in verschiedenen Lokationen
|
||||
liegen – typischerweise LWL-/Kupfer-Trunks vom Serverraum zu den Unterverteilungen. Lokationen mit
|
||||
Firewall/Router/Core stehen oben, die Ebenen darunter folgen der Verkabelung.
|
||||
@@ -284,14 +287,17 @@ def build_location_graphs(scope, opts):
|
||||
sites = OrderedDict()
|
||||
all_locs = {}
|
||||
for d in devices:
|
||||
sites.setdefault(d.site, OrderedDict())[d.location_id] = d.location
|
||||
sites.setdefault(None if combined else d.site, OrderedDict())[d.location_id] = d.location
|
||||
all_locs[f"l{d.location_id}"] = d.location
|
||||
|
||||
graphs = []
|
||||
for site, locations in sites.items():
|
||||
nodes = OrderedDict()
|
||||
for loc in locations.values():
|
||||
sub = [str(loc.parent)] if loc.parent_id else []
|
||||
where = [str(loc.site)] if combined else []
|
||||
if loc.parent_id:
|
||||
where.append(str(loc.parent))
|
||||
sub = [" / ".join(where)] if where else []
|
||||
n_racks, n_dev = len(racks[loc.pk]), count[loc.pk]
|
||||
parts = [ngettext("%(n)d rack", "%(n)d racks", n_racks) % {"n": n_racks}] if n_racks else []
|
||||
parts.append(ngettext("%(n)d device", "%(n)d devices", n_dev) % {"n": n_dev})
|
||||
@@ -316,7 +322,8 @@ def build_location_graphs(scope, opts):
|
||||
nodes = OrderedDict((k, v) for k, v in nodes.items() if k in linked)
|
||||
if nodes:
|
||||
_layout(nodes, edges)
|
||||
graphs.append(Graph(_("Site %(name)s") % {"name": site}, nodes, edges))
|
||||
title = _("All sites") if combined else _("Site %(name)s") % {"name": site}
|
||||
graphs.append(Graph(title, nodes, edges))
|
||||
return graphs
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "netbox-customer-export"
|
||||
version = "0.17.0"
|
||||
version = "0.18.0"
|
||||
description = "NetBox plugin: customer documentation (PDF/Word) for sites, locations, tenants and tenant groups"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
Reference in new issue
Block a user