feat(web): enable MCP market configuration and service management
- Add market configuration API endpoints for creating, updating, and retrieving market configs - Add market MCP listing and detail endpoints with support for activated services - Implement MarketConfigModal component for configuring market connections with URL and API key - Implement McpServiceModal component for viewing and managing MCP services from markets - Add infinite scroll pagination for market sources and MCP services - Add market connection status indicators (connected/disconnected/connecting states) - Add i18n translations for market configuration UI (en and zh) - Update Market component to display market sources with connection management - Add MarketQuery type for market-specific API queries - Refactor market data structure to match backend API response format
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { request } from '@/utils/request'
|
||||
import type { Query, CustomToolItem, ExecuteData, MCPToolItem, InnerToolItem } from '@/views/ToolManagement/types'
|
||||
import type { Query, MarketQuery, CustomToolItem, ExecuteData, MCPToolItem, InnerToolItem } from '@/views/ToolManagement/types'
|
||||
|
||||
// 工具列表
|
||||
export const getTools = (data: Query) => {
|
||||
@@ -33,4 +33,44 @@ export const getToolDetail = (tool_id: string) => {
|
||||
}
|
||||
export const getToolMethods = (tool_id: string) => {
|
||||
return request.get(`/tools/${tool_id}/methods`)
|
||||
}
|
||||
|
||||
// MCP市场列表
|
||||
export const getMarketTools = (data: Query) => {
|
||||
return request.get('/mcp_markets/mcp_markets', data)
|
||||
}
|
||||
// 市场配置创建
|
||||
export const createMarketConfig = (values: {
|
||||
mcp_market_id: string;
|
||||
token: string;
|
||||
status: number;
|
||||
}) => {
|
||||
return request.post('/mcp_market_configs/mcp_market_config', values)
|
||||
}
|
||||
// 市场配置更新
|
||||
export const updateMarketConfig = (values: {
|
||||
mcp_market_config_id: string;
|
||||
token: string;
|
||||
status: number;
|
||||
}) => {
|
||||
return request.put(`/mcp_market_configs/${values.mcp_market_config_id}`, values)
|
||||
}
|
||||
// 市场根据id获取配置
|
||||
export const getMarketConfig = (mcp_market_id: string) => {
|
||||
return request.get(`/mcp_market_configs/mcp_market_id/${mcp_market_id}`)
|
||||
}
|
||||
// 市场MCP列表
|
||||
export const getMarketMCPs = (data: MarketQuery) => {
|
||||
return request.get('/mcp_market_configs/mcp_servers', data)
|
||||
}
|
||||
// 根据配置ID serverId 获取MCP服务详情
|
||||
export const getMarketMCPDetail = (data:{
|
||||
mcp_market_config_id: string;
|
||||
server_id: string;
|
||||
}) => {
|
||||
return request.get(`/mcp_market_configs/mcp_server`,data)
|
||||
}
|
||||
// 市场已激活MCP列表
|
||||
export const getMarketMCPsActivated = (data: MarketQuery) => {
|
||||
return request.get('/mcp_market_configs/operational_mcp_servers', data)
|
||||
}
|
||||
Reference in New Issue
Block a user