wrolpi/controller/api
Roland 07af0c9f28 controller: de-duplicate the hardware toggles
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>
2026-07-29 19:48:08 -06:00
..
__init__.py Creating Controller service which will control WROLPi services, admin, SMART, disks, and status. nginx will fallback to Controller UI when React UI is unavailable (such as during upgrades). 2025-12-15 15:48:40 -07:00
admin.py controller: de-duplicate the hardware toggles 2026-07-29 19:48:08 -06:00
disks.py controller: don't strand the API stopped on a failed primary unmount 2026-07-23 19:23:05 -06:00
onboarding.py Warning users when files exist in mount location. Users may have accidentally downloaded files into the media directory, we want to warn them. 2026-05-14 17:02:52 -06:00
ready.py Checking readiness of main app in Controller instead of javascript requests, which break with CORS. 2026-03-08 16:05:56 -06:00
schemas.py controller: VNC toggle, gated on the Desktop running 2026-07-29 18:10:05 -06:00
scripts.py Enhancing Controller to run scripts, starting with the repair and upgrade scripts for onboarding use. 2026-02-25 17:08:32 -07:00
services.py Expanding modal width on controller dashboard. Including hostname in controller dashboard title. 2025-12-24 16:43:37 -07:00
status.py controller: VNC toggle, gated on the Desktop running 2026-07-29 18:10:05 -06:00