From d45ce48932941f696b2c984cd8aafe5db768d791 Mon Sep 17 00:00:00 2001 From: twwu Date: Fri, 22 Nov 2024 11:02:45 +0800 Subject: [PATCH 1/3] fix: update theme imports in globals.css --- web/app/styles/globals.css | 4 ++-- web/themes/{other-dark.css => manual-dark.css} | 0 web/themes/{other-light.css => manual-light.css} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename web/themes/{other-dark.css => manual-dark.css} (100%) rename web/themes/{other-light.css => manual-light.css} (100%) diff --git a/web/app/styles/globals.css b/web/app/styles/globals.css index 8b74c07afd..9db035a28c 100644 --- a/web/app/styles/globals.css +++ b/web/app/styles/globals.css @@ -4,8 +4,8 @@ @import "../../themes/light.css"; @import "../../themes/dark.css"; -@import "../../themes/other-light.css"; -@import "../../themes/other-dark.css"; +@import "../../themes/manual-light.css"; +@import "../../themes/manual-dark.css"; html[data-changing-theme] * { transition: none !important; diff --git a/web/themes/other-dark.css b/web/themes/manual-dark.css similarity index 100% rename from web/themes/other-dark.css rename to web/themes/manual-dark.css diff --git a/web/themes/other-light.css b/web/themes/manual-light.css similarity index 100% rename from web/themes/other-light.css rename to web/themes/manual-light.css From c768f8fdd16350f3c80bfc1ec9687d8d7cf9e895 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Fri, 22 Nov 2024 11:41:18 +0800 Subject: [PATCH 2/3] fix: path of tool provider --- .../agent/agent-tools/setting-built-in-tool.tsx | 16 ++++++++++++++-- .../plugins/plugin-detail-panel/action-list.tsx | 8 +++++--- web/app/components/plugins/types.ts | 6 +++--- web/i18n/en-US/tools.ts | 1 + web/i18n/zh-Hans/tools.ts | 1 + 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx b/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx index ed4a87b3cb..f9a2d5e003 100644 --- a/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx +++ b/web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx @@ -25,7 +25,7 @@ import I18n from '@/context/i18n' import { getLanguage } from '@/i18n/language' import cn from '@/utils/classnames' -interface Props { +type Props = { showBackButton?: boolean collection: Collection isBuiltIn?: boolean @@ -106,6 +106,16 @@ const SettingBuiltInTool: FC = ({ return valid })() + const getType = (type: string) => { + if (type === 'number-input') + return t('tools.setBuiltInTools.number') + if (type === 'text-input') + return t('tools.setBuiltInTools.string') + if (type === 'file') + return t('tools.setBuiltInTools.file') + return type + } + const infoUI = (
{infoSchemas.length > 0 && ( @@ -114,7 +124,9 @@ const SettingBuiltInTool: FC = ({
{item.label[language]}
-
{item.type === 'number-input' ? t('tools.setBuiltInTools.number') : t('tools.setBuiltInTools.string')}
+
+ {getType(item.type)} +
{item.required && (
{t('tools.setBuiltInTools.required')}
)} diff --git a/web/app/components/plugins/plugin-detail-panel/action-list.tsx b/web/app/components/plugins/plugin-detail-panel/action-list.tsx index 2d440c2702..334587ce31 100644 --- a/web/app/components/plugins/plugin-detail-panel/action-list.tsx +++ b/web/app/components/plugins/plugin-detail-panel/action-list.tsx @@ -24,14 +24,16 @@ const ActionList = ({ }: Props) => { const { t } = useTranslation() const { isCurrentWorkspaceManager } = useAppContext() - const { data: provider } = useBuiltinProviderInfo(`${detail.plugin_id}/${detail.name}`) + const providerBriefInfo = detail.declaration.tool.identity + const providerKey = `${detail.plugin_id}/${providerBriefInfo.name}` + const { data: provider } = useBuiltinProviderInfo(providerKey) const invalidateProviderInfo = useInvalidateBuiltinProviderInfo() - const { data } = useBuiltinTools(`${detail.plugin_id}/${detail.name}`) + const { data } = useBuiltinTools(providerKey) const [showSettingAuth, setShowSettingAuth] = useState(false) const handleCredentialSettingUpdate = () => { - invalidateProviderInfo(`${detail.plugin_id}/${detail.name}`) + invalidateProviderInfo(providerKey) Toast.notify({ type: 'success', message: t('common.api.actionSuccess'), diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts index b300b6b6e4..04d508c20d 100644 --- a/web/app/components/plugins/types.ts +++ b/web/app/components/plugins/types.ts @@ -3,9 +3,9 @@ import type { ToolCredential } from '@/app/components/tools/types' import type { Locale } from '@/i18n' export enum PluginType { - tool = 'tools', - model = 'models', - extension = 'endpoints', + tool = 'tool', + model = 'model', + extension = 'endpoint', } export enum PluginSource { diff --git a/web/i18n/en-US/tools.ts b/web/i18n/en-US/tools.ts index 6bc11fdd2c..df1e7aaed7 100644 --- a/web/i18n/en-US/tools.ts +++ b/web/i18n/en-US/tools.ts @@ -129,6 +129,7 @@ const translation = { parameters: 'parameters', string: 'string', number: 'number', + file: 'file', required: 'Required', infoAndSetting: 'Info & Settings', }, diff --git a/web/i18n/zh-Hans/tools.ts b/web/i18n/zh-Hans/tools.ts index 1da5430c37..4599ece03f 100644 --- a/web/i18n/zh-Hans/tools.ts +++ b/web/i18n/zh-Hans/tools.ts @@ -129,6 +129,7 @@ const translation = { parameters: '参数', string: '字符串', number: '数字', + file: '文件', required: '必填', infoAndSetting: '信息和设置', }, From 506e5e0bc8504247813531a9e581287a3e3fab63 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Fri, 22 Nov 2024 14:53:20 +0800 Subject: [PATCH 3/3] fix: plugin type --- web/app/components/plugins/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts index 04d508c20d..5de8a6d2df 100644 --- a/web/app/components/plugins/types.ts +++ b/web/app/components/plugins/types.ts @@ -5,7 +5,7 @@ import type { Locale } from '@/i18n' export enum PluginType { tool = 'tool', model = 'model', - extension = 'endpoint', + extension = 'extension', } export enum PluginSource {