From 22a67a136f0805416f28b2356f23aefe12d532ae Mon Sep 17 00:00:00 2001 From: tbphp Date: Sat, 12 Jul 2025 15:52:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=86=E7=BB=84=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/api/keys.ts | 15 +-- web/src/components/keys/GroupInfoCard.vue | 116 ++++++++++++++++------ web/src/types/models.ts | 23 ++++- 3 files changed, 109 insertions(+), 45 deletions(-) diff --git a/web/src/api/keys.ts b/web/src/api/keys.ts index 85c5e79..03ac60d 100644 --- a/web/src/api/keys.ts +++ b/web/src/api/keys.ts @@ -2,7 +2,7 @@ import type { APIKey, Group, GroupConfigOption, - GroupStats, + GroupStatsResponse, KeyStatus, TaskInfo, } from "@/types/models"; @@ -33,16 +33,9 @@ export const keysApi = { }, // 获取分组统计信息 - async getGroupStats(): Promise { - await new Promise(resolve => setTimeout(resolve, 200)); - return { - total_keys: 0, - active_keys: 0, - requests_1h: 0, - requests_24h: 0, - requests_7d: 0, - failure_rate_24h: 0, - } as GroupStats; + async getGroupStats(groupId: number): Promise { + const res = await http.get(`/groups/${groupId}/stats`); + return res.data; }, // 获取分组可配置参数 diff --git a/web/src/components/keys/GroupInfoCard.vue b/web/src/components/keys/GroupInfoCard.vue index 13eb1d1..a820b6a 100644 --- a/web/src/components/keys/GroupInfoCard.vue +++ b/web/src/components/keys/GroupInfoCard.vue @@ -1,6 +1,6 @@