[codex] fix web ui to match exposed firmware api #7

Merged
electron-rare merged 1 commits from codex/webui-align-api into audit/telephony-webserver 2026-02-20 22:27:26 +00:00
electron-rare commented 2026-02-20 22:26:43 +00:00 (Migrated from github.com)

Context

The static web UI in data/webui/ was out of sync with the firmware HTTP API currently exposed by WebServerManager.

Problem

UI sections were calling endpoints that do not exist in firmware:

  • /api/contacts
  • /api/config
  • /api/logs

This made key sections effectively broken despite the backend being healthy.

Root Cause

Legacy frontend assumptions drifted from backend route evolution.

Fix

Reworked the web UI to map 1:1 to currently exposed firmware routes.

Updated UI behavior

  • Dashboard:
    • Reads /api/status
  • Configuration:
    • Reads /api/config/pins, /api/config/audio, /api/config/mqtt
  • Network:
    • WiFi: /api/network/wifi, /api/network/wifi/connect, /api/network/wifi/disconnect, /api/network/wifi/scan
    • MQTT: /api/network/mqtt, /api/network/mqtt/connect, /api/network/mqtt/disconnect
    • ESP-NOW: /api/network/espnow, /api/network/espnow/peer, /api/network/espnow/send
  • Control:
    • Uses /api/control with direct command actions (CALL, CAPTURE_START, CAPTURE_STOP, RESET_METRICS, raw command input)

Files changed

  • data/webui/index.html
  • data/webui/script.js
  • data/webui/style.css

Validation

  • Confirmed frontend no longer references removed endpoints.
  • Firmware build check passed:
    • platformio run -e esp32dev -> SUCCESS

Impact

Web UI becomes operational again against the current firmware API without backend changes.

## Context The static web UI in `data/webui/` was out of sync with the firmware HTTP API currently exposed by `WebServerManager`. ## Problem UI sections were calling endpoints that do not exist in firmware: - `/api/contacts` - `/api/config` - `/api/logs` This made key sections effectively broken despite the backend being healthy. ## Root Cause Legacy frontend assumptions drifted from backend route evolution. ## Fix Reworked the web UI to map 1:1 to currently exposed firmware routes. ### Updated UI behavior - Dashboard: - Reads `/api/status` - Configuration: - Reads `/api/config/pins`, `/api/config/audio`, `/api/config/mqtt` - Network: - WiFi: `/api/network/wifi`, `/api/network/wifi/connect`, `/api/network/wifi/disconnect`, `/api/network/wifi/scan` - MQTT: `/api/network/mqtt`, `/api/network/mqtt/connect`, `/api/network/mqtt/disconnect` - ESP-NOW: `/api/network/espnow`, `/api/network/espnow/peer`, `/api/network/espnow/send` - Control: - Uses `/api/control` with direct command actions (`CALL`, `CAPTURE_START`, `CAPTURE_STOP`, `RESET_METRICS`, raw command input) ## Files changed - `data/webui/index.html` - `data/webui/script.js` - `data/webui/style.css` ## Validation - Confirmed frontend no longer references removed endpoints. - Firmware build check passed: - `platformio run -e esp32dev` -> SUCCESS ## Impact Web UI becomes operational again against the current firmware API without backend changes.
electron-rare commented 2026-02-20 22:26:57 +00:00 (Migrated from github.com)

Cross-repo coordination links:\n- Zacus issue: https://github.com/electron-rare/le-mystere-professeur-zacus/issues/90\n- Kill_LIFE gate proposal: (issue opened in electron-rare/Kill_LIFE)

Cross-repo coordination links:\n- Zacus issue: https://github.com/electron-rare/le-mystere-professeur-zacus/issues/90\n- Kill_LIFE gate proposal: (issue opened in electron-rare/Kill_LIFE)
chatgpt-codex-connector[bot] (Migrated from github.com) reviewed 2026-02-20 22:30:04 +00:00
chatgpt-codex-connector[bot] (Migrated from github.com) left a comment

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ef445eac3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `8ef445eac3` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](http://chatgpt.com/codex/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". </details>
chatgpt-codex-connector[bot] (Migrated from github.com) commented 2026-02-20 22:30:04 +00:00

P2 Badge Set valid JSON default for ESP-NOW payload

The prefilled ESP-NOW payload is escaped as {"cmd":"STATUS"}, which is not valid JSON for parsePayloadValue in data/webui/script.js; when users submit without editing, the UI sends an escaped string payload rather than a JSON object, so peers that expect an object command receive malformed content. This affects the default/quick-send path directly.

Useful? React with 👍 / 👎.

**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Set valid JSON default for ESP-NOW payload** The prefilled ESP-NOW payload is escaped as `{"cmd":"STATUS"}`, which is not valid JSON for `parsePayloadValue` in `data/webui/script.js`; when users submit without editing, the UI sends an escaped string payload rather than a JSON object, so peers that expect an object command receive malformed content. This affects the default/quick-send path directly. Useful? React with 👍 / 👎.
Sign in to join this conversation.