fix(admin-ui): page-level loading, stale and form fixes

Fetch the consumers list on the user detail page so admin and grant data show on a deep link.
Gate Recent errors, the Spend total and the forecast card on load state instead of showing zeros.
Show a stale notice on top lists when a refresh fails.
Clear the target name when the target kind changes.
Ignore out-of-order config responses.
Wrap long group names and event messages, and announce projected budget overruns to screen readers.
Regenerate admin_assets_gen.go.
This commit is contained in:
2026-11-08 02:04:23 +00:00
parent fcfb298077
commit 05a7c114f5
10 changed files with 158 additions and 78 deletions
+8 -2
View File
@@ -19,20 +19,26 @@ export const useConfigStore = defineStore('config', {
data: null as AdminConfigResponse | null,
loading: false,
error: '',
/** Latest-request-wins guard: only the newest fetch may write state. */
reqId: 0,
}),
actions: {
async fetchConfig(): Promise<void> {
const auth = useAuthStore()
if (!auth.isAuthenticated) return
const requestId = ++this.reqId
this.loading = true
try {
this.data = await adminFetch<AdminConfigResponse>('/admin/api/config')
const res = await adminFetch<AdminConfigResponse>('/admin/api/config')
if (requestId !== this.reqId) return
this.data = res
this.error = ''
} catch (err) {
if (requestId !== this.reqId) return
if (isAuthRejection(err)) return
this.error = messageOf(err)
} finally {
this.loading = false
if (requestId === this.reqId) this.loading = false
}
},
/** ensureConfig fetches only when there is no data yet — ConfigPage.vue's own onMounted call. */