diff --git a/ui/src/audit/DenialsPage.vue b/ui/src/audit/DenialsPage.vue index 0f5486887..93ef48801 100644 --- a/ui/src/audit/DenialsPage.vue +++ b/ui/src/audit/DenialsPage.vue @@ -49,7 +49,7 @@ onMounted(() => void store.load()); No denials recorded { }); const statuses = ref([]); +// A failed status read keeps the last known badges and flags the error, so a +// transient failure neither clears every badge nor passes as "all idle". +const statusError = ref(false); async function loadStatus() { try { statuses.value = (await api.channels<{ channels?: ChannelStatus[] }>())?.channels ?? []; + statusError.value = false; } catch { - statuses.value = []; + statusError.value = true; } } useLiveResource(null, () => void loadStatus()); @@ -147,6 +151,11 @@ function setModels(list: string[]) { {{ catalogError || error }} + + Couldn't load channel status + + + diff --git a/ui/src/mappings/state.ts b/ui/src/mappings/state.ts index 8d72c02e4..c5faa7899 100644 --- a/ui/src/mappings/state.ts +++ b/ui/src/mappings/state.ts @@ -103,6 +103,10 @@ export const listLoading = ref(true); /** A failed list load. Distinct from an action failure: the list is unusable, * where a refused action leaves it perfectly readable. */ export const loadError = ref(null); +// The optional legs fail on their own: the flag says the picker's data is a +// failed read, not an empty store, so the form can offer Retry. +export const capturesError = ref(false); +export const eventTypesError = ref(false); /** Whether the editor overlay is showing the draft. */ export const editorOpen = ref(false); @@ -136,8 +140,8 @@ export async function loadMappings(): Promise { listLoading.value = true; try { // Capture storage is optional infrastructure -- a deployment can serve - // mappings without it -- so a failing capture leg degrades to an empty - // picker instead of taking the mappings list down with it. + // mappings without it -- so a failing capture leg flags the picker instead + // of taking the mappings list down with it. const [listed, captured, types] = await Promise.all([ api.mappings<{ mappings?: Mapping[] }>(useEventsStore().workspace), api @@ -149,6 +153,8 @@ export async function loadMappings(): Promise { eventTypes.value = types?.event_types || []; captures.value = captured?.captures || []; capturesEnabled.value = captured?.enabled !== false; + capturesError.value = captured === null; + eventTypesError.value = types === null; loadError.value = null; } catch (err) { loadError.value = String((err as Error).message || err); diff --git a/ui/src/sources/SourcesPanel.vue b/ui/src/sources/SourcesPanel.vue index 6fed5fa09..42126fba4 100644 --- a/ui/src/sources/SourcesPanel.vue +++ b/ui/src/sources/SourcesPanel.vue @@ -7,6 +7,7 @@ import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Section } from "@/components/ui/section"; import { Input } from "@/components/ui/input"; +import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty"; import { Table, TableBody, @@ -37,6 +38,7 @@ import { useSources } from "./use-sources"; */ const { sources, + loadError, failure, revealed, busy, @@ -96,6 +98,11 @@ function url(source: Source): string { {{ failure }} + + Couldn't load sources + {{ loadError }} + +
@@ -220,5 +227,9 @@ function url(source: Source): string {
+ + + No sources yet + diff --git a/ui/src/sources/use-sources.ts b/ui/src/sources/use-sources.ts index f4230e288..f63fa3169 100644 --- a/ui/src/sources/use-sources.ts +++ b/ui/src/sources/use-sources.ts @@ -12,6 +12,9 @@ import type { Source, SourceRefusals } from "./source-signing"; export function useSources() { // null means loading, [] means loaded and empty. const sources = ref(null); + // Read failures are kept apart from write failures: a failed load is not "a + // write that did not take effect", and belongs next to the list, with Retry. + const loadError = ref(null); const failure = ref(null); const revealed = ref(null); const refusals = ref>({}); @@ -30,8 +33,9 @@ export function useSources() { sources.value = res.sources || []; refusals.value = res.refusals || {}; failure.value = null; + loadError.value = null; } catch (err) { - failure.value = message(err); + loadError.value = message(err); } } @@ -51,6 +55,7 @@ export function useSources() { return { sources, + loadError, failure, revealed, refusals,