This commit is contained in:
2026-01-12 19:03:50 +00:00
parent 0da76927ce
commit d4b8dcd455
48 changed files with 1352 additions and 723 deletions
+27 -24
View File
@@ -1,21 +1,21 @@
# GUI Control Panel
## Purpose
How to use the Vite-based GUI to control and observe the virtual box.
## Zweck
Nutzung des GUI Control Panels zur Steuerung und Beobachtung der virtuellen Box.
## Prerequisites
- Box running on `http://127.0.0.1:8000`
- GUI started (`npm run dev` or `./dev.sh`)
## Voraussetzungen
- Box laeuft auf `http://127.0.0.1:8000`
- GUI gestartet (`npm run dev` oder `./dev.sh`)
- Bei gepaarter Box: `VITE_BOX_API_TOKEN` gesetzt
## Step-by-step
1) Open GUI:
## Schritt-fuer-Schritt
1) GUI oeffnen:
```
http://127.0.0.1:5174
```
2) Click buttons to send commands.
3) Observe status updates (polling + refresh after command).
2) Buttons klicken, Status beobachten.
## Controls (current in GUI)
## Controls (im GUI vorhanden)
- Play / Pause
- Next
- Prev
@@ -25,29 +25,32 @@ http://127.0.0.1:5174
- NFC UID_1 OFF
- Refresh Status
## Controls (available via API only)
## Controls (nur API)
- WiFi add/reset
- Spotify set/clear
Use API for those:
Beispiel via API:
```
## Auth-Token fuer GUI
- Nach Pairing: Token ueber Server-API oder Server-GUI ermitteln.\n- GUI mit Token starten:\n```\nVITE_BOX_API_TOKEN=<api_token> npm run dev\n```
curl -X POST http://127.0.0.1:8000/command \
-H "Content-Type: application/json" \
-d '{"command":"wifi_add_profile","payload":{"ssid":"HomeWiFi","password":"secret","priority":10}}'
```
## Expected results
- After any button click, status refreshes within 1 second.
- `last_error` is visible if an error occurs.
## Erwartete Ergebnisse
- Nach jedem Klick wird der Status innerhalb von 1s aktualisiert.
- `last_error` wird angezeigt, wenn gesetzt.
## Checklist
- ✅ GUI loads and shows API base URL
- ✅ Status updates every 1s
-Clicking a button updates `/status`
## Checkliste
- ✅ GUI laedt und zeigt API-URL
- ✅ Status aktualisiert sich automatisch
-Buttons aendern `/status`
## Troubleshooting
- GUI shows "Failed to fetch":
- Check `VITE_BOX_API_URL`.
- Verify Box API is running.
- Buttons have no effect:
- Check the API command names in `docs/api.md`.
- GUI zeigt "Failed to fetch":
- `VITE_BOX_API_URL` pruefen.
- Box API muss laufen.
- Buttons ohne Wirkung:
- API-Command-Namen in `docs/api.md` pruefen.