Files
web-nuxt/app/app.vue
T
Noel Sabia 233fdbf66c 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
2026-11-14 06:59:07 +01:00

83 lines
2.3 KiB
Vue

<script setup lang="ts">
import {
iconCalendar,
iconChart,
iconCircleInformation,
iconFlash,
iconHome,
iconMobileSignal,
iconPresentionBoard,
} from '@sit-onyx/icons'
const route = useRoute()
const config = useRuntimeConfig()
const usingMock = computed(
() =>
config.public.useMock === true ||
config.public.useMock === '1' ||
config.public.useMock === 'true',
)
const navigation = [
{ to: '/', label: 'Now', icon: iconHome },
{ to: '/forecast', label: 'Forecast', icon: iconChart },
{ to: '/plan', label: 'Plan', icon: iconCalendar },
{ to: '/simulate', label: 'Simulate', icon: iconFlash },
{ to: '/stage', label: 'Stage', icon: iconPresentionBoard },
{ to: '/live', label: 'Live', icon: iconMobileSignal },
{ to: '/about', label: 'About', icon: iconCircleInformation },
]
const hiddenPageLabels: Record<string, string> = { '/control': 'Control' }
const activeLabel = computed(
() => navigation.find((item) => item.to === route.path)?.label ?? hiddenPageLabels[route.path] ?? 'PulseCast',
)
</script>
<template>
<OnyxAppLayout>
<template #navBar>
<OnyxNavBar app-name="PulseCast" logo-url="/logo.svg" mobile="sm">
<OnyxUnstableNavButton
v-for="item in navigation"
:key="item.to"
:link="item.to"
:label="item.label"
:icon="item.icon"
/>
<template #contextArea>
<OnyxBadge :color="usingMock ? 'warning' : 'success'">{{ usingMock ? 'Mock data' : 'Go API' }}</OnyxBadge>
</template>
<template #mobileActivePage>{{ activeLabel }}</template>
</OnyxNavBar>
</template>
<OnyxPageLayout>
<NuxtPage />
<template #footer>
<footer class="app-footer">
<span><strong>PulseCast</strong> — staff the pulse, not the noise.</span>
<span class="muted small">
Prototype · forecast from the Go API · estimated devices, not people · 8 sensors in a 580 m cluster
</span>
</footer>
</template>
</OnyxPageLayout>
</OnyxAppLayout>
</template>
<style scoped>
.app-footer {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: var(--onyx-density-sm);
width: 100%;
max-width: 1440px;
margin-inline: auto;
padding-block: var(--onyx-density-sm);
color: var(--onyx-color-text-icons-neutral-medium);
font-size: 0.8125rem;
}
</style>