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:
@@ -85,6 +85,8 @@ _RELEASE_RE = re.compile(r'slot\s+release:.*stop processing')
|
||||
_UNLOAD_RE = re.compile(r'unload_lru:|unload: stopping model instance')
|
||||
_LOAD_ERROR_RE = re.compile(r'exiting due to model loading error')
|
||||
_EXIT_ERROR_RE = re.compile(r'operator\(\):.*exited with status 1')
|
||||
_CLIENT_CANCEL_RE = re.compile(r'http client error: Connection handling canceled')
|
||||
_CANCEL_TASK_RE = re.compile(r'stop: cancel task')
|
||||
|
||||
|
||||
# ── State machine ─────────────────────────────────────────────────────────────
|
||||
@@ -125,6 +127,8 @@ class LogParser:
|
||||
return self._set(state="unloading")
|
||||
if _EXIT_ERROR_RE.search(content):
|
||||
return self._set(state="error")
|
||||
if _CLIENT_CANCEL_RE.search(content):
|
||||
return self._set(state="idle", loading=None, metrics=Metrics())
|
||||
return None
|
||||
|
||||
# ── Child-process lines ──────────────────────────────────────────────────
|
||||
@@ -136,6 +140,8 @@ class LogParser:
|
||||
return self._handle_cmd_state(m.group(1))
|
||||
if _LOAD_ERROR_RE.search(content):
|
||||
return self._set(state="error")
|
||||
if _CANCEL_TASK_RE.search(content):
|
||||
return self._set(state="idle", loading=None, metrics=Metrics())
|
||||
if _WARMUP_RE.search(content):
|
||||
return self._set(state="warming_up")
|
||||
if _IDLE_RE.search(content):
|
||||
|
||||
Reference in New Issue
Block a user