From 246a7df57dc94721e5ce09797c1174e6b7d6326f Mon Sep 17 00:00:00 2001 From: shy3130 <415333856@qq.com> Date: Sun, 30 Aug 2026 19:05:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor(ui):=20=E6=A3=80=E6=B5=8B=E6=A1=A3?= =?UTF-8?q?=E4=BD=8D=E9=9B=86=E7=BE=A4=E7=A7=BB=E8=87=B3=20API=20Key=20?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E8=A1=8C=E5=8F=B3=E4=BE=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 档位徽章/说明/重检测/可用功能悬停图标从卡片头部移到 「TickFlow API Key」标题行右侧 (档位由 Key 检测得出, 语义归位) - 卡片头部只留 第三方/已适配全档位/服务中 徽章 - 可用功能浮层锚点改右对齐, 向左展开不越入能力表栏 --- frontend/src/pages/settings/DataSources.tsx | 105 ++++++++++---------- frontend/src/pages/settings/Keys.tsx | 4 +- 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/frontend/src/pages/settings/DataSources.tsx b/frontend/src/pages/settings/DataSources.tsx index 17c8afa..a90be42 100644 --- a/frontend/src/pages/settings/DataSources.tsx +++ b/frontend/src/pages/settings/DataSources.tsx @@ -1082,7 +1082,7 @@ function PluginDetail({ plugin, isActive, matrixCaps, servingSet, onSwitch, swit } /** TickFlow 详情: 介绍 + 能力档位表 + Key/可用功能左右两栏。 - * 检测档位不再单独设面板 — 以头部「档位徽章 + ? 说明 + 重新检测」小集群呈现。 */ + * 检测档位集群 (档位徽章 + ? 说明 + 重新检测 + 可用功能悬停) 挂在 API Key 标题行右侧。 */ function TickFlowDetail({ active, matrix }: { active: boolean; matrix?: CapabilityMatrix }) { const caps = matrix?.capabilities ?? [] const tier = matrix?.tickflow_tier @@ -1093,6 +1093,57 @@ function TickFlowDetail({ active, matrix }: { active: boolean; matrix?: Capabili mutationFn: () => api.redetectCapabilities(), onSuccess: () => invalidate(), }) + // 检测档位集群: API Key 标题行右侧 (检测档位徽章 + 档位说明 + 重检测 + 可用功能悬停) + const tierCluster = tier ? ( +
+ 检测档位 + + + + {/* 可用功能: 收进悬停浮层, 不占版面 (能力清单 + 限频)。图标在标题行右侧, 浮层向左展开 */} +
+ + + +
+
+ 可用功能 + {capEntries.length} 项 +
+ {capEntries.length > 0 ? ( +
+ {capEntries.map(([cap, lim]) => ( +
+ + {CAP_LABELS[cap]?.name ?? cap} + + + {lim.rpm ? `${lim.rpm}/min` : lim.subscribe ? `${lim.subscribe} 订阅` : '—'} + {lim.batch ? ` · ${lim.batch}/次` : ''} + +
+ ))} +
+ ) : ( +
+ 暂无 — 配置 API Key 后自动检测 +
+ )} +
+ 根据 API Key 自动检测 +
+
+
+
+ ) : null return (
{/* 介绍 */} @@ -1104,56 +1155,6 @@ function TickFlowDetail({ active, matrix }: { active: boolean; matrix?: Capabili

TickFlow

第三方 - {tier && ( - <> - 检测档位 - - - - {/* 可用功能: 收进悬停浮层, 不占版面 (能力清单 + 限频) */} -
- - - -
-
- 可用功能 - {capEntries.length} 项 -
- {capEntries.length > 0 ? ( -
- {capEntries.map(([cap, lim]) => ( -
- - {CAP_LABELS[cap]?.name ?? cap} - - - {lim.rpm ? `${lim.rpm}/min` : lim.subscribe ? `${lim.subscribe} 订阅` : '—'} - {lim.batch ? ` · ${lim.batch}/次` : ''} - -
- ))} -
- ) : ( -
- 暂无 — 配置 API Key 后自动检测 -
- )} -
- 根据 API Key 自动检测 -
-
-
- - )} {active && ( @@ -1171,7 +1172,7 @@ function TickFlowDetail({ active, matrix }: { active: boolean; matrix?: Capabili {/* 主体: API Key 配置 (左) | 能力档位表 (右) */}
- +
{/* 能力档位表: 各能力所需档位 + 当前档位可用性 */} diff --git a/frontend/src/pages/settings/Keys.tsx b/frontend/src/pages/settings/Keys.tsx index d8bb5ba..f390d9a 100644 --- a/frontend/src/pages/settings/Keys.tsx +++ b/frontend/src/pages/settings/Keys.tsx @@ -56,7 +56,7 @@ export function useInvalidateTierRelated() { } /** API Key 配置区块: 状态 + 输入 + 保存并检测 (先探后存) */ -export function TickFlowKeySection() { +export function TickFlowKeySection({ right }: { right?: React.ReactNode }) { const settings = useSettings() const invalidate = useInvalidateTierRelated() @@ -93,7 +93,7 @@ export function TickFlowKeySection() { return (
- +

在{' '}