fix: align usage analytics with Hermes state db (#350)
This commit is contained in:
@@ -23,10 +23,10 @@ export const useUsageStore = defineStore('usage', () => {
|
||||
const stats = ref<UsageStatsResponse | null>(null)
|
||||
const isLoading = ref(false)
|
||||
|
||||
async function loadSessions() {
|
||||
async function loadSessions(days = 30) {
|
||||
isLoading.value = true
|
||||
try {
|
||||
stats.value = await fetchUsageStats()
|
||||
stats.value = await fetchUsageStats(days)
|
||||
} catch (err) {
|
||||
console.error('Failed to load usage stats:', err)
|
||||
} finally {
|
||||
@@ -54,7 +54,7 @@ export const useUsageStore = defineStore('usage', () => {
|
||||
const modelUsage = computed<ModelUsage[]>(() => {
|
||||
if (!stats.value) return []
|
||||
return stats.value.model_usage.map(m => ({
|
||||
model: m.model,
|
||||
model: m.model || 'unknown',
|
||||
inputTokens: m.input_tokens,
|
||||
outputTokens: m.output_tokens,
|
||||
cacheTokens: m.cache_read_tokens,
|
||||
|
||||
Reference in New Issue
Block a user