feat(topology): nullable layout coords on LAN + TopologyDecky

MazeNET phase 2 step 5. Pure storage — the generator emits None for
x/y and the web canvas fills them in later. No logic changes; no
compose, deploy, or validator impact.
This commit is contained in:
2026-04-20 17:48:29 -04:00
parent e475c0957e
commit 9afaac7612
4 changed files with 77 additions and 0 deletions

View File

@@ -59,6 +59,10 @@ class _PlannedLAN:
subnet: str
is_dmz: bool
parent: Optional[str] # name of parent LAN, None for DMZ
# Canvas coordinates — generator leaves them None; the web editor
# (or a future auto-layouter) fills them in.
x: Optional[float] = None
y: Optional[float] = None
@dataclass
@@ -73,6 +77,9 @@ class _PlannedDecky:
# Mirrors ``DeckyConfig.service_config`` from the flat-fleet path;
# services read these via ``compose_fragment(service_cfg=...)``.
service_config: dict[str, dict] = field(default_factory=dict)
# Canvas coordinates — see _PlannedLAN.x/y.
x: Optional[float] = None
y: Optional[float] = None
@dataclass

View File

@@ -31,6 +31,8 @@ async def persist(repo: Any, plan: GeneratedTopology) -> str:
"name": lan.name,
"subnet": lan.subnet,
"is_dmz": lan.is_dmz,
"x": lan.x,
"y": lan.y,
}
)
lan_ids[lan.name] = lan_id
@@ -55,6 +57,8 @@ async def persist(repo: Any, plan: GeneratedTopology) -> str:
"service_config": decky.service_config,
},
"ip": primary_ip,
"x": decky.x,
"y": decky.y,
}
)
decky_ids[decky.name] = decky_uuid