From a0603a923ed83ac62b2c373b6d69a6efbac8fb1f Mon Sep 17 00:00:00 2001 From: arvinxx Date: Sat, 9 Sep 2023 20:57:24 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20add=20plugin=20market=20Set?= =?UTF-8?q?ting=20Modal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AgentSetting/AgentPlugin/MarketList.tsx | 46 +++++++---- .../AgentPlugin/MarketSettingModal.tsx | 76 +++++++++++++++++++ src/features/AgentSetting/test.json | 40 ---------- src/locales/default/plugin.ts | 10 ++- src/locales/default/setting.ts | 1 + 5 files changed, 116 insertions(+), 57 deletions(-) create mode 100644 src/features/AgentSetting/AgentPlugin/MarketSettingModal.tsx delete mode 100644 src/features/AgentSetting/test.json diff --git a/src/features/AgentSetting/AgentPlugin/MarketList.tsx b/src/features/AgentSetting/AgentPlugin/MarketList.tsx index 4a3ac0fe..11ae4006 100644 --- a/src/features/AgentSetting/AgentPlugin/MarketList.tsx +++ b/src/features/AgentSetting/AgentPlugin/MarketList.tsx @@ -1,8 +1,8 @@ import { Avatar, Form, Icon, Tooltip } from '@lobehub/ui'; -import { Button, Skeleton, Switch, Tag } from 'antd'; +import { Button, Skeleton, Space, Switch, Tag } from 'antd'; import { createStyles } from 'antd-style'; import isEqual from 'fast-deep-equal'; -import { LucideBlocks, LucideStore, LucideTrash2 } from 'lucide-react'; +import { LucideBlocks, LucideSettings, LucideStore, LucideTrash2 } from 'lucide-react'; import { memo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Flexbox } from 'react-layout-kit'; @@ -13,6 +13,7 @@ import { pluginHelpers, pluginSelectors, usePluginStore } from '@/store/plugin'; import { useStore } from '../store'; import LocalPluginItem from './LocalPluginItem'; +import MarketSettingModal from './MarketSettingModal'; const useStyles = createStyles(({ css }) => ({ avatar: css` @@ -36,6 +37,7 @@ const MarketList = memo(() => { const { styles } = useStyles(); const [showModal, setModal] = useState(false); + const [showSettings, setShowSettings] = useState(false); const [userEnabledPlugins, hasPlugin, toggleAgentPlugin] = useStore((s) => [ s.config.plugins || [], @@ -173,12 +175,13 @@ const MarketList = memo(() => { onValueChange={updateNewDevPlugin} open={showModal} /> +
+ {hasDeprecated ? ( + /> ) : null} - - - + + + +