fix: wss support, polling fallback, cancellation, offline labels, screen sizing

- frontend/app.js: use wss:// when page is served over HTTPS; add HTTP polling
  fallback (/state every 2s) when WebSocket is down, amber dot = polling mode;
  stop polling on WS reconnect; clearer state labels (LOG OFFLINE, LOAD ERROR,
  DISCONNECTED); fix replace('_',' ') to use regex for multi-underscore states
- frontend/style.css: add #ws-dot.polling (amber); min-height 280px on screen;
  shrink llama-wrap/SVG; tighten screen padding and gap
- log_parser.py: detect cancelled requests (stop: cancel task / Connection
  handling canceled) → idle; fix: switch to generating at progress=1.00
- server.py: add GET /state endpoint for polling fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Vlad Doloman
2026-06-26 17:59:54 +03:00
parent 9dcb5b977a
commit 8712931c23
4 changed files with 59 additions and 14 deletions

View File

@@ -29,6 +29,10 @@ def create_app(log_path: str, reopen_log: bool = False) -> FastAPI:
async def index():
return FileResponse(FRONTEND_DIR / "index.html")
@app.get("/state")
async def get_state():
return last_state
@app.websocket("/ws")
async def ws_endpoint(ws: WebSocket):
await ws.accept()