From c1c7a43191a1659b332e121075f090343663c85a Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Thu, 24 Jul 2025 16:53:35 +0800 Subject: [PATCH] add model auth --- .../add-credential-in-load-balancing.tsx | 39 ++++++++++ .../model-auth/add-model.tsx | 76 +++++++++++++++++++ .../model-provider-page/model-auth/index.tsx | 0 .../switch-credential-in-load-balancing.tsx | 47 ++++++++++++ 4 files changed, 162 insertions(+) create mode 100644 web/app/components/header/account-setting/model-provider-page/model-auth/add-credential-in-load-balancing.tsx create mode 100644 web/app/components/header/account-setting/model-provider-page/model-auth/add-model.tsx create mode 100644 web/app/components/header/account-setting/model-provider-page/model-auth/index.tsx create mode 100644 web/app/components/header/account-setting/model-provider-page/model-auth/switch-credential-in-load-balancing.tsx diff --git a/web/app/components/header/account-setting/model-provider-page/model-auth/add-credential-in-load-balancing.tsx b/web/app/components/header/account-setting/model-provider-page/model-auth/add-credential-in-load-balancing.tsx new file mode 100644 index 0000000000..b913f7284d --- /dev/null +++ b/web/app/components/header/account-setting/model-provider-page/model-auth/add-credential-in-load-balancing.tsx @@ -0,0 +1,39 @@ +import { + memo, + useCallback, +} from 'react' +import { RiAddLine } from '@remixicon/react' +import { + AuthCategory, + Authorized, +} from '@/app/components/plugins/plugin-auth' +import cn from '@/utils/classnames' + +const AddCredentialInLoadBalancing = () => { + const renderTrigger = useCallback((open?: boolean) => { + return ( +
+ + Add credential +
+ ) + }, []) + + return ( + + ) +} + +export default memo(AddCredentialInLoadBalancing) diff --git a/web/app/components/header/account-setting/model-provider-page/model-auth/add-model.tsx b/web/app/components/header/account-setting/model-provider-page/model-auth/add-model.tsx new file mode 100644 index 0000000000..fcd4272a27 --- /dev/null +++ b/web/app/components/header/account-setting/model-provider-page/model-auth/add-model.tsx @@ -0,0 +1,76 @@ +import { + memo, + useState, +} from 'react' +import { useTranslation } from 'react-i18next' +import { + RiAddCircleFill, + RiAddLine, +} from '@remixicon/react' +import { + PortalToFollowElem, + PortalToFollowElemContent, + PortalToFollowElemTrigger, +} from '@/app/components/base/portal-to-follow-elem' +import Button from '@/app/components/base/button' +import Tooltip from '@/app/components/base/tooltip' + +const AddModel = () => { + const { t } = useTranslation() + const [open, setOpen] = useState(false) + + return ( + + + + + +
+
+
+
+
+ chat-finetune-01 +
+ + + +
+
+
+ + {t('common.modelProvider.addModel')} +
+
+
+
+ ) +} + +export default memo(AddModel) diff --git a/web/app/components/header/account-setting/model-provider-page/model-auth/index.tsx b/web/app/components/header/account-setting/model-provider-page/model-auth/index.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/web/app/components/header/account-setting/model-provider-page/model-auth/switch-credential-in-load-balancing.tsx b/web/app/components/header/account-setting/model-provider-page/model-auth/switch-credential-in-load-balancing.tsx new file mode 100644 index 0000000000..bb5b8bd62e --- /dev/null +++ b/web/app/components/header/account-setting/model-provider-page/model-auth/switch-credential-in-load-balancing.tsx @@ -0,0 +1,47 @@ +import { + memo, + useCallback, +} from 'react' +import { RiArrowDownSLine } from '@remixicon/react' +import Button from '@/app/components/base/button' +import { + AuthCategory, + Authorized, +} from '@/app/components/plugins/plugin-auth' +import Indicator from '@/app/components/header/indicator' +import Badge from '@/app/components/base/badge' + +const SwitchCredentialInLoadBalancing = () => { + const renderTrigger = useCallback(() => { + return ( + + ) + }, []) + + return ( + + ) +} + +export default memo(SwitchCredentialInLoadBalancing)