From 35a66ffe9f8ce1128a3ab8d1df383e17a81948a3 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Sun, 27 Oct 2024 11:11:59 +0800 Subject: [PATCH] tool actions --- web/app/components/tools/provider/detail.tsx | 83 +++++++++++++------- 1 file changed, 54 insertions(+), 29 deletions(-) diff --git a/web/app/components/tools/provider/detail.tsx b/web/app/components/tools/provider/detail.tsx index fef3becb8c..8c9f70966b 100644 --- a/web/app/components/tools/provider/detail.tsx +++ b/web/app/components/tools/provider/detail.tsx @@ -45,7 +45,7 @@ import { ConfigurationMethodEnum } from '@/app/components/header/account-setting import Loading from '@/app/components/base/loading' import { useAppContext } from '@/context/app-context' -type Props = { +interface Props { collection: Collection onHide: () => void onRefreshData: () => void @@ -234,7 +234,7 @@ const ProviderDetail = ({ panelClassname={cn('justify-start mt-[64px] mr-2 mb-2 !w-[420px] !max-w-[420px] !p-0 !bg-components-panel-bg rounded-2xl border-[0.5px] border-components-panel-border shadow-xl')} >
-
+
@@ -255,24 +255,10 @@ const ProviderDetail = ({
- + {!!collection.description[language] && ( + + )}
- {(collection.type === CollectionType.builtIn) && needAuth && ( - - )} {collection.type === CollectionType.custom && !isDetailLoading && ( +
+ )} + {!isDetailLoading && (collection.type === CollectionType.builtIn) && needAuth && !isAuthed && ( + <> +
+ {t('tools.includeToolNum', { num: toolList.length }).toLocaleUpperCase()} + · + {t('tools.auth.setup').toLocaleUpperCase()} +
+ + + )} + {/* Custom type */} + {!isDetailLoading && (collection.type === CollectionType.custom) && (
- {collection.type === CollectionType.workflow && {t('tools.createTool.toolInput.title').toLocaleUpperCase()}} - {collection.type !== CollectionType.workflow && {t('tools.includeToolNum', { num: toolList.length }).toLocaleUpperCase()}} - {needAuth && (isBuiltIn || isModel) && !isAuthed && ( - <> - · - {t('tools.auth.setup').toLocaleUpperCase()} - - )} + {t('tools.includeToolNum', { num: toolList.length }).toLocaleUpperCase()} +
+ )} + {/* Workflow type */} + {!isDetailLoading && (collection.type === CollectionType.workflow) && ( +
+ {t('tools.createTool.toolInput.title').toLocaleUpperCase()}
)} {!isDetailLoading && ( @@ -323,7 +347,8 @@ const ProviderDetail = ({ {collection.type !== CollectionType.workflow && toolList.map(tool => (