From 52553a66ba35fed526defa2b045028de2cf6e67a Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 9 Jan 2025 14:40:58 +0800 Subject: [PATCH 1/2] fix style of agent strategy --- .../plugins/plugin-detail-panel/agent-strategy-list.tsx | 9 ++++++++- .../plugins/plugin-detail-panel/strategy-detail.tsx | 6 ++++-- .../plugins/plugin-detail-panel/strategy-item.tsx | 1 + .../plugins/plugin-detail-panel/tool-selector/index.tsx | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/web/app/components/plugins/plugin-detail-panel/agent-strategy-list.tsx b/web/app/components/plugins/plugin-detail-panel/agent-strategy-list.tsx index 827a28a95e..fafcf1439c 100644 --- a/web/app/components/plugins/plugin-detail-panel/agent-strategy-list.tsx +++ b/web/app/components/plugins/plugin-detail-panel/agent-strategy-list.tsx @@ -18,6 +18,13 @@ const AgentStrategyList = ({ const providerKey = `${detail.plugin_id}/${providerBriefInfo.name}` const { data: strategyProviderDetail } = useStrategyProviderDetail(providerKey) + const providerDetail = useMemo(() => { + return { + ...strategyProviderDetail?.declaration.identity, + tenant_id: detail.tenant_id, + } + }, [detail.tenant_id, strategyProviderDetail?.declaration.identity]) + const strategyList = useMemo(() => { if (!strategyProviderDetail) return [] @@ -39,7 +46,7 @@ const AgentStrategyList = ({ {strategyList.map(strategyDetail => ( ))} diff --git a/web/app/components/plugins/plugin-detail-panel/strategy-detail.tsx b/web/app/components/plugins/plugin-detail-panel/strategy-detail.tsx index 2b58f620b1..a7f1d84071 100644 --- a/web/app/components/plugins/plugin-detail-panel/strategy-detail.tsx +++ b/web/app/components/plugins/plugin-detail-panel/strategy-detail.tsx @@ -16,6 +16,7 @@ import type { } from '@/app/components/plugins/types' import type { Locale } from '@/i18n' import { useRenderI18nObject } from '@/hooks/use-i18n' +import { API_PREFIX } from '@/config' import cn from '@/utils/classnames' type Props = { @@ -23,6 +24,7 @@ type Props = { author: string name: string description: Record + tenant_id: string icon: string label: Record tags: string[] @@ -94,7 +96,7 @@ const StrategyDetail: FC = ({ BACK
- +
{getValueFromI18nObject(provider.label)}
{getValueFromI18nObject(detail.identity.label)}
@@ -135,7 +137,7 @@ const StrategyDetail: FC = ({
OUTPUT
{outputSchema.length > 0 && ( -
+
{outputSchema.map((outputItem, index) => (
diff --git a/web/app/components/plugins/plugin-detail-panel/strategy-item.tsx b/web/app/components/plugins/plugin-detail-panel/strategy-item.tsx index 8cdb7315d8..fd2fea99e0 100644 --- a/web/app/components/plugins/plugin-detail-panel/strategy-item.tsx +++ b/web/app/components/plugins/plugin-detail-panel/strategy-item.tsx @@ -13,6 +13,7 @@ type Props = { author: string name: string description: Record + tenant_id: string icon: string label: Record tags: string[] diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx b/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx index e20673f7fa..d00b65f16d 100644 --- a/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx +++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx @@ -280,7 +280,7 @@ const ToolSelector: FC = ({ {currentProvider && currentProvider.type === CollectionType.builtIn && currentProvider.allow_delete && (
-
{t('plugin.detailPanel.toolSelector.auth')}
+
{t('plugin.detailPanel.toolSelector.auth')}
@@ -312,7 +312,7 @@ const ToolSelector: FC = ({ {currentToolParams.length > 0 && currentProvider?.is_team_authorization && (
-
{t('plugin.detailPanel.toolSelector.settings')}
+
{t('plugin.detailPanel.toolSelector.settings')}
From 38437efec048186e2de43c2bcf8a86baa0253bd3 Mon Sep 17 00:00:00 2001 From: Yi Date: Thu, 9 Jan 2025 14:47:08 +0800 Subject: [PATCH 2/2] fix: change "upgrade" to "install" for generality in plugin version switch --- web/i18n/en-US/plugin.ts | 10 +++++----- web/i18n/zh-Hans/plugin.ts | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/web/i18n/en-US/plugin.ts b/web/i18n/en-US/plugin.ts index d5bc3ecbf8..ea93b8812d 100644 --- a/web/i18n/en-US/plugin.ts +++ b/web/i18n/en-US/plugin.ts @@ -162,12 +162,12 @@ const translation = { selectPackagePlaceholder: 'Please select a package', }, upgrade: { - title: 'Upgrade Plugin', - successfulTitle: 'Upgrade successful', - description: 'About to upgrade the following plugin', + title: 'Install Plugin', + successfulTitle: 'Install successful', + description: 'About to install the following plugin', usedInApps: 'Used in {{num}} apps', - upgrade: 'Upgrade', - upgrading: 'Upgrading...', + upgrade: 'Install', + upgrading: 'Installing...', close: 'Close', }, error: { diff --git a/web/i18n/zh-Hans/plugin.ts b/web/i18n/zh-Hans/plugin.ts index 50219dc322..53f2ef8e5c 100644 --- a/web/i18n/zh-Hans/plugin.ts +++ b/web/i18n/zh-Hans/plugin.ts @@ -162,12 +162,12 @@ const translation = { selectPackagePlaceholder: '请选择一个包', }, upgrade: { - title: '升级插件', - successfulTitle: '升级成功', - description: '即将升级以下插件', + title: '安装插件', + successfulTitle: '安装成功', + description: '即将安装以下插件', usedInApps: '在 {{num}} 个应用中使用', - upgrade: '升级', - upgrading: '升级中...', + upgrade: '安装', + upgrading: '安装中...', close: '关闭', }, error: {