ab915e9292
Add cost metrics to analytics dashboard
2026-04-28 11:27:51 +08:00
c5c91cc157
feat: 添加缓存 Token 独立展示(cache_creation / cache_read)
...
从 logs 表 other JSON 字段提取 cache_creation_tokens 和 cache_tokens,
在排名、日志、聚合、详情页分别展示,total_tokens 包含缓存部分。
2026-04-20 19:55:09 +08:00
c809ab16e6
fix: 修复排名页跳转用户详情数据为0的问题
...
排名页使用 display_name(中文名)作为链接参数,但详情查询用
username(英文)过滤,导致 SQL 匹配不到数据全部返回0。
- 排名 API 额外返回 username 字段
- 跳转链接改用 username 作为参数
- 详情 API 返回 display_name 用于页面标题展示
2026-04-08 20:08:08 +08:00
20a3d399d9
fix: resolve all eslint errors (set-state-in-effect, nested components, no-explicit-any)
...
- Wrap synchronous setState calls in useEffect with startTransition to avoid cascading renders
- Convert nested SortIcon components to renderSortIcon helper functions
- Replace all `any` types with proper interfaces (OverviewData, TrendPoint, RankItem)
- Remove unused formatTokens import in logs page
- Add no-any rule to CLAUDE.md
2026-04-07 15:19:10 +08:00
9bb36432ba
feat: global time range context with custom date picker
...
Lift time range state into a shared React context so the selected
range persists across page navigation and browser refreshes
(localStorage). Add a "Custom" option with a popover date picker
that lets users specify arbitrary start/end dates. All preset end
times now use endOf("day") (23:59:59) instead of the current moment.
2026-04-07 14:49:58 +08:00
00e305241d
feat: add sortable columns to rankings table (calls/input/output/total token)
2026-04-02 17:04:03 +08:00
b719b358f8
feat: API analytics dashboard with i18n and theme support
...
Next.js full-stack analytics dashboard for new-api.
- Direct PostgreSQL readonly queries on logs table
- 5 pages: Dashboard, Rankings, Aggregation, Logs, Detail
- Dark/Light/System theme with CSS variables
- Chinese/English i18n (default Chinese)
- Recharts with dual Y-axis for input/output tokens
- Lucide icons + Motion animations
- Docker + docker-compose with external sinobridge network, port 8019
2026-04-02 12:47:50 +08:00