From bb2914652a1c522226c3990e71f0e7c291d97826 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 20 Nov 2024 13:56:32 +0800 Subject: [PATCH] feat: finsh loading error comp --- .../(commonLayout)/plugins/test/card/page.tsx | 14 +++--- .../install-plugin/base/loading-error.tsx | 47 ++++++++++++------- .../install-bundle/steps/install-multi.tsx | 3 +- web/i18n/en-US/plugin.ts | 2 + web/i18n/zh-Hans/plugin.ts | 2 + 5 files changed, 43 insertions(+), 25 deletions(-) diff --git a/web/app/(commonLayout)/plugins/test/card/page.tsx b/web/app/(commonLayout)/plugins/test/card/page.tsx index d1c87e18be..ec2dc49018 100644 --- a/web/app/(commonLayout)/plugins/test/card/page.tsx +++ b/web/app/(commonLayout)/plugins/test/card/page.tsx @@ -13,7 +13,7 @@ const PluginList = () => { const pluginList = [toolNotion, extensionDallE, modelGPT4, customTool] const [isShow, { setFalse: hide, - }] = useBoolean(false) + }] = useBoolean(true) return (
@@ -22,12 +22,12 @@ const PluginList = () => { { + const { t } = useTranslation() return ( -
-
-
-
- -
-
-
-
- Plugin load error -
-
- This plugin will not be installed +
+ +
+
+
+
+ +
+
+ +
+
+
+
+ {t('plugin.installModal.pluginLoadError')} +
+
+ {t('plugin.installModal.pluginLoadErrorDesc')} +
+
-
) } diff --git a/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx b/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx index 27e7cca7ad..49e5b27bd1 100644 --- a/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx +++ b/web/app/components/plugins/install-plugin/install-bundle/steps/install-multi.tsx @@ -8,6 +8,7 @@ import { useFetchPluginsInMarketPlaceByIds } from '@/service/use-plugins' import produce from 'immer' import { useGetState } from 'ahooks' import PackageItem from '../item/package-item' +import LoadingError from '../../base/loading-error' type Props = { allPlugins: Dependency[] @@ -105,7 +106,7 @@ const InstallByDSLList: FC = ({ {allPlugins.map((d, index) => { if (errorIndexes.includes(index)) { return ( -
error
+ ) } if (d.type === 'github') { diff --git a/web/i18n/en-US/plugin.ts b/web/i18n/en-US/plugin.ts index 0e8e6dfccd..bcbb1648f4 100644 --- a/web/i18n/en-US/plugin.ts +++ b/web/i18n/en-US/plugin.ts @@ -116,6 +116,8 @@ const translation = { cancel: 'Cancel', back: 'Back', next: 'Next', + pluginLoadError: 'Plugin load error', + pluginLoadErrorDesc: 'This plugin will not be installed', }, installFromGitHub: { installPlugin: 'Install plugin from GitHub', diff --git a/web/i18n/zh-Hans/plugin.ts b/web/i18n/zh-Hans/plugin.ts index c1ad4e0d67..b293f99f8f 100644 --- a/web/i18n/zh-Hans/plugin.ts +++ b/web/i18n/zh-Hans/plugin.ts @@ -116,6 +116,8 @@ const translation = { cancel: '取消', back: '返回', next: '下一步', + pluginLoadError: '插件加载错误', + pluginLoadErrorDesc: '此插件将不会被安装', }, installFromGitHub: { installPlugin: '从 GitHub 安装插件',