feat: live SSE stage, phone view and presenter control
- proxy Go /api/stream through Nitro; drive /stage, /live, /plan and /forecast from scenario events - fall back to 5 s polling after SSE failures or heartbeat silence; show Live/Polling/Offline - authenticate /control and POST /api/scenario in Nitro with server-side control credentials - add big-screen stage with local QR and a no-login phone recommendation view - add SSE unit tests and a live smoke test; refresh README/Makefile
This commit is contained in:
1 parent
7181562e0f
commit
233fdbf66c
24 files changed
+2757
-49
No files matched your search
@@ -0,0 +1,27 @@
|
||||
interface ApiErrorLike {
|
||||
status?: number
|
||||
statusCode?: number
|
||||
statusMessage?: string
|
||||
message?: string
|
||||
data?: {
|
||||
error?: { message?: string; code?: string }
|
||||
message?: string
|
||||
}
|
||||
}
|
||||
|
||||
/** Human-readable message from a Nuxt/$fetch error, without leaking tokens. */
|
||||
export function apiErrorMessage(error: unknown, fallback: string): string {
|
||||
const value = error as ApiErrorLike | undefined
|
||||
return (
|
||||
value?.data?.error?.message ??
|
||||
value?.data?.message ??
|
||||
value?.statusMessage ??
|
||||
value?.message ??
|
||||
fallback
|
||||
)
|
||||
}
|
||||
|
||||
export function apiErrorStatus(error: unknown): number | undefined {
|
||||
const value = error as ApiErrorLike | undefined
|
||||
return value?.status ?? value?.statusCode
|
||||
}
|
||||
Reference in new issue
Block a user