feat: TUI als Browser-App via textual serve

TUI von direkten Service-Importen auf httpx API-Calls umgestellt.
Neue tui/api_client.py als schlanker async HTTP-Client. Background-
Worker pollt API alle 5s für Echtzeit-Updates. Neuer tui_standalone.py
Entry-Point für 'textual serve --port 8001 tui_standalone.py'.
This commit is contained in:
2026-03-04 20:45:55 +01:00
parent 7f3b4768c3
commit 0e2a8a6bc0
7 changed files with 254 additions and 94 deletions

21
tui_standalone.py Normal file
View File

@@ -0,0 +1,21 @@
"""MCM TUI Standalone Entry Point für textual serve.
Startet nur die TUI (kein API-Server, keine Channels).
Die TUI spricht via HTTP gegen den laufenden MCM-API-Server.
Verwendung:
# API-Server muss bereits laufen:
python main_api_only.py
# TUI im Browser starten:
.venv/bin/python -m textual serve --host 0.0.0.0 --port 8001 tui_standalone.py
# Dann im Browser öffnen: http://<host>:8001
"""
from tui.app import MCMApp
app = MCMApp()
if __name__ == "__main__":
app.run()