mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
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:
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user