From 635bc084b7ce8418e212060c130fd9c89cefed8d Mon Sep 17 00:00:00 2001 From: one Date: Sun, 17 Aug 2025 17:55:59 +0800 Subject: [PATCH] refactor: rename some MCP list (#9253) - BuiltinMCPServersSection -> BuiltinMCPServerList - McpResourcesSection -> McpMarketList --- ...rsSection.tsx => BuiltinMCPServerList.tsx} | 4 +- ...ResourcesSection.tsx => McpMarketList.tsx} | 38 +++++++++---------- .../settings/MCPSettings/McpServersList.tsx | 8 ++-- 3 files changed, 25 insertions(+), 25 deletions(-) rename src/renderer/src/pages/settings/MCPSettings/{BuiltinMCPServersSection.tsx => BuiltinMCPServerList.tsx} (98%) rename src/renderer/src/pages/settings/MCPSettings/{McpResourcesSection.tsx => McpMarketList.tsx} (79%) diff --git a/src/renderer/src/pages/settings/MCPSettings/BuiltinMCPServersSection.tsx b/src/renderer/src/pages/settings/MCPSettings/BuiltinMCPServerList.tsx similarity index 98% rename from src/renderer/src/pages/settings/MCPSettings/BuiltinMCPServersSection.tsx rename to src/renderer/src/pages/settings/MCPSettings/BuiltinMCPServerList.tsx index 5fc6b63c9d..249d514249 100644 --- a/src/renderer/src/pages/settings/MCPSettings/BuiltinMCPServersSection.tsx +++ b/src/renderer/src/pages/settings/MCPSettings/BuiltinMCPServerList.tsx @@ -9,7 +9,7 @@ import styled from 'styled-components' import { SettingTitle } from '..' -const BuiltinMCPServersSection: FC = () => { +const BuiltinMCPServerList: FC = () => { const { t } = useTranslation() const { addMCPServer, mcpServers } = useMCPServers() @@ -176,4 +176,4 @@ const ServerFooter = styled.div` margin-top: 10px; ` -export default BuiltinMCPServersSection +export default BuiltinMCPServerList diff --git a/src/renderer/src/pages/settings/MCPSettings/McpResourcesSection.tsx b/src/renderer/src/pages/settings/MCPSettings/McpMarketList.tsx similarity index 79% rename from src/renderer/src/pages/settings/MCPSettings/McpResourcesSection.tsx rename to src/renderer/src/pages/settings/MCPSettings/McpMarketList.tsx index 9f0c2f583c..7c61a74dbe 100644 --- a/src/renderer/src/pages/settings/MCPSettings/McpResourcesSection.tsx +++ b/src/renderer/src/pages/settings/MCPSettings/McpMarketList.tsx @@ -5,7 +5,7 @@ import styled from 'styled-components' import { SettingTitle } from '..' -const mcpResources = [ +const mcpMarkets = [ { name: 'modelscope.cn', url: 'https://www.modelscope.cn/mcp', @@ -62,38 +62,38 @@ const mcpResources = [ } ] -const McpResourcesSection: FC = () => { +const McpMarketList: FC = () => { const { t } = useTranslation() return ( <> {t('settings.mcp.findMore')} - - {mcpResources.map((resource) => ( - window.open(resource.url, '_blank', 'noopener,noreferrer')}> - - - {resource.name} + + {mcpMarkets.map((resource) => ( + window.open(resource.url, '_blank', 'noopener,noreferrer')}> + + + {resource.name} - - {t(resource.descriptionKey)} - + + {t(resource.descriptionKey)} + ))} - + ) } -const ResourcesGrid = styled.div` +const MarketGrid = styled.div` display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 20px; ` -const ResourceCard = styled.div` +const MarketCard = styled.div` display: flex; flex-direction: column; border: 0.5px solid var(--color-border); @@ -110,13 +110,13 @@ const ResourceCard = styled.div` } ` -const ResourceHeader = styled.div` +const MarketHeader = styled.div` display: flex; align-items: center; margin-bottom: 8px; ` -const ResourceLogo = styled.img` +const MarketLogo = styled.img` width: 20px; height: 20px; border-radius: 4px; @@ -124,7 +124,7 @@ const ResourceLogo = styled.img` margin-right: 8px; ` -const ResourceName = styled.span` +const MarketName = styled.span` font-size: 14px; font-weight: 500; flex: 1; @@ -139,7 +139,7 @@ const ExternalLinkIcon = styled.div` align-items: center; ` -const ResourceDescription = styled.div` +const MarketDescription = styled.div` font-size: 12px; color: var(--color-text-2); overflow: hidden; @@ -149,4 +149,4 @@ const ResourceDescription = styled.div` line-height: 1.4; ` -export default McpResourcesSection +export default McpMarketList diff --git a/src/renderer/src/pages/settings/MCPSettings/McpServersList.tsx b/src/renderer/src/pages/settings/MCPSettings/McpServersList.tsx index 151579ad03..e8c030188f 100644 --- a/src/renderer/src/pages/settings/MCPSettings/McpServersList.tsx +++ b/src/renderer/src/pages/settings/MCPSettings/McpServersList.tsx @@ -15,10 +15,10 @@ import styled from 'styled-components' import { SettingTitle } from '..' import AddMcpServerModal from './AddMcpServerModal' -import BuiltinMCPServersSection from './BuiltinMCPServersSection' +import BuiltinMCPServerList from './BuiltinMCPServerList' import EditMcpJsonPopup from './EditMcpJsonPopup' import InstallNpxUv from './InstallNpxUv' -import McpResourcesSection from './McpResourcesSection' +import McpMarketList from './McpMarketList' import SyncServersPopup from './SyncServersPopup' const McpServersList: FC = () => { @@ -248,8 +248,8 @@ const McpServersList: FC = () => { /> )} - - + +