unifi-network-maps 1.4.6__py3-none-any.whl → 1.4.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- unifi_network_maps/__init__.py +1 -1
- unifi_network_maps/render/svg.py +32 -11
- {unifi_network_maps-1.4.6.dist-info → unifi_network_maps-1.4.8.dist-info}/METADATA +6 -3
- {unifi_network_maps-1.4.6.dist-info → unifi_network_maps-1.4.8.dist-info}/RECORD +8 -8
- {unifi_network_maps-1.4.6.dist-info → unifi_network_maps-1.4.8.dist-info}/WHEEL +0 -0
- {unifi_network_maps-1.4.6.dist-info → unifi_network_maps-1.4.8.dist-info}/entry_points.txt +0 -0
- {unifi_network_maps-1.4.6.dist-info → unifi_network_maps-1.4.8.dist-info}/licenses/LICENSE +0 -0
- {unifi_network_maps-1.4.6.dist-info → unifi_network_maps-1.4.8.dist-info}/top_level.txt +0 -0
unifi_network_maps/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.4.
|
|
1
|
+
__version__ = "1.4.8"
|
unifi_network_maps/render/svg.py
CHANGED
|
@@ -609,9 +609,13 @@ def _render_svg_nodes(
|
|
|
609
609
|
node_type = node_types.get(name, "other")
|
|
610
610
|
fill, stroke = _TYPE_COLORS.get(node_type, _TYPE_COLORS["other"])
|
|
611
611
|
fill = f"url(#node-{node_type})"
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
612
|
+
group_attrs = _svg_node_group_attrs(node_data, name, node_type)
|
|
613
|
+
lines.append(f"<g{group_attrs}>")
|
|
614
|
+
lines.append(f"<title>{_escape_text(name)}</title>")
|
|
615
|
+
lines.append(
|
|
616
|
+
f'<rect x="{x}" y="{y}" width="{options.node_width}" height="{options.node_height}" '
|
|
617
|
+
'fill="transparent" pointer-events="all" class="node-hitbox"/>'
|
|
618
|
+
)
|
|
615
619
|
lines.append(
|
|
616
620
|
f'<rect x="{x}" y="{y}" width="{options.node_width}" height="{options.node_height}" '
|
|
617
621
|
f'rx="6" ry="6" fill="{fill}" stroke="{stroke}" stroke-width="1"/>'
|
|
@@ -649,16 +653,25 @@ def _render_svg_nodes(
|
|
|
649
653
|
lines.append(
|
|
650
654
|
f'<text x="{text_x}" y="{text_y}" fill="#1f1f1f" text-anchor="start">{safe_name}</text>'
|
|
651
655
|
)
|
|
652
|
-
|
|
653
|
-
lines.append("</g>")
|
|
656
|
+
lines.append("</g>")
|
|
654
657
|
|
|
655
658
|
|
|
656
|
-
def
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
659
|
+
def _svg_node_group_attrs(
|
|
660
|
+
node_data: dict[str, dict[str, str]] | None,
|
|
661
|
+
name: str,
|
|
662
|
+
node_type: str,
|
|
663
|
+
) -> str:
|
|
664
|
+
attrs: dict[str, str] = {
|
|
665
|
+
"class": "unm-node",
|
|
666
|
+
"data-node-id": name,
|
|
667
|
+
"data-node-type": node_type,
|
|
668
|
+
}
|
|
669
|
+
if node_data and (extra := node_data.get(name)):
|
|
670
|
+
for key, value in extra.items():
|
|
671
|
+
if key == "class":
|
|
672
|
+
attrs["class"] = f"{attrs['class']} {value}".strip()
|
|
673
|
+
else:
|
|
674
|
+
attrs[key] = value
|
|
662
675
|
rendered = [f' {key}="{_escape_attr(value, quote=True)}"' for key, value in attrs.items()]
|
|
663
676
|
return "".join(rendered)
|
|
664
677
|
|
|
@@ -1050,7 +1063,14 @@ def _render_iso_node(
|
|
|
1050
1063
|
node_depth = 0.0
|
|
1051
1064
|
tile_w = layout.tile_width
|
|
1052
1065
|
tile_h = layout.tile_height
|
|
1066
|
+
group_attrs = _svg_node_group_attrs(None, name, node_type)
|
|
1067
|
+
lines.append(f"<g{group_attrs}>")
|
|
1068
|
+
lines.append(f"<title>{_escape_text(name)}</title>")
|
|
1053
1069
|
top, left, right = _iso_node_polygons(x, y, tile_w, tile_h, node_depth)
|
|
1070
|
+
lines.append(
|
|
1071
|
+
f'<polygon points="{_points_to_svg(top)}" fill="transparent" '
|
|
1072
|
+
'pointer-events="all" class="node-hitbox"/>'
|
|
1073
|
+
)
|
|
1054
1074
|
left_fill = "#d0d0d0" if node_type == "other" else "#dcdcdc"
|
|
1055
1075
|
right_fill = "#c2c2c2" if node_type == "other" else "#c8c8c8"
|
|
1056
1076
|
_iso_render_faces(
|
|
@@ -1116,6 +1136,7 @@ def _render_iso_node(
|
|
|
1116
1136
|
f'<text x="{name_x}" y="{name_y}" text-anchor="middle" fill="#1f1f1f" '
|
|
1117
1137
|
f'font-size="{name_font_size}" transform="{name_transform}">{_escape_text(name)}</text>'
|
|
1118
1138
|
)
|
|
1139
|
+
lines.append("</g>")
|
|
1119
1140
|
|
|
1120
1141
|
|
|
1121
1142
|
def _render_iso_nodes(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: unifi-network-maps
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.8
|
|
4
4
|
Summary: Dynamic UniFi -> network maps in mermaid or svg
|
|
5
5
|
Author: Merlijn
|
|
6
6
|
License-Expression: MIT
|
|
@@ -14,10 +14,11 @@ Classifier: Intended Audience :: System Administrators
|
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
16
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Classifier: Topic :: Documentation
|
|
19
20
|
Classifier: Topic :: System :: Networking
|
|
20
|
-
Requires-Python: >=3.
|
|
21
|
+
Requires-Python: >=3.12
|
|
21
22
|
Description-Content-Type: text/markdown
|
|
22
23
|
License-File: LICENSE
|
|
23
24
|
Requires-Dist: unifi-controller-api==0.3.2
|
|
@@ -25,7 +26,7 @@ Requires-Dist: python-dotenv==1.2.1
|
|
|
25
26
|
Requires-Dist: PyYAML==6.0.3
|
|
26
27
|
Requires-Dist: Jinja2==3.1.6
|
|
27
28
|
Provides-Extra: dev
|
|
28
|
-
Requires-Dist: Faker==40.1.
|
|
29
|
+
Requires-Dist: Faker==40.1.2; extra == "dev"
|
|
29
30
|
Requires-Dist: behave==1.3.3; extra == "dev"
|
|
30
31
|
Requires-Dist: pre-commit==4.5.1; extra == "dev"
|
|
31
32
|
Requires-Dist: pytest==9.0.2; extra == "dev"
|
|
@@ -44,6 +45,8 @@ Dynamic: license-file
|
|
|
44
45
|
Dynamic UniFi network maps generated from LLDP topology. Output can be a range of options including Markdown,
|
|
45
46
|
Mermaid, SVG (including an Isometric view), and MkDocs.
|
|
46
47
|
|
|
48
|
+
Python 3.12+ is supported (3.13 preferred).
|
|
49
|
+
|
|
47
50
|
## Installation
|
|
48
51
|
|
|
49
52
|
PyPI:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
unifi_network_maps/__init__.py,sha256=
|
|
1
|
+
unifi_network_maps/__init__.py,sha256=F1u2mSK8Wly-J_mt7oHk_RJLir3nEN_Ri1OneijYSlc,22
|
|
2
2
|
unifi_network_maps/__main__.py,sha256=XsOjaqslAVgyVlOTokjVddZ2iT8apZXpJ_OB-9WEEe4,179
|
|
3
3
|
unifi_network_maps/adapters/__init__.py,sha256=nzx1KsiYalL_YuXKE6acW8Dj5flmMg0-i4gyYO0gV54,22
|
|
4
4
|
unifi_network_maps/adapters/config.py,sha256=Bx9JDZxxY7Gjxyb8FDT0dxiKfgXt_TmzTDbgvpwB53s,1548
|
|
@@ -76,7 +76,7 @@ unifi_network_maps/render/markdown_tables.py,sha256=VvM0fSnSmpeeDPcD5pXaL_j_PTF0
|
|
|
76
76
|
unifi_network_maps/render/mermaid.py,sha256=xsC57Xg-nKhmlVATzEbwLkMM2BOeDYlBjZuxBIPhHeI,8324
|
|
77
77
|
unifi_network_maps/render/mermaid_theme.py,sha256=7nqLlvhaUA4z0YOs0ByEx_yHWcQD_hJJjhDtRcbSpg4,1781
|
|
78
78
|
unifi_network_maps/render/mkdocs.py,sha256=EOST9_eP1ZoZQax-p-2fjlelrl3AKEJ9Gn-KXW8TI-o,5389
|
|
79
|
-
unifi_network_maps/render/svg.py,sha256=
|
|
79
|
+
unifi_network_maps/render/svg.py,sha256=W0tiuCkicTxbHTJbeRbnWzFfaO9yawL7e6EJiP7TLnU,40791
|
|
80
80
|
unifi_network_maps/render/svg_theme.py,sha256=Si1ArM3v_-wAvHZyLFPiOZ0ohQRd6ezIckwC3_b-WIw,2684
|
|
81
81
|
unifi_network_maps/render/templating.py,sha256=VJbXzZFBPjL8LFFPcLf_EU5Eu53GN9_vpten2Mf9A-k,576
|
|
82
82
|
unifi_network_maps/render/theme.py,sha256=vKYdPhcGEOV1o_irwqzJlIXPgRvZqQEzYYV2_TxZn4E,4301
|
|
@@ -91,9 +91,9 @@ unifi_network_maps/render/templates/mkdocs_html_block.html.j2,sha256=5l5-BbNujOc
|
|
|
91
91
|
unifi_network_maps/render/templates/mkdocs_legend.css.j2,sha256=tkTI-RagBSgdjUygVenlTsQFenU09ePbXOfDt_Q7YRM,612
|
|
92
92
|
unifi_network_maps/render/templates/mkdocs_legend.js.j2,sha256=qMYyCKsJ84uXf1wGgzbc7Bc49RU4oyuaGK9KrgQDQEI,685
|
|
93
93
|
unifi_network_maps/render/templates/mkdocs_mermaid_block.md.j2,sha256=9IncllWQpoI8BN3A7b2zOQ5cksj97ddsjHJ-aBhpw7o,66
|
|
94
|
-
unifi_network_maps-1.4.
|
|
95
|
-
unifi_network_maps-1.4.
|
|
96
|
-
unifi_network_maps-1.4.
|
|
97
|
-
unifi_network_maps-1.4.
|
|
98
|
-
unifi_network_maps-1.4.
|
|
99
|
-
unifi_network_maps-1.4.
|
|
94
|
+
unifi_network_maps-1.4.8.dist-info/licenses/LICENSE,sha256=mYo1siIIfIwyfdOuK2-Zt0ij2xBTii2hnpeTu79nD80,1074
|
|
95
|
+
unifi_network_maps-1.4.8.dist-info/METADATA,sha256=Z4FhxeC516bgkjOHeh6AAdYT-2KbremVuj8ZVsQWWWE,9850
|
|
96
|
+
unifi_network_maps-1.4.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
97
|
+
unifi_network_maps-1.4.8.dist-info/entry_points.txt,sha256=cdJ7jsBgNgHxSflYUOqgz5BbvuM0Nnh-x8_Hbyh_LFg,67
|
|
98
|
+
unifi_network_maps-1.4.8.dist-info/top_level.txt,sha256=G0rUX1PNfVCn1u-KtB6QjFQHopCOVLnPMczvPOoraHg,19
|
|
99
|
+
unifi_network_maps-1.4.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|