From e31a35230fb216b15ed535ce4bd0f4f83c72d5c5 Mon Sep 17 00:00:00 2001 From: SengokuCola <1026294844@qq.com> Date: Wed, 6 May 2026 18:34:56 +0800 Subject: [PATCH] =?UTF-8?q?perf=EF=BC=9A=E5=A2=9E=E5=8A=A0=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E5=92=8C=E4=BC=98=E5=8C=96=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/dynamic-form/DynamicField.tsx | 70 +- .../config/bot/hooks/complexFieldHooks.tsx | 3 - dashboard/src/types/config-schema.ts | 2 + src/config/official_configs.py | 1238 +++++++++++++++-- 4 files changed, 1204 insertions(+), 109 deletions(-) diff --git a/dashboard/src/components/dynamic-form/DynamicField.tsx b/dashboard/src/components/dynamic-form/DynamicField.tsx index 2046717f..0e6156fc 100644 --- a/dashboard/src/components/dynamic-form/DynamicField.tsx +++ b/dashboard/src/components/dynamic-form/DynamicField.tsx @@ -127,22 +127,66 @@ export const DynamicField: React.FC = ({ const optionDescriptions = schema['x-option-descriptions'] ?? {} const hasOptionDescriptions = Object.keys(optionDescriptions).length > 0 - const inlineDescription = hasOptionDescriptions ? '' : schema.description + const descriptionDisplay = schema['x-description-display'] ?? 'label-hover' + const fieldDescription = schema.description + const inlineDescription = descriptionDisplay === 'inline' && !hasOptionDescriptions ? fieldDescription : '' + + const renderDescriptionTooltip = (trigger: React.ReactElement, side: 'top' | 'right' = 'top') => { + if (!fieldDescription) return trigger + + return ( + + + + {trigger} + + + {fieldDescription} + + + + ) + } const renderFieldHeader = () => (
- + {(() => { + const label = ( + + ) + + return descriptionDisplay === 'label-hover' + ? renderDescriptionTooltip(label) + : label + })()} + {descriptionDisplay === 'icon' && fieldDescription && ( + renderDescriptionTooltip( + , + 'right', + ) + )} {inlineDescription && ( {inlineDescription} diff --git a/dashboard/src/routes/config/bot/hooks/complexFieldHooks.tsx b/dashboard/src/routes/config/bot/hooks/complexFieldHooks.tsx index 087a51fa..b785c1f1 100644 --- a/dashboard/src/routes/config/bot/hooks/complexFieldHooks.tsx +++ b/dashboard/src/routes/config/bot/hooks/complexFieldHooks.tsx @@ -332,9 +332,6 @@ export const BotPlatformAccountsHook: FieldHookComponent = ({
-

- 第一行为主平台,固定保存到 platform 与 qq_account;其他行保存到 platforms。 -