From 4cc6dfa2329d4babf38e4f3d8091d556d304068b Mon Sep 17 00:00:00 2001 From: JzoNg Date: Fri, 11 Oct 2024 13:55:09 +0800 Subject: [PATCH] new style of provider card --- .../header/account-setting/model-provider-page/index.tsx | 2 +- .../provider-added-card/credential-panel.tsx | 6 +++--- .../model-provider-page/provider-added-card/index.tsx | 9 +++++---- .../provider-added-card/model-list.tsx | 9 ++++++--- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/web/app/components/header/account-setting/model-provider-page/index.tsx b/web/app/components/header/account-setting/model-provider-page/index.tsx index 744e8b8daa..84916fb05a 100644 --- a/web/app/components/header/account-setting/model-provider-page/index.tsx +++ b/web/app/components/header/account-setting/model-provider-page/index.tsx @@ -124,7 +124,7 @@ const ModelProviderPage = () => { )} {!!configuredProviders?.length && ( -
+
{configuredProviders?.map(provider => ( = ({
API-KEY - +
{ diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/index.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/index.tsx index 5e73b36c42..9cb3899235 100644 --- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/index.tsx +++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/index.tsx @@ -2,6 +2,7 @@ import type { FC } from 'react' import { useState } from 'react' import { useTranslation } from 'react-i18next' import { + RiArrowRightSLine, RiLoader2Line, } from '@remixicon/react' import type { @@ -21,7 +22,6 @@ import CredentialPanel from './credential-panel' import QuotaPanel from './quota-panel' import ModelList from './model-list' import AddModelButton from './add-model-button' -import { ChevronDownDouble } from '@/app/components/base/icons/src/vender/line/arrows' import { fetchModelProviderModelList } from '@/service/common' import { useEventEmitterContextContext } from '@/context/event-emitter' import { IS_CE_EDITION } from '@/config' @@ -116,23 +116,24 @@ const ProviderAddedCard: FC = ({ { collapsed && (
-
+
{ hasModelList ? t('common.modelProvider.modelsNum', { num: modelList.length }) : t('common.modelProvider.showModels') } + {!loading && }
- { hasModelList ? t('common.modelProvider.showModelsNum', { num: modelList.length }) : t('common.modelProvider.showModels') } + {!loading && } { loading && ( @@ -143,7 +144,7 @@ const ProviderAddedCard: FC = ({ configurationMethods.includes(ConfigurationMethodEnum.customizableModel) && isCurrentWorkspaceManager && ( onOpenModal(ConfigurationMethodEnum.customizableModel)} - className='hidden group-hover:flex group-hover:text-primary-600' + className='flex' /> ) } diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list.tsx index e321d4076d..709560b419 100644 --- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list.tsx +++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-list.tsx @@ -1,6 +1,9 @@ import type { FC } from 'react' import { useCallback } from 'react' import { useTranslation } from 'react-i18next' +import { + RiArrowRightSLine, +} from '@remixicon/react' import type { CustomConfigurationModelFixedFields, ModelItem, @@ -12,7 +15,6 @@ import { // import Tab from './tab' import AddModelButton from './add-model-button' import ModelListItem from './model-list-item' -import { ChevronDownDouble } from '@/app/components/base/icons/src/vender/line/arrows' import { useModalContextSelector } from '@/context/modal-context' import { useAppContext } from '@/context/app-context' @@ -53,13 +55,14 @@ const ModelList: FC = ({ {t('common.modelProvider.modelsNum', { num: models.length })} + onCollapse()} > - - {t('common.modelProvider.collapse')} + {t('common.modelProvider.modelsNum', { num: models.length })} + {/* {