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。 -