feat(usage): normalize provider stats across usage and cost views

This commit is contained in:
zhefox
2026-05-23 22:22:37 +08:00
parent 91cb2bbbcc
commit 9f6fac418e
4 changed files with 104 additions and 29 deletions
+2 -1
View File
@@ -111,6 +111,7 @@ import { adminApi, type CostForecastResponse, type CostSavingsResponse, type Lea
import { usageApi } from '@/api/usage'
import { formatCurrency, formatTokens } from '@/utils/format'
import { getDateRangeFromPeriod } from '@/features/usage/composables'
import { normalizeUsageProviderStats } from '@/features/usage/utils/providerStats'
import type { DateRangeParams } from '@/features/usage/types'
import type { ProviderStatsItem } from '@/features/usage/types'
@@ -196,7 +197,7 @@ async function loadProviderStats() {
limit: 8
})
if (requestId !== providerStatsRequestId) return
providerStats.value = stats
providerStats.value = normalizeUsageProviderStats(stats)
}
async function loadApiKeyLeaderboard() {