feat: add output/input ratio column to aggregation page

Add a sortable "Out/In Ratio" (completion_tokens / prompt_tokens)
column with a portal-based tooltip explaining the metric. Fix
hydration mismatch by switching to useSyncExternalStore for
localStorage reads in TimeRangeProvider. Update CLAUDE.md with
project documentation.
This commit is contained in:
2026-04-07 15:09:23 +08:00
parent 9bb36432ba
commit 8b91aa3e97
4 changed files with 195 additions and 30 deletions

View File

@@ -68,6 +68,8 @@ const translations = {
"agg.userCount": "用户数",
"agg.totalCalls": "总调用",
"agg.totalToken": "总 Token",
"agg.ratio": "转换率",
"agg.ratioTip": "输出Token / 输入Token反映每次请求的生成效率。>1 表示输出多于输入(如生成、写作),<1 表示输入多于输出(如分析、摘要)",
// logs
"logs.title": "日志明细",
"logs.filterUser": "用户名",
@@ -148,6 +150,8 @@ const translations = {
"agg.userCount": "Users",
"agg.totalCalls": "Total Calls",
"agg.totalToken": "Total Token",
"agg.ratio": "Out/In Ratio",
"agg.ratioTip": "Completion tokens / Prompt tokens. >1 means more output than input (generation, writing); <1 means more input than output (analysis, summarization)",
"logs.title": "Log Details",
"logs.filterUser": "Username",
"logs.filterModel": "Model",