mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-04-09 17:44:46 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user