olt: add bulk DHCPv4/DHCPv6 filter edit alongside flood mode

Generalises the OLT bulk tool from flood-mode-only to arbitrary NNI-service
edits. DHCP modes live nested under each NNI entry's Filter object
(Filter.DHCPv4 / Filter.DHCPv6, e.g. "pass" <-> "umt"), confirmed from a
real OLT-CFG paste-back.

- src/mcms-api.js: planFloodChange -> planNniEdit(oltCfg, {tagPattern, flood,
  dhcpv4, dhcpv6}); each concern optional. DHCP is value-replacement,
  replace-only-when-present (never invents the key; leaves EAPOL/PPPoE/NDP).
  Still non-mutating (clones the entry AND the Filter). Returns changes with
  per-entry edits[]. summarizeOltNniNetworks surfaces dhcpv4/dhcpv6; new
  dhcpModeOfNni helper.
- main.js + web/server.js: executeFloodChange handler passes flood/dhcpv4/
  dhcpv6 ops through (channel name kept for wire compat).
- renderer: OLT inspector now has three action dropdowns (Flooding / DHCPv4 /
  DHCPv6, defaults flood private->auto + DHCP pass->umt); table shows DHCP
  chips + per-service "will change (flood, DHCPv4, …)"; flood-mode filter
  defaults to Any so DHCP-on-pass auto-flood OLTs still show; CSV report
  lists every per-NNI edit (pon-olt-nni-*.csv).

Verified: node --check; planNniEdit unit-tested against the real fixture +
a pass variant (13/13: no-mutation, EAPOL/PPPoE/NDP preserved,
replace-when-present, flood/DHCP independence); OLT view rendered offscreen
showing correct per-service "will change" markers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jon Vanvik 2026-06-23 14:57:37 +02:00
parent de037c8795
commit 5e3d9271a8
7 changed files with 232 additions and 118 deletions

View file

@ -8,8 +8,8 @@ System (MCMS) 6.2** PON Manager. Top tabs split it into:
registration-state breakdown (with an opt-in per-ONU Rx/FEC scan).
Clicking a state jumps to the ONU tab pre-filtered.
2. **ONU** — the fleet table plus **bulk ONU firmware upgrades** (below).
3. **OLT****bulk OLT PON flooding-mode changes** (private↔auto on NNI
services — see "OLT PON flooding mode" below).
3. **OLT****bulk OLT NNI-service edits**: PON flooding mode (private↔auto)
and DHCPv4/v6 filter (pass↔umt) — see "OLT NNI-service edits" below.
## ONU firmware upgrades
@ -104,27 +104,36 @@ pon-fleet-upgrader/
└── app.js # UI logic
```
## OLT PON flooding mode
## OLT NNI-service edits
From the fleet view, **Open OLT inspector…** opens a second workflow for
bulk-checking and changing the PON flooding mode of OLT NNI services.
bulk-checking and editing OLT NNI services. Two independent edits can be
applied together to every matching service:
On Tibit OLTs the flooding mode is encoded by the presence of a single key
on each `OLT-CFG["NNI Networks"]` entry:
**Flooding mode** — encoded by the presence of a single key on each
`OLT-CFG["NNI Networks"]` entry:
| Mode | `PON FLOOD ID` key | Change |
|------|--------------------|--------|
| **private** | present (any value, incl. `0`) | → auto: delete the key |
| **auto** | absent | → private: set the key to `0` |
Workflow: enter a **TAG MATCH** pattern (exact like `s0.c76.c0`, or a `*`
glob like `s0.c76.*`), **Load OLTs**, select the OLTs to change, pick a
direction, then **Execute change…** (two-step confirm). Each OLT is
re-fetched, the matching NNI entries are flipped, and the full OLT-CFG is
PUT back. A result CSV is auto-saved to `~/Downloads/pon-olt-flood-*.csv`.
**DHCP filter mode** — values nested under each entry's `Filter` object
(`DHCPv4` / `DHCPv6`), e.g. `pass``umt`. Only entries that already have
the field are touched (the field is never invented); `EAPOL`/`PPPoE`/`NDP`
are left alone.
Both directions are supported, so a change can be rolled back from the same
screen. The default action targets `s0.c76.c0`, `private``auto`.
Workflow: enter a **TAG MATCH** pattern (exact like `s0.c76.c0`, or a `*`
glob like `s0.c76.*`), **Load OLTs**, pick any of the three actions
(Flooding / DHCPv4 / DHCPv6), select the OLTs — each matching service shows
"→ will change (…)" for the edits that apply — then **Execute changes…**
(two-step confirm). Each OLT is re-fetched, the matching NNI entries are
edited in one pass, and the full OLT-CFG is PUT back. A result CSV is
auto-saved to `~/Downloads/pon-olt-nni-*.csv`.
All directions are supported (e.g. `umt → pass`), so changes roll back from
the same screen. Defaults: `s0.c76.c0`, flood `private → auto`, DHCPv4/v6
`pass → umt`.
## Known limitations