mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-25 18:40:06 -04:00
The Hotspot, Bluetooth, Desktop, VNC and Throttle toggles had each been written out longhand at four layers. Collapse the shared parts: - useSubsystemToggle() replaces five near-identical hooks. This also fixes a latent bug: only useDesktop/useVnc restored state when a request failed, so a failed Bluetooth/Throttle/Hotspot toggle left at null and — since the status poll sees no change — the toggle stayed disabled and read as unsupported until it remounted. - SubsystemToggle renders all five, with the Desktop's stop confirmation and VNC's desktop gating as declared options rather than bespoke copies. - The fallback UI's four update*/toggle* pairs become one config-driven implementation (-100 lines). - _raise_for_action() centralises the 13 endpoint failure checks, including VNC's 409-vs-500 split. Deliberately not shared: the six get_*_status_dict() builders (payloads genuinely differ) and the per-subsystem mechanisms (nmcli/rfkill/sysfs/systemctl). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| index.html | ||