From 5c856460a628eeb416dc4c6ff4a99098c5f702c5 Mon Sep 17 00:00:00 2001 From: Gemini Wen Date: Sun, 1 Mar 2026 23:21:45 +0800 Subject: [PATCH] fix(dashboard): sort recent usage tooltip labels by token consumption --- frontend/src/views/admin/DashboardView.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/src/views/admin/DashboardView.vue b/frontend/src/views/admin/DashboardView.vue index d27e9387..d4f1fbb0 100644 --- a/frontend/src/views/admin/DashboardView.vue +++ b/frontend/src/views/admin/DashboardView.vue @@ -366,6 +366,11 @@ const lineOptions = computed(() => ({ } }, tooltip: { + itemSort: (a: any, b: any) => { + const aValue = typeof a?.raw === 'number' ? a.raw : Number(a?.parsed?.y ?? 0) + const bValue = typeof b?.raw === 'number' ? b.raw : Number(b?.parsed?.y ?? 0) + return bValue - aValue + }, callbacks: { label: (context: any) => { return `${context.dataset.label}: ${formatTokens(context.raw)}`