feat(usage): add group usage distribution chart alongside model distribution

- Add GroupStat type to usagestats package
- Add GetGroupStatsWithFilters to UsageLogRepository interface and implement with LEFT JOIN groups
- Add GetGroupStats dashboard API endpoint (GET /admin/dashboard/groups)
- Add GroupDistributionChart.vue component mirroring ModelDistributionChart
- Rearrange UsageView layout: model + group in one row, token trend full-width below
- All filters (user, api_key, account, group, model, date range) apply to group stats
This commit is contained in:
erio
2026-03-01 19:49:01 +08:00
parent 47f7b0213b
commit 7c5746ffbc
14 changed files with 363 additions and 6 deletions

View File

@@ -1072,6 +1072,15 @@ export interface ModelStat {
actual_cost: number // 实际扣除
}
export interface GroupStat {
group_id: number
group_name: string
requests: number
total_tokens: number
cost: number // 标准计费
actual_cost: number // 实际扣除
}
export interface UserUsageTrendPoint {
date: string
user_id: number