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,37 @@
|
||||
<script setup lang="ts">
|
||||
import { LIVE_COLORS, LIVE_LABELS, liveAge } from '#shared/live'
|
||||
import type { LiveConnection } from '#shared/live'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
status: LiveConnection
|
||||
lastEventAt?: string
|
||||
compact?: boolean
|
||||
}>(),
|
||||
{ lastEventAt: '', compact: false },
|
||||
)
|
||||
|
||||
const color = computed(() => LIVE_COLORS[props.status])
|
||||
const label = computed(() => LIVE_LABELS[props.status])
|
||||
const age = computed(() => (props.lastEventAt ? liveAge(props.lastEventAt) : ''))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span class="live-status" role="status" aria-live="polite" :title="lastEventAt ? `Last event ${age}` : undefined">
|
||||
<OnyxBadge :color="color" :density="compact ? 'compact' : 'default'">{{ label }}</OnyxBadge>
|
||||
<span v-if="lastEventAt && !compact" class="live-status__age">{{ age }}</span>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.live-status {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
.live-status__age {
|
||||
color: var(--onyx-color-text-icons-neutral-soft);
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user