fix(webui): the live stream reopens after a fatal close; quieter connection status
A non-200 answer to /api/stream (the backend restarting behind a proxy) closes an EventSource for good, so the top bar read Disconnected until a reload while every fetch worked. The live-updates store now reopens it after 1s, doubling to a 30s cap, and resets once live. The connection status becomes a dot and a label, coloured only when not connected. History drops the edge fade, which washed out its first and last columns though nothing overflowed, and its section filter names the section rather than showing the raw kind.
This commit is contained in:
7 files changed
+55
-28
No files matched your search
@@ -2,25 +2,21 @@
|
||||
import { computed } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import { StatusPill } from "@/components/ui/status-pill";
|
||||
import { connectionStatus } from "@/lib/connection";
|
||||
import { useLiveUpdatesStore } from "@/stores/live-updates";
|
||||
|
||||
const { streamState } = storeToRefs(useLiveUpdatesStore());
|
||||
const status = computed(() => connectionStatus(streamState.value));
|
||||
const pill = {
|
||||
ok: { tone: "neutral", dot: "live" },
|
||||
warn: { tone: "warn", dot: "warn" },
|
||||
danger: { tone: "danger", dot: "danger" },
|
||||
const look = {
|
||||
ok: { dot: "bg-primary", text: "text-fg-subtle" },
|
||||
warn: { dot: "bg-warn", text: "text-warn" },
|
||||
danger: { dot: "bg-danger", text: "text-danger" },
|
||||
} as const;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<StatusPill
|
||||
:tone="pill[status.tone].tone"
|
||||
:dot="pill[status.tone].dot"
|
||||
role="status"
|
||||
class="max-sm:hidden"
|
||||
>{{ status.label }}</StatusPill
|
||||
>
|
||||
<span role="status" class="inline-flex items-center gap-1.5 px-1 text-xs max-sm:hidden" :class="look[status.tone].text">
|
||||
<span class="size-1.5 rounded-full" :class="look[status.tone].dot" aria-hidden="true" />
|
||||
{{ status.label }}
|
||||
</span>
|
||||
</template>
|
||||
Reference in new issue
Block a user