"backend/internal/server/vscode:/vscode.git/clone" did not exist on "49a3c43741be43a84147075f1d9f1e0a7500d84b"
Commit 5c856460 authored by Gemini Wen's avatar Gemini Wen
Browse files

fix(dashboard): sort recent usage tooltip labels by token consumption

parent dd8df483
......@@ -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)}`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment