mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-05-02 19:42:38 +02:00
Third slice — users can now curate their device-wide region list. No per-channel mapping yet; that's PR #4. - base.html: new Channels tab in the Settings modal with an info banner pointing at regions.meshcore.nz, the list container, and an add-region form. - app.js: loadRegions / addRegion / deleteRegion / setDefaultRegion mirroring the loadContactsSettings / saveContactsSetting pattern. Client -side name validation (isValidRegionName) mirrors the firmware RegionMap::is_name_char byte-rule exactly so users get instant feedback on invalid chars without a round-trip. - api.py: four routes under /api/regions — - GET /api/regions → list registry - POST /api/regions {name} → derive key + insert; 409 dup - DELETE /api/regions/<id> → cascade channel mappings; if the deleted region was firmware default, best-effort clear on device - POST /api/regions/<id>/default → flip DB flag + push CMD 63; if firmware push fails, DB still flips and response includes a non-blocking `warning` for a toast