372aba4d5e
ci: add manual Huawei SWR publish job
2026-06-16 10:41:55 +08:00
626b8928f4
fix oidc callback behind reverse proxy
2026-06-16 10:01:13 +08:00
9024f80a70
chore: split Coolify compose configuration
2026-06-08 13:30:18 +08:00
ad8fc7957e
chore: expose analytics service for Coolify
2026-06-08 13:26:12 +08:00
2e3dca87c7
fix: let Coolify provide runtime env
2026-06-08 11:19:50 +08:00
475b90781c
fix: avoid remote font fetch during build
2026-06-08 10:47:43 +08:00
8556286f2a
chore: use Huawei npm mirror in Docker build
2026-06-05 18:28:50 +08:00
d626a27663
fix: make docker npm install more reliable
2026-06-05 18:25:06 +08:00
20654d9756
feat: add optional OIDC authentication
2026-06-05 17:34:03 +08:00
09f752c8cf
Update production PostgreSQL connection
2026-06-03 22:50:27 +08:00
09d4c32402
Merge branch 'codex/api-analytics-hardening' into 'main'
...
Harden analytics dashboard
See merge request shangzy/new-api-analytics!3
2026-05-27 15:32:44 +08:00
f1a2641509
Merge remote-tracking branch 'origin/main' into codex/api-analytics-hardening
...
# Conflicts:
# README.md
# lib/queries.test.ts
# lib/queries.ts
2026-05-27 15:30:26 +08:00
356039d9cf
feat: harden analytics dashboard
2026-05-27 15:19:31 +08:00
79bc46e67b
Merge branch 'fix/logs-user-search' into 'main'
...
fix: support fuzzy logs user search
See merge request shangzy/new-api-analytics!2
2026-05-08 20:24:00 +08:00
b1539f3969
fix: support fuzzy logs user search
2026-05-08 20:20:24 +08:00
63eec82931
Merge branch 'feat/1' into 'main'
...
docs: add README smoke test note
Closes #1
See merge request shangzy/new-api-analytics!1
2026-05-08 19:18:34 +08:00
1cb7f08f86
docs: add smoke test note
2026-05-08 19:11:40 +08:00
5e0ca6a504
feat: add user token distribution tab
2026-05-08 17:35:05 +08:00
e44207901c
feat: add token breakdown helpers
2026-05-08 17:31:17 +08:00
20d8b61aa3
feat: add user token breakdown data
2026-05-08 17:27:59 +08:00
c5052e312a
chore: ignore local worktrees
2026-05-08 17:24:33 +08:00
baac251b7c
docs: add user token breakdown implementation plan
2026-05-08 17:15:45 +08:00
d5e57da93b
docs: add user token breakdown design
2026-05-08 17:00:22 +08:00
94b87dcc30
Show output tokens in detail stats
2026-04-28 13:55:08 +08:00
e8a66cf180
Add sorting to detail breakdown tables
2026-04-28 13:40:45 +08:00
ab915e9292
Add cost metrics to analytics dashboard
2026-04-28 11:27:51 +08:00
67e43b02bf
perf: 添加查询缓存层,避免重复解析 JSON(TTL 2 分钟)
2026-04-22 10:05:19 +08:00
52de6c5dc0
Edit Dockerfile
2026-04-20 20:09:23 +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
004cdd9fc9
Refine embedded portal homepage
2026-04-15 18:03:06 +08:00
c809ab16e6
fix: 修复排名页跳转用户详情数据为0的问题
...
排名页使用 display_name(中文名)作为链接参数,但详情查询用
username(英文)过滤,导致 SQL 匹配不到数据全部返回0。
- 排名 API 额外返回 username 字段
- 跳转链接改用 username 作为参数
- 详情 API 返回 display_name 用于页面标题展示
2026-04-08 20:08:08 +08:00
13805a47be
fix: refactor time range to single source of truth with correct dates
...
- Default range changed from 30d to 7d
- Presets (today/7d/30d) now directly set customStart/customEnd dates,
eliminating duplicate getTimeRange() calculation
- "All" preset fetches actual data boundaries from /api/date-range
and backfills the custom date picker
- Clicking "custom" opens popover without triggering data refresh;
only confirm applies changes
- SQL trend dates cast to ::text to avoid pg driver Date timezone offset
- Fix created_at filter from < to <= for end timestamp
2026-04-07 16:22:18 +08:00
35b8fec96c
fix: use toISOString for trend date serialization to prevent year 2001 bug
...
pg driver returns PostgreSQL date as JS Date object. String(date).slice(0,10)
produced "Mon Apr 07" instead of "2026-04-07", causing chart tooltips to
default to year 2001 when parsed by new Date().
2026-04-07 15:50:30 +08:00
918a615793
fix: locale toggle shows current language, date inputs respect locale
...
- Language switcher now displays current locale (中文/English) instead of target
- Add lang attribute to date inputs for proper localization of native date picker
2026-04-07 15:30:25 +08:00
c45e026ab3
fix: add explicit type annotations to setState callbacks in time-range-context
...
Fixes TypeScript strict mode error where callback parameters implicitly had 'any' type.
2026-04-07 15:26:15 +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
8b91aa3e97
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.
2026-04-07 15:09:23 +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
004fd37622
feat: replace favicon with fourth ai badge
2026-04-02 21:14:51 +08:00
6e55bc02b7
feat: support query theme bootstrap for embeds
2026-04-02 20:41:18 +08:00
83071a4b76
chore: update portal docs url
2026-04-02 20:14:45 +08:00
cc66034e59
feat: sync embedded analytics theme with parent app
2026-04-02 20:11:33 +08:00
1b5977a420
feat: add hidden /portal page for SinoCode iframe embedding
...
Full-screen landing page with glassmorphism cards linking to monitoring
(8018), docs (8017), and analytics (8019). Sidebar is conditionally
hidden on the portal route. Supports dark/light themes and i18n.
2026-04-02 19:30:32 +08:00
00e305241d
feat: add sortable columns to rankings table (calls/input/output/total token)
2026-04-02 17:04:03 +08:00
c2965faed3
fix: use node:20-alpine and add taobao npm registry mirror
2026-04-02 13:01:05 +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