From 653b78595834762b019bc8b29ad845bb5e7cdaa0 Mon Sep 17 00:00:00 2001 From: chanx <1243304602@qq.com> Date: Fri, 21 Nov 2025 09:33:50 +0800 Subject: [PATCH] Fix: Modify the style of the user center #10703 (#11419) ### What problem does this PR solve? Fix: Modify the style of the user center ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- web/src/components/back-button/index.tsx | 5 +- web/src/components/confirm-delete-dialog.tsx | 3 +- web/src/components/dynamic-form.tsx | 20 +- web/src/components/edit-tag/index.tsx | 4 +- web/src/components/file-uploader.tsx | 12 +- .../components/originui/password-input.tsx | 14 - .../originui/select-with-search.tsx | 20 +- web/src/components/ui/command.tsx | 12 +- web/src/components/ui/input.tsx | 9 +- web/src/components/ui/modal/modal.tsx | 23 +- web/src/components/ui/multi-select.tsx | 8 +- web/src/components/ui/select.tsx | 4 +- web/src/components/ui/textarea.tsx | 2 +- web/src/components/ui/tooltip.tsx | 4 +- web/src/hooks/common-hooks.tsx | 30 +- web/src/locales/en.ts | 2 + web/src/locales/zh.ts | 2 + web/src/pages/dataset/sidebar/index.tsx | 2 +- .../data-source/add-datasource-modal.tsx | 1 + .../data-source/component/dynamic-form.tsx | 725 ------------------ .../user-setting/data-source/contant.tsx | 95 --- .../data-source-detail-page/index.tsx | 6 +- .../user-setting/mcp/edit-mcp-dialog.tsx | 2 +- web/src/pages/user-setting/mcp/index.tsx | 2 +- .../setting-model/components/un-add-model.tsx | 4 +- .../user-setting/setting-team/user-table.tsx | 4 +- web/src/pages/user-setting/sidebar/index.tsx | 4 +- 27 files changed, 122 insertions(+), 897 deletions(-) delete mode 100644 web/src/pages/user-setting/data-source/component/dynamic-form.tsx diff --git a/web/src/components/back-button/index.tsx b/web/src/components/back-button/index.tsx index c790d6882..118042128 100644 --- a/web/src/components/back-button/index.tsx +++ b/web/src/components/back-button/index.tsx @@ -29,7 +29,10 @@ const BackButton: React.FC = ({ return ( diff --git a/web/src/components/edit-tag/index.tsx b/web/src/components/edit-tag/index.tsx index 1921853d0..a05fadad6 100644 --- a/web/src/components/edit-tag/index.tsx +++ b/web/src/components/edit-tag/index.tsx @@ -102,8 +102,8 @@ const EditTag = React.forwardRef( {Array.isArray(tagChild) && tagChild.length > 0 && <>{tagChild}} {!inputVisible && ( ); diff --git a/web/src/components/originui/select-with-search.tsx b/web/src/components/originui/select-with-search.tsx index 2d095f157..e3cec6240 100644 --- a/web/src/components/originui/select-with-search.tsx +++ b/web/src/components/originui/select-with-search.tsx @@ -140,7 +140,7 @@ export const SelectWithSearch = forwardRef< ref={ref} disabled={disabled} className={cn( - '!bg-bg-input hover:bg-background border-border-button w-full justify-between px-3 font-normal outline-offset-0 outline-none focus-visible:outline-[3px] [&_svg]:pointer-events-auto', + '!bg-bg-input hover:bg-background border-border-button w-full justify-between px-3 font-normal outline-offset-0 outline-none focus-visible:outline-[3px] [&_svg]:pointer-events-auto group', triggerClassName, )} > @@ -155,12 +155,12 @@ export const SelectWithSearch = forwardRef< {value && allowClear && ( <> )} @@ -173,12 +173,17 @@ export const SelectWithSearch = forwardRef< - - - + + {options && options.length > 0 && ( + + )} + {t('common.noDataFound')} {options.map((group, idx) => { if (group.options) { @@ -209,6 +214,7 @@ export const SelectWithSearch = forwardRef< value={group.value} disabled={group.disabled} onSelect={handleSelect} + className="min-h-10" > {group.label} diff --git a/web/src/components/ui/command.tsx b/web/src/components/ui/command.tsx index 10caef77d..b96c82ba2 100644 --- a/web/src/components/ui/command.tsx +++ b/web/src/components/ui/command.tsx @@ -39,7 +39,10 @@ const CommandInput = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( -
+
e.stopPropagation()} onMouseEnter={(e) => e.currentTarget.focus()} tabIndex={-1} @@ -96,7 +102,7 @@ const CommandGroup = React.forwardRef< , 'prefix'> { @@ -50,6 +49,8 @@ const Input = React.forwardRef( 'pr-12': !!suffix || isPasswordInput, 'pr-24': !!suffix && isPasswordInput, }, + type === 'number' && + '[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none', className, )} value={inputValue ?? ''} @@ -77,10 +78,10 @@ const Input = React.forwardRef( )} {isPasswordInput && ( - + )}
); diff --git a/web/src/components/ui/modal/modal.tsx b/web/src/components/ui/modal/modal.tsx index af516b1e6..c40e5f90b 100644 --- a/web/src/components/ui/modal/modal.tsx +++ b/web/src/components/ui/modal/modal.tsx @@ -27,7 +27,10 @@ export interface ModalProps { okText?: ReactNode | string; onOk?: () => void; onCancel?: () => void; + okButtonClassName?: string; + cancelButtonClassName?: string; disabled?: boolean; + style?: React.CSSProperties; } export interface ModalType extends FC { show: typeof modalIns.show; @@ -56,7 +59,10 @@ const Modal: ModalType = ({ confirmLoading, cancelText, okText, + okButtonClassName, + cancelButtonClassName, disabled = false, + style, }) => { const sizeClasses = { small: 'max-w-md', @@ -111,7 +117,10 @@ const Modal: ModalType = ({ @@ -122,6 +131,7 @@ const Modal: ModalType = ({ className={cn( 'px-2 py-1 bg-primary text-primary-foreground rounded-md hover:bg-primary/90', { 'cursor-not-allowed': disabled }, + okButtonClassName, )} > {confirmLoading && ( @@ -153,23 +163,26 @@ const Modal: ModalType = ({ handleOk, showfooter, footerClassName, + okButtonClassName, + cancelButtonClassName, ]); return ( maskClosable && onOpenChange?.(false)} > e.stopPropagation()} > {/* title */} {(title || closable) && (