mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-07-27 03:52:29 +02:00
3e80ea0c85
Remote text console for the managed repeater. Core mechanism: repeater_cmd_wait() sends the command and synchronously waits for the reply — CLI replies arrive as CONTACT_MSG_RECV txt_type=1 with no protocol-level correlation, so correlation = repeater lock (single command in flight) + sender-prefix match. A single-slot waiter is checked at the top of _on_dm_received: matched CLI replies are consumed there and never stored as chat DMs; unmatched ones (e.g. console fire-and-forget cmd) keep the legacy DM behavior. Wait time derives from the device-suggested timeout (10-45 s clamp). POST /api/repeaters/<pk>/cli is admin-gated (403 for guest sessions: firmware silently drops guest text commands, which would look like a timeout). Pane: dark terminal styled after the Console module, quick- command chips, Enter to send, per-repeater arrow-key history in localStorage, elapsed-time line, inline timeout errors (lost replies happen over radio — a manual retry typically succeeds). Settings (stage 7) and Actions (stage 8) will reuse repeater_cmd_wait. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>