fix(admin-ui): clear data on key change and show empty Spend chart

A new API key kept the previous key's data on screen until each store refreshed. All data stores now reset when the key changes. The Spend breakdown chart showed a column of identical zero ticks for an empty range, so it now shows an empty message. A stray quote in the Reliability page markup is removed.
This commit is contained in:
2026-11-08 02:32:09 +00:00
parent 0a05dfc035
commit 8c5e4fbcda
6 changed files with 155 additions and 63 deletions
+24
View File
@@ -0,0 +1,24 @@
import { useCatalogStore } from '@/stores/catalog'
import { useConfigStore } from '@/stores/config'
import { useConsumersStore } from '@/stores/consumers'
import { useDashboardStore } from '@/stores/dashboard'
import { useEventsStore } from '@/stores/events'
import { useModelsStore } from '@/stores/models'
import { useReliabilityStore } from '@/stores/reliability'
import { useSpendStore } from '@/stores/spend'
/** resetSessionData drops every store that holds admin API data, so a different key never shows the previous key's numbers. Filters, nav and toasts are UI state and stay. */
export function resetSessionData(): void {
for (const store of [
useCatalogStore(),
useConfigStore(),
useConsumersStore(),
useDashboardStore(),
useEventsStore(),
useModelsStore(),
useReliabilityStore(),
useSpendStore(),
]) {
store.$reset()
}
}