From 0ff5bcd8fabfb9c835b48bc031505eb082ed8318 Mon Sep 17 00:00:00 2001
From: ningyv <1793599591@qq.com>
Date: Tue, 15 Apr 2025 18:56:50 +0800
Subject: [PATCH 01/11] feature/1.7-MCP
---
.../common/src/components/postcat/ApiEdit.tsx | 4 +
.../packages/core/src/const/system/const.tsx | 2 +-
frontend/packages/core/src/index.css | 5 +
.../api/AiServiceInsideRouterModelConfig.tsx | 2 +
.../src/pages/aiSetting/AiSettingModal.tsx | 2 +
.../core/src/pages/guide/LocalAiDeploy.tsx | 2 +
.../core/src/pages/guide/RestAIDeploy.tsx | 2 +
.../core/src/pages/loadBalancing/AddModel.tsx | 2 +
.../mcpService/IntegrationAIContainer.tsx | 358 +++++++++++-------
.../pages/mcpService/McpServiceContainer.tsx | 2 +-
.../core/src/pages/member/MemberList.tsx | 2 +
.../pages/partitions/DashboardSettingEdit.tsx | 8 +-
.../core/src/pages/policy/FilterForm.tsx | 8 +-
.../policy/dataMasking/DataMaskingConfig.tsx | 9 +-
.../dataMasking/DataMaskingRuleForm.tsx | 8 +
.../core/src/pages/system/SystemConfig.tsx | 4 +
.../core/src/pages/system/SystemList.tsx | 22 +-
.../pages/system/api/SystemInsideApiProxy.tsx | 5 +-
.../system/api/SystemInsideRouterCreate.tsx | 10 +
.../upstream/SystemInsideUpstreamContent.tsx | 6 +-
.../core/src/pages/team/TeamConfig.tsx | 2 +
.../core/src/pages/team/TeamInsideMember.tsx | 2 +
.../src/component/MonitorApiPage.tsx | 4 +
.../src/component/MonitorAppPage.tsx | 2 +
.../src/component/MonitorSubPage.tsx | 2 +
frontend/packages/market/src/index.css | 5 +
.../pages/serviceHub/ApplyServiceModal.tsx | 2 +
.../src/pages/serviceHub/ServiceHubDetail.tsx | 13 +-
.../src/pages/serviceHub/ServiceHubGroup.tsx | 2 +-
.../src/pages/serviceHub/ServiceHubList.tsx | 25 +-
.../management/ManagementAuthorityConfig.tsx | 8 +
.../management/ManagementConfig.tsx | 2 +
32 files changed, 378 insertions(+), 154 deletions(-)
diff --git a/frontend/packages/common/src/components/postcat/ApiEdit.tsx b/frontend/packages/common/src/components/postcat/ApiEdit.tsx
index 9fb41e90..9bb654a7 100644
--- a/frontend/packages/common/src/components/postcat/ApiEdit.tsx
+++ b/frontend/packages/common/src/components/postcat/ApiEdit.tsx
@@ -234,12 +234,16 @@ export default function ApiEdit({
<>
-
- {type === 'service' && service?.basic.enableMcp && (
-
-
setActiveTab('openApi')}
- >
- Open API
+ {type === 'service' && service?.basic.enableMcp && (
+
+
setActiveTab('openApi')}
+ >
+ Open API
+
+
setActiveTab('mcp')}
+ >
+ MCP
+
+
+ )}
+ {type === 'service' && !apiKeyList.length ? (
+ <>
+
+
+ {$t('请先订阅该服务')}
+
- setActiveTab('mcp')}
- >
- MCP
+
+ >
+ ) : (
+ <>
+
+
+ {activeTab === 'openApi' ? tabContent.openApi?.title : tabContent.mcp.title}
+
+ {/* 标签页内容区域 */}
+
+ {activeTab === 'mcp' ? (
+
{
+ try {
+ return JSON.parse(configContent)
+ } catch (e) {
+ return {}
+ }
+ })()
+ : configContent
+ : {}
+ }
+ theme="monokai"
+ indentWidth={2}
+ displayDataTypes={false}
+ displayObjectSize={false}
+ name={false}
+ collapsed={false}
+ enableClipboard={false}
+ style={{
+ backgroundColor: 'transparent',
+ wordBreak: 'break-word',
+ whiteSpace: 'normal'
+ }}
+ />
+ ) : (
+ <>
+ {configContent || ''}
+ >
+ )}
+ handleCopy(configContent)}
+ sx={{
+ position: 'absolute',
+ top: '5px',
+ right: '5px',
+ color: '#999',
+ transition: 'none',
+ '&.MuiButtonBase-root:hover': {
+ background: 'transparent',
+ color: '#3D46F2',
+ transition: 'none'
+ }
+ }}
+ >
- )}
-
- {activeTab === 'openApi' ? tabContent.openApi?.title : tabContent.mcp.title}
-
- {/* 标签页内容区域 */}
-
- {activeTab === 'mcp' ? (
-
{
- try {
- return JSON.parse(configContent);
- } catch (e) {
- return {};
- }
- })()
- : configContent
- : {}
- }
- theme="monokai"
- indentWidth={2}
- displayDataTypes={false}
- displayObjectSize={false}
- name={false}
- collapsed={false}
- enableClipboard={false}
- style={{
- backgroundColor: 'transparent',
- wordBreak: 'break-word',
- whiteSpace: 'normal'
- }}
- />
- ) : (
+ {activeTab === 'mcp' && (
<>
- {configContent || ''}
+ API Key
+ {apiKeyList.length ? (
+ <>
+ {type === 'global' ? (
+ <>
+
+
+
+ {apiKey}
+ handleCopy(apiKey)}
+ sx={{
+ position: 'absolute',
+ top: '0px',
+ right: '5px',
+ color: '#999',
+ transition: 'none',
+ '&.MuiButtonBase-root:hover': {
+ background: 'transparent',
+ color: '#3D46F2',
+ transition: 'none'
+ }
+ }}
+ >
+
+
+ >
+ ) : (
+ <>
+
+ >
+ )}
+ >
+ ) : (
+
+
+
+ )}
>
)}
- handleCopy(configContent)}
- sx={{
- position: 'absolute',
- top: '5px',
- right: '5px',
- color: '#999',
- transition: 'none',
- '&.MuiButtonBase-root:hover': {
- background: 'transparent',
- color: '#3D46F2',
- transition: 'none'
- }
- }}
- >
-
-
- {activeTab === 'mcp' && (
- <>
- API Key
- {apiKeyList.length ? (
- <>
-
-
-
- {apiKey}
- handleCopy(apiKey)}
- sx={{
- position: 'absolute',
- top: '0px',
- right: '5px',
- color: '#999',
- transition: 'none',
- '&.MuiButtonBase-root:hover': {
- background: 'transparent',
- color: '#3D46F2',
- transition: 'none'
- }
- }}
- >
-
-
- >
- ) : (
-
-
-
- )}
>
)}
>
)
-}
-
-export default IntegrationAIContainer
+})
\ No newline at end of file
diff --git a/frontend/packages/core/src/pages/mcpService/McpServiceContainer.tsx b/frontend/packages/core/src/pages/mcpService/McpServiceContainer.tsx
index 6f52db14..7a71d706 100644
--- a/frontend/packages/core/src/pages/mcpService/McpServiceContainer.tsx
+++ b/frontend/packages/core/src/pages/mcpService/McpServiceContainer.tsx
@@ -1,6 +1,6 @@
import InsidePage from "@common/components/aoplatform/InsidePage"
import { $t } from '@common/locales/index.ts'
-import IntegrationAIContainer from "./IntegrationAIContainer"
+import { IntegrationAIContainer } from "./IntegrationAIContainer"
import { Tool } from "@modelcontextprotocol/sdk/types.js"
import { useEffect, useState } from "react"
import McpToolsContainer from "./McpToolsContainer"
diff --git a/frontend/packages/core/src/pages/member/MemberList.tsx b/frontend/packages/core/src/pages/member/MemberList.tsx
index f8c473d7..864814de 100644
--- a/frontend/packages/core/src/pages/member/MemberList.tsx
+++ b/frontend/packages/core/src/pages/member/MemberList.tsx
@@ -480,6 +480,8 @@ const MemberList = () => {
render: (_, entity) => (
x.id)}
diff --git a/frontend/packages/core/src/pages/partitions/DashboardSettingEdit.tsx b/frontend/packages/core/src/pages/partitions/DashboardSettingEdit.tsx
index d133e6ea..1d4897b7 100644
--- a/frontend/packages/core/src/pages/partitions/DashboardSettingEdit.tsx
+++ b/frontend/packages/core/src/pages/partitions/DashboardSettingEdit.tsx
@@ -60,7 +60,13 @@ export type DashboardSettingEditProps = {
name="driver"
rules={[{ required: true }]}
>
-
+
diff --git a/frontend/packages/core/src/pages/policy/FilterForm.tsx b/frontend/packages/core/src/pages/policy/FilterForm.tsx
index 1c3a1bb8..361d1c6f 100644
--- a/frontend/packages/core/src/pages/policy/FilterForm.tsx
+++ b/frontend/packages/core/src/pages/policy/FilterForm.tsx
@@ -301,7 +301,13 @@ const FilterForm = forwardRef(
return (
-
+
((_,ref) => {
name="type"
rules={[{ required: true }]}
>
-
-
+
diff --git a/frontend/packages/core/src/pages/policy/dataMasking/DataMaskingRuleForm.tsx b/frontend/packages/core/src/pages/policy/dataMasking/DataMaskingRuleForm.tsx
index 6393481d..705db146 100644
--- a/frontend/packages/core/src/pages/policy/dataMasking/DataMaskingRuleForm.tsx
+++ b/frontend/packages/core/src/pages/policy/dataMasking/DataMaskingRuleForm.tsx
@@ -146,6 +146,8 @@ const DataMaskRuleForm: React.FC = ({
= ({
{matchType === 'inner' ? (
= ({
= ({
rules={[{ required: true }]}
>
((_, ref) => {
{!onEdit && (
label={$t('所属团队')} name="team" rules={[{ required: true }]}>
((_, ref) => {
label={$t('标签')} name="tags">
{
- {$t(SERVICE_KIND_OPTIONS.find((x) => x.value === record.service_kind)?.label || '-')}
- {record.enable_mcp && (
- MCP
- )}
+
+ {SERVICE_KIND_OPTIONS.find((x) => x.value === record.service_kind)?.label || '-'}
+
+ {record?.enable_mcp && (
+
+ MCP
+
+ )}
)
}
diff --git a/frontend/packages/core/src/pages/system/api/SystemInsideApiProxy.tsx b/frontend/packages/core/src/pages/system/api/SystemInsideApiProxy.tsx
index c47b2b1e..adc87901 100644
--- a/frontend/packages/core/src/pages/system/api/SystemInsideApiProxy.tsx
+++ b/frontend/packages/core/src/pages/system/api/SystemInsideApiProxy.tsx
@@ -30,7 +30,10 @@ const SystemInsideApiProxy = forwardRefPROXY_HEADER_CONFIG.map((x)=>({
...x,
...(x.key === 'optType' ? {
- component: ({...x, label:$t(x.label)}))}/>
+ component: ({...x, label:$t(x.label)}))}/>
} : {})
}))
,[state.language])
diff --git a/frontend/packages/core/src/pages/system/api/SystemInsideRouterCreate.tsx b/frontend/packages/core/src/pages/system/api/SystemInsideRouterCreate.tsx
index 3b3e9cc4..5ce1ecb4 100644
--- a/frontend/packages/core/src/pages/system/api/SystemInsideRouterCreate.tsx
+++ b/frontend/packages/core/src/pages/system/api/SystemInsideRouterCreate.tsx
@@ -179,6 +179,8 @@ const SystemInsideRouterCreate = forwardRef {
return { label: $t(value), value: key }
@@ -192,6 +194,8 @@ const SystemInsideRouterCreate = forwardRef {
return { label: $t(value), value: key }
@@ -252,6 +256,8 @@ const SystemInsideRouterCreate = forwardRef label={$t('请求协议')} name="protocols" rules={[{ required: true }]}>
label={$t('请求方式')} name="methods" rules={[{ required: true }]}>
PROXY_HEADER_CONFIG.map((x)=>({
...x,
...(x.key === 'optType' ? {
- component: ({...x, label:$t(x.label)}))}/>
+ component: ({...x, label:$t(x.label)}))}/>
} : {})
}))
,[state.language])
@@ -175,7 +175,7 @@ const globalConfigNodesRule: FormItemProps['rules'] = [
name="scheme"
rules={[{ required: true }]}
>
-
+
@@ -192,7 +192,7 @@ const globalConfigNodesRule: FormItemProps['rules'] = [
name="passHost"
rules={[{ required: true }]}
>
- setFormShowHost(val === 'rewrite')}>
+ setFormShowHost(val === 'rewrite')}>
diff --git a/frontend/packages/core/src/pages/team/TeamConfig.tsx b/frontend/packages/core/src/pages/team/TeamConfig.tsx
index 7be89f56..b8ab0c42 100644
--- a/frontend/packages/core/src/pages/team/TeamConfig.tsx
+++ b/frontend/packages/core/src/pages/team/TeamConfig.tsx
@@ -205,6 +205,8 @@ const TeamConfig = forwardRef((props, ref) =>
rules={[{ required: true }]}
>
{
render: (_, entity) => (
{
const [tabItem, setTabItem] = useState([])
const [currentTab, setCurrentTab] = useState('')
const { state } = useGlobalContext()
+ const integrationAIContainerRef = useRef(null)
const navigate = useNavigate()
const modifyApiDoc = (apiDoc: string, apiPrefix: string) => {
@@ -191,7 +192,7 @@ servers:
content: serviceBasicInfo?.catalogue?.name || '-'
},
{
- color: '#fbe5e5',
+ color: `#${serviceBasicInfo?.serviceKind === 'ai' ? 'EADEFF' : 'DEFFE7'}`,
textColor: 'text-[#000]',
title: serviceBasicInfo?.serviceKind || '-',
content: SERVICE_KIND_OPTIONS.find((x) => x.value === serviceBasicInfo?.serviceKind)?.label || '-'
@@ -201,7 +202,7 @@ servers:
// 如果启用了MCP,添加MCP标签
if (serviceBasicInfo?.enableMcp) {
tags.push({
- color: '#ffc107',
+ color: '#FFF0C1',
textColor: 'text-[#000]',
title: 'MCP',
content: 'MCP'
@@ -263,7 +264,9 @@ servers:
),
onOk: () => {
return applyRef.current?.apply().then((res) => {
- // if(res === true) setApplied(true)
+ if (res === true) {
+ integrationAIContainerRef.current?.getServiceKeysList()
+ }
})
},
okText: $t('确认'),
@@ -490,11 +493,13 @@ servers:
items={tabItem}
/>
diff --git a/frontend/packages/market/src/pages/serviceHub/ServiceHubGroup.tsx b/frontend/packages/market/src/pages/serviceHub/ServiceHubGroup.tsx
index ad228af3..fa67e9ec 100644
--- a/frontend/packages/market/src/pages/serviceHub/ServiceHubGroup.tsx
+++ b/frontend/packages/market/src/pages/serviceHub/ServiceHubGroup.tsx
@@ -119,7 +119,7 @@ export const ServiceHubGroup = ({ children, filterOption, dispatch }: ServiceHub
return (
-
+
{
}
+ indicator={
+
+ }
spinning={filterOption.listLoading}
>
{filterOption.showServicesList && filterOption.showServicesList.length > 0 ? (
@@ -189,7 +195,12 @@ const ServiceHubList: FC = () => {
}}
/>
) : (
-
+ <>
+ {!filterOption.listLoading &&
+ (!filterOption.showServicesList || filterOption.showServicesList.length === 0) && (
+
+ )}
+ >
)}
@@ -225,7 +236,7 @@ const CardTitle = (service: ServiceHubTableListItem) => {
{
{service.catalogue?.name || '-'}
@@ -242,7 +253,7 @@ const CardTitle = (service: ServiceHubTableListItem) => {
{service?.enableMcp && (
label={$t('鉴权类型')} name="driver" rules={[{ required: true }]}>
{
@@ -205,6 +211,8 @@ export const ManagementAuthorityConfig = forwardRef label={$t('校验字段')} name={['config', 'claimsToVerify']}>
label={$t('所属团队')} name="team" rules={[{ required: true }]}>
Date: Wed, 16 Apr 2025 09:17:35 +0800
Subject: [PATCH 02/11] feature/1.7-MCP
---
.../packages/core/src/pages/aiService/AiServiceInsidePage.tsx | 2 +-
frontend/packages/core/src/pages/system/SystemInsidePage.tsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/frontend/packages/core/src/pages/aiService/AiServiceInsidePage.tsx b/frontend/packages/core/src/pages/aiService/AiServiceInsidePage.tsx
index ff9c0187..f42c6b47 100644
--- a/frontend/packages/core/src/pages/aiService/AiServiceInsidePage.tsx
+++ b/frontend/packages/core/src/pages/aiService/AiServiceInsidePage.tsx
@@ -232,7 +232,7 @@ const AiServiceInsidePage: FC = () => {
diff --git a/frontend/packages/core/src/pages/system/SystemInsidePage.tsx b/frontend/packages/core/src/pages/system/SystemInsidePage.tsx
index d7a174dc..f7d53bca 100644
--- a/frontend/packages/core/src/pages/system/SystemInsidePage.tsx
+++ b/frontend/packages/core/src/pages/system/SystemInsidePage.tsx
@@ -234,7 +234,7 @@ const SystemInsidePage: FC = () => {
From 596be2cf7f4454b98a89fb68f062fe302ba206fe Mon Sep 17 00:00:00 2001
From: ningyv <1793599591@qq.com>
Date: Wed, 16 Apr 2025 09:47:33 +0800
Subject: [PATCH 03/11] feature/1.7-MCP
---
.../core/src/pages/mcpService/IntegrationAIContainer.tsx | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx b/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
index 2a96e997..061b55c7 100644
--- a/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
+++ b/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
@@ -200,8 +200,9 @@ export const IntegrationAIContainer = forwardRef {
- fetchData>(`my/apikeys/${serviceId}`, {
- method: 'GET'
+ fetchData>(`my/app/apikeys`, {
+ method: 'GET',
+ eoParams: { serviceId }
})
.then((response) => {
const { code, msg, data } = response
@@ -345,7 +346,7 @@ export const IntegrationAIContainer = forwardRef {
if (connectionStatus === 'connected') {
listTools()
From 41dae0daf459c280c82a83cfe6a8396cfcc3e424 Mon Sep 17 00:00:00 2001
From: ningyv <1793599591@qq.com>
Date: Wed, 16 Apr 2025 09:53:03 +0800
Subject: [PATCH 04/11] feature/1.7-MCP
---
frontend/packages/common/src/locales/scan/en-US.json | 4 +++-
frontend/packages/common/src/locales/scan/ja-JP.json | 4 +++-
frontend/packages/common/src/locales/scan/zh-CN.json | 4 +++-
frontend/packages/common/src/locales/scan/zh-TW.json | 4 +++-
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/frontend/packages/common/src/locales/scan/en-US.json b/frontend/packages/common/src/locales/scan/en-US.json
index 38d223af..57b0cd8c 100644
--- a/frontend/packages/common/src/locales/scan/en-US.json
+++ b/frontend/packages/common/src/locales/scan/en-US.json
@@ -923,5 +923,7 @@
"Kba68dfc1": "Add API Settings",
"Kc84dbd1a": "API Portal",
"Ke93388fd": "Edit API",
- "K84aabfd4": "Add API"
+ "K84aabfd4": "Add API",
+ "K71ed51fa": "Please subscribe to the service first",
+ "K1bec8cbe": "Select API Key"
}
diff --git a/frontend/packages/common/src/locales/scan/ja-JP.json b/frontend/packages/common/src/locales/scan/ja-JP.json
index eb26cb7e..b1f54644 100644
--- a/frontend/packages/common/src/locales/scan/ja-JP.json
+++ b/frontend/packages/common/src/locales/scan/ja-JP.json
@@ -945,5 +945,7 @@
"Kba68dfc1": "API設定の追加",
"Kc84dbd1a": "APIポータル",
"Ke93388fd": "APIの編集",
- "K84aabfd4": "APIの追加"
+ "K84aabfd4": "APIの追加",
+ "K71ed51fa": "このサービスに先にサブスクリプションしてください",
+ "K1bec8cbe": "APIキーを選択してください"
}
diff --git a/frontend/packages/common/src/locales/scan/zh-CN.json b/frontend/packages/common/src/locales/scan/zh-CN.json
index ab65dcbd..e60083a8 100644
--- a/frontend/packages/common/src/locales/scan/zh-CN.json
+++ b/frontend/packages/common/src/locales/scan/zh-CN.json
@@ -876,5 +876,7 @@
"Kba68dfc1": "添加 API 设置",
"Kc84dbd1a": "API 门户",
"Ke93388fd": "编辑 API",
- "K84aabfd4": "添加 API"
+ "K84aabfd4": "添加 API",
+ "K71ed51fa": "请先订阅该服务",
+ "K1bec8cbe": "选择 API Key"
}
diff --git a/frontend/packages/common/src/locales/scan/zh-TW.json b/frontend/packages/common/src/locales/scan/zh-TW.json
index 9d0b3cfa..4c9d5593 100644
--- a/frontend/packages/common/src/locales/scan/zh-TW.json
+++ b/frontend/packages/common/src/locales/scan/zh-TW.json
@@ -945,5 +945,7 @@
"Kba68dfc1": "新增 API 設定",
"Kc84dbd1a": "API 門戶",
"Ke93388fd": "編輯 API",
- "K84aabfd4": "新增 API"
+ "K84aabfd4": "新增 API",
+ "K71ed51fa": "請先訂閱該服務",
+ "K1bec8cbe": "選擇 API Key"
}
From 54c88e189ef3bc806c725403ca965d7a1085cc40 Mon Sep 17 00:00:00 2001
From: ningyv <1793599591@qq.com>
Date: Wed, 16 Apr 2025 10:18:51 +0800
Subject: [PATCH 05/11] feature/1.7-MCP
---
.../core/src/pages/mcpService/IntegrationAIContainer.tsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx b/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
index 061b55c7..77f36362 100644
--- a/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
+++ b/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
@@ -310,6 +310,7 @@ export const IntegrationAIContainer = forwardRef {
initTabsData()
+ type === 'global' && getGlobalMcpConfig()
}, [state.language])
useEffect(() => {
if (type === 'service') {
From b872e695b0598e105e8eafc1bda892aba37868d1 Mon Sep 17 00:00:00 2001
From: ningyv <1793599591@qq.com>
Date: Wed, 16 Apr 2025 11:52:32 +0800
Subject: [PATCH 06/11] feature/1.7-MCP
---
frontend/packages/common/src/const/type.ts | 1 +
.../src/contexts/GlobalStateContext.tsx | 29 ++++++++++++--
.../dashboard/src/pages/DashboardTabPage.tsx | 39 ++-----------------
.../pages/serviceHub/ApplyServiceModal.tsx | 12 +++++-
.../src/pages/serviceHub/ServiceHubDetail.tsx | 26 +++++++++----
5 files changed, 59 insertions(+), 48 deletions(-)
diff --git a/frontend/packages/common/src/const/type.ts b/frontend/packages/common/src/const/type.ts
index 47044c70..1a929b4e 100644
--- a/frontend/packages/common/src/const/type.ts
+++ b/frontend/packages/common/src/const/type.ts
@@ -81,6 +81,7 @@ export type MatchItem = {
export type EntityItem = {
id: string
name: string
+ isSubscribed: boolean
}
export type DynamicMenuItem = {
diff --git a/frontend/packages/common/src/contexts/GlobalStateContext.tsx b/frontend/packages/common/src/contexts/GlobalStateContext.tsx
index 6e60c5db..16246a22 100644
--- a/frontend/packages/common/src/contexts/GlobalStateContext.tsx
+++ b/frontend/packages/common/src/contexts/GlobalStateContext.tsx
@@ -99,10 +99,31 @@ const mockData = [
icon: 'ic:baseline-bar-chart',
children: [
{
- name: '运行视图',
- key: 'analytics',
- path: '/analytics',
- icon: 'ic:baseline-bar-chart',
+ name: '总览',
+ key: 'analyticsTotal',
+ path: '/analytics/total',
+ icon: 'material-symbols:bar-chart',
+ access: 'system.analysis.run_view.view'
+ },
+ {
+ name: '服务',
+ key: 'analyticsSubscriber',
+ path: '/analytics/subscriber/list',
+ icon: 'ic:baseline-blinds-closed',
+ access: 'system.analysis.run_view.view'
+ },
+ {
+ name: '消费者',
+ key: 'analyticsProvider',
+ path: '/analytics/provider/list',
+ icon: 'ic:baseline-apps',
+ access: 'system.analysis.run_view.view'
+ },
+ {
+ name: 'API',
+ key: 'analyticsApi',
+ path: '/analytics/api/list',
+ icon: 'gravity-ui:plug-connection',
access: 'system.analysis.run_view.view'
}
],
diff --git a/frontend/packages/dashboard/src/pages/DashboardTabPage.tsx b/frontend/packages/dashboard/src/pages/DashboardTabPage.tsx
index 68e9d2d3..d45d42c1 100644
--- a/frontend/packages/dashboard/src/pages/DashboardTabPage.tsx
+++ b/frontend/packages/dashboard/src/pages/DashboardTabPage.tsx
@@ -7,49 +7,16 @@ import { RouterParams } from '@common/const/type'
export default function DashboardTabPage() {
const { dashboardType } = useParams()
- const [activeKey, setActiveKey] = useState('total')
const navigateTo = useNavigate()
useEffect(() => {
- setActiveKey(dashboardType || 'total')
+ const activeKey = dashboardType || 'total'
+ navigateTo(`/analytics/${activeKey === 'total' ? activeKey : `${activeKey}/list`}`)
}, [dashboardType])
- const monitorTabItems: TabsProps['items'] = [
- {
- label: $t('监控总览'),
- key: 'total',
- children:
- },
- {
- label: $t('服务被调用统计'),
- key: 'subscriber',
- children:
- },
- {
- label: $t('消费者调用统计'),
- key: 'provider',
- children:
- },
- {
- label: $t('API 调用统计'),
- key: 'api',
- children:
- }
- ]
-
return (
<>
- {
- setActiveKey(val)
- navigateTo(`/analytics/${val === 'total' ? val : `${val}/list`}`)
- }}
- items={monitorTabItems}
- className="h-full overflow-hidden mt-[6px] [&>.ant-tabs-content-holder]:overflow-auto [&>.ant-tabs-content-holder]:pr-PAGE_INSIDE_X [&>.ant-tabs-content-holder>.ant-tabs-content]:h-full [&>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane]:h-full"
- size="small"
- tabBarStyle={{ paddingLeft: '10px', marginTop: '0px', marginBottom: '0px' }}
- />
+
>
)
}
diff --git a/frontend/packages/market/src/pages/serviceHub/ApplyServiceModal.tsx b/frontend/packages/market/src/pages/serviceHub/ApplyServiceModal.tsx
index 114b4c73..4ca9647a 100644
--- a/frontend/packages/market/src/pages/serviceHub/ApplyServiceModal.tsx
+++ b/frontend/packages/market/src/pages/serviceHub/ApplyServiceModal.tsx
@@ -2,7 +2,7 @@ import WithPermission from '@common/components/aoplatform/WithPermission'
import { BasicResponse, RESPONSE_TIPS, STATUS_CODE } from '@common/const/const'
import { useFetch } from '@common/hooks/http'
import { $t } from '@common/locales'
-import { App, Col, Form, Input, Row, Select } from 'antd'
+import { App, Col, Form, Input, Row, Select, Tooltip } from 'antd'
import { forwardRef, useEffect, useImperativeHandle } from 'react'
import { ApplyServiceHandle, ApplyServiceProps } from '../../const/serviceHub/type'
@@ -77,6 +77,16 @@ export const ApplyServiceModal = forwardRef x.value !== entity.id)}
+ optionRender={(option) => {
+ if (option.data.disabled) {
+ return (
+
+ {option.data.label}
+
+ )
+ }
+ return {option.data.label}
+ }}
/>
{entity.approvalType === 'manual' && (
diff --git a/frontend/packages/market/src/pages/serviceHub/ServiceHubDetail.tsx b/frontend/packages/market/src/pages/serviceHub/ServiceHubDetail.tsx
index deed55a0..faa3b795 100644
--- a/frontend/packages/market/src/pages/serviceHub/ServiceHubDetail.tsx
+++ b/frontend/packages/market/src/pages/serviceHub/ServiceHubDetail.tsx
@@ -235,16 +235,28 @@ servers:
const getMySelectList = () => {
setMySystemOptionList([])
- fetchData>('apps/can_subscribe', { method: 'GET' }).then((response) => {
+ fetchData>('apps/can_subscribe', {
+ method: 'GET',
+ eoParams: { service: serviceId },
+ eoTransformKeys: ['is_subscribed']
+ }).then((response) => {
const { code, data, msg } = response
if (code === STATUS_CODE.SUCCESS) {
setMySystemOptionList(
- data.app?.map((x: EntityItem) => {
- return {
- label: x.name,
- value: x.id
- }
- })
+ data.app
+ ?.sort((a: EntityItem, b: EntityItem) => {
+ // 已订阅的排在后面
+ if (a.isSubscribed && !b.isSubscribed) return 1
+ if (!a.isSubscribed && b.isSubscribed) return -1
+ return 0
+ })
+ .map((x: EntityItem) => {
+ return {
+ label: x.name,
+ value: x.id,
+ disabled: x.isSubscribed // 已订阅的设为禁用
+ }
+ })
)
} else {
message.error(msg || $t(RESPONSE_TIPS.error))
From 16b16bae32239086ac4779b5c19f8516eda24881 Mon Sep 17 00:00:00 2001
From: ningyv <1793599591@qq.com>
Date: Wed, 16 Apr 2025 13:44:40 +0800
Subject: [PATCH 07/11] feature/1.7-MCP
---
.../core/src/pages/mcpService/IntegrationAIContainer.tsx | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx b/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
index 77f36362..f6fe396f 100644
--- a/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
+++ b/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
@@ -77,6 +77,7 @@ export const IntegrationAIContainer = forwardRef('')
const [apiKey, setApiKey] = useState('')
const [apiKeyList, setApiKeyList] = useState([])
+ const [cascaderKeyList, setCascaderKeyList] = useState([])
const [mcpServerUrl, setMcpServerUrl] = useState('')
const { state } = useGlobalContext()
const navigator = useNavigate()
@@ -131,6 +132,7 @@ export const IntegrationAIContainer = forwardRef['onChange'] = (value) => {
setApiKey(value.at(-1) || '')
+ setCascaderKeyList(value)
}
/**
@@ -218,6 +220,10 @@ export const IntegrationAIContainer = forwardRef
From 62b64764204ba33c9e9727a86570ce215f8d1e08 Mon Sep 17 00:00:00 2001
From: ningyv <1793599591@qq.com>
Date: Wed, 16 Apr 2025 13:47:54 +0800
Subject: [PATCH 08/11] feature/1.7-MCP
---
frontend/packages/common/src/locales/scan/en-US.json | 3 ++-
frontend/packages/common/src/locales/scan/ja-JP.json | 3 ++-
frontend/packages/common/src/locales/scan/zh-CN.json | 3 ++-
frontend/packages/common/src/locales/scan/zh-TW.json | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/frontend/packages/common/src/locales/scan/en-US.json b/frontend/packages/common/src/locales/scan/en-US.json
index 57b0cd8c..fc60e12b 100644
--- a/frontend/packages/common/src/locales/scan/en-US.json
+++ b/frontend/packages/common/src/locales/scan/en-US.json
@@ -925,5 +925,6 @@
"Ke93388fd": "Edit API",
"K84aabfd4": "Add API",
"K71ed51fa": "Please subscribe to the service first",
- "K1bec8cbe": "Select API Key"
+ "K1bec8cbe": "Select API Key",
+ "K5611e01e": "This consumer is already subscribed"
}
diff --git a/frontend/packages/common/src/locales/scan/ja-JP.json b/frontend/packages/common/src/locales/scan/ja-JP.json
index b1f54644..dfc7381f 100644
--- a/frontend/packages/common/src/locales/scan/ja-JP.json
+++ b/frontend/packages/common/src/locales/scan/ja-JP.json
@@ -947,5 +947,6 @@
"Ke93388fd": "APIの編集",
"K84aabfd4": "APIの追加",
"K71ed51fa": "このサービスに先にサブスクリプションしてください",
- "K1bec8cbe": "APIキーを選択してください"
+ "K1bec8cbe": "APIキーを選択してください",
+ "K5611e01e": "この消費者はすでに購読しています"
}
diff --git a/frontend/packages/common/src/locales/scan/zh-CN.json b/frontend/packages/common/src/locales/scan/zh-CN.json
index e60083a8..d90b6906 100644
--- a/frontend/packages/common/src/locales/scan/zh-CN.json
+++ b/frontend/packages/common/src/locales/scan/zh-CN.json
@@ -878,5 +878,6 @@
"Ke93388fd": "编辑 API",
"K84aabfd4": "添加 API",
"K71ed51fa": "请先订阅该服务",
- "K1bec8cbe": "选择 API Key"
+ "K1bec8cbe": "选择 API Key",
+ "K5611e01e": "该消费者已订阅"
}
diff --git a/frontend/packages/common/src/locales/scan/zh-TW.json b/frontend/packages/common/src/locales/scan/zh-TW.json
index 4c9d5593..2ff11075 100644
--- a/frontend/packages/common/src/locales/scan/zh-TW.json
+++ b/frontend/packages/common/src/locales/scan/zh-TW.json
@@ -947,5 +947,6 @@
"Ke93388fd": "編輯 API",
"K84aabfd4": "新增 API",
"K71ed51fa": "請先訂閱該服務",
- "K1bec8cbe": "選擇 API Key"
+ "K1bec8cbe": "選擇 API Key",
+ "K5611e01e": "該消費者已訂閱"
}
From 638b87950dce6efe0230df72148960610f50d2a5 Mon Sep 17 00:00:00 2001
From: ningyv <1793599591@qq.com>
Date: Wed, 16 Apr 2025 14:07:10 +0800
Subject: [PATCH 09/11] feature/1.7-MCP
---
.../src/components/aoplatform/UnUsedWordForTranslate.tsx | 1 +
frontend/packages/common/src/locales/scan/en-US.json | 3 ++-
frontend/packages/common/src/locales/scan/ja-JP.json | 3 ++-
frontend/packages/common/src/locales/scan/zh-CN.json | 3 ++-
frontend/packages/common/src/locales/scan/zh-TW.json | 3 ++-
5 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/frontend/packages/common/src/components/aoplatform/UnUsedWordForTranslate.tsx b/frontend/packages/common/src/components/aoplatform/UnUsedWordForTranslate.tsx
index 939fe6d9..7298d6cb 100644
--- a/frontend/packages/common/src/components/aoplatform/UnUsedWordForTranslate.tsx
+++ b/frontend/packages/common/src/components/aoplatform/UnUsedWordForTranslate.tsx
@@ -56,6 +56,7 @@ export const TranslateWord = () => {
{$t('无需审核:允许任何消费者调用该服务')}
{$t('人工审核:仅允许通过人工审核的消费者调用该服务')}
{$t('开启:AI Agent 等产品能够通过 MCP 方式调用服务')}
+ {$t('总览')}
{$t('永久')}
{$t('否')}
{$t('是')}
diff --git a/frontend/packages/common/src/locales/scan/en-US.json b/frontend/packages/common/src/locales/scan/en-US.json
index fc60e12b..53f4af02 100644
--- a/frontend/packages/common/src/locales/scan/en-US.json
+++ b/frontend/packages/common/src/locales/scan/en-US.json
@@ -926,5 +926,6 @@
"K84aabfd4": "Add API",
"K71ed51fa": "Please subscribe to the service first",
"K1bec8cbe": "Select API Key",
- "K5611e01e": "This consumer is already subscribed"
+ "K5611e01e": "This consumer is already subscribed",
+ "Kaf9e8011": "Overview"
}
diff --git a/frontend/packages/common/src/locales/scan/ja-JP.json b/frontend/packages/common/src/locales/scan/ja-JP.json
index dfc7381f..73d1938d 100644
--- a/frontend/packages/common/src/locales/scan/ja-JP.json
+++ b/frontend/packages/common/src/locales/scan/ja-JP.json
@@ -948,5 +948,6 @@
"K84aabfd4": "APIの追加",
"K71ed51fa": "このサービスに先にサブスクリプションしてください",
"K1bec8cbe": "APIキーを選択してください",
- "K5611e01e": "この消費者はすでに購読しています"
+ "K5611e01e": "この消費者はすでに購読しています",
+ "Kaf9e8011": "概要"
}
diff --git a/frontend/packages/common/src/locales/scan/zh-CN.json b/frontend/packages/common/src/locales/scan/zh-CN.json
index d90b6906..789ab22b 100644
--- a/frontend/packages/common/src/locales/scan/zh-CN.json
+++ b/frontend/packages/common/src/locales/scan/zh-CN.json
@@ -879,5 +879,6 @@
"K84aabfd4": "添加 API",
"K71ed51fa": "请先订阅该服务",
"K1bec8cbe": "选择 API Key",
- "K5611e01e": "该消费者已订阅"
+ "K5611e01e": "该消费者已订阅",
+ "Kaf9e8011": "总览"
}
diff --git a/frontend/packages/common/src/locales/scan/zh-TW.json b/frontend/packages/common/src/locales/scan/zh-TW.json
index 2ff11075..becfa911 100644
--- a/frontend/packages/common/src/locales/scan/zh-TW.json
+++ b/frontend/packages/common/src/locales/scan/zh-TW.json
@@ -948,5 +948,6 @@
"K84aabfd4": "新增 API",
"K71ed51fa": "請先訂閱該服務",
"K1bec8cbe": "選擇 API Key",
- "K5611e01e": "該消費者已訂閱"
+ "K5611e01e": "該消費者已訂閱",
+ "Kaf9e8011": "總覽"
}
From 7f83f9e37f584612c4532ae9eaed9a5fba0fafd4 Mon Sep 17 00:00:00 2001
From: ningyv <1793599591@qq.com>
Date: Wed, 16 Apr 2025 14:26:17 +0800
Subject: [PATCH 10/11] feature/1.7-MCP
---
.../core/src/pages/mcpService/IntegrationAIContainer.tsx | 4 +---
.../packages/market/src/pages/serviceHub/ServiceHubDetail.tsx | 1 +
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx b/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
index f6fe396f..5920ebd9 100644
--- a/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
+++ b/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
@@ -204,7 +204,7 @@ export const IntegrationAIContainer = forwardRef {
fetchData>(`my/app/apikeys`, {
method: 'GET',
- eoParams: { serviceId }
+ eoParams: { service: serviceId }
})
.then((response) => {
const { code, msg, data } = response
@@ -225,8 +225,6 @@ export const IntegrationAIContainer = forwardRef {
diff --git a/frontend/packages/market/src/pages/serviceHub/ServiceHubDetail.tsx b/frontend/packages/market/src/pages/serviceHub/ServiceHubDetail.tsx
index faa3b795..82e41dd5 100644
--- a/frontend/packages/market/src/pages/serviceHub/ServiceHubDetail.tsx
+++ b/frontend/packages/market/src/pages/serviceHub/ServiceHubDetail.tsx
@@ -278,6 +278,7 @@ servers:
return applyRef.current?.apply().then((res) => {
if (res === true) {
integrationAIContainerRef.current?.getServiceKeysList()
+ getMySelectList()
}
})
},
From 596f6f5668912f1e7ef73935b88216485cf120da Mon Sep 17 00:00:00 2001
From: ningyv <1793599591@qq.com>
Date: Wed, 16 Apr 2025 14:36:17 +0800
Subject: [PATCH 11/11] feature/1.7-MCP
---
.../mcpService/IntegrationAIContainer.tsx | 80 ++++++++++++++++---
1 file changed, 70 insertions(+), 10 deletions(-)
diff --git a/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx b/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
index 5920ebd9..e566305f 100644
--- a/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
+++ b/frontend/packages/core/src/pages/mcpService/IntegrationAIContainer.tsx
@@ -72,22 +72,32 @@ export const IntegrationAIContainer = forwardRef {
+ /** 当前激活的标签 */
const [activeTab, setActiveTab] = useState(type === 'service' ? 'openApi' : 'mcp')
+ /** 弹窗组件 */
const { message } = App.useApp()
+ /** 配置内容 */
const [configContent, setConfigContent] = useState('')
+ /** 当前选中 API Key */
const [apiKey, setApiKey] = useState('')
+ /** API Key 列表 */
const [apiKeyList, setApiKeyList] = useState([])
+ /** Cascader Key 列表 */
const [cascaderKeyList, setCascaderKeyList] = useState([])
+ /** MCP 服务器地址 */
const [mcpServerUrl, setMcpServerUrl] = useState('')
+ /** 全局状态 */
const { state } = useGlobalContext()
const navigator = useNavigate()
+ /** 复制组件 */
const { copyToClipboard } = useCopyToClipboard()
+ /** 错误提示 */
const [errors, setErrors] = useState>({
resources: null,
prompts: null,
tools: null
})
-
+ /** 标签内容 */
const [tabContent, setTabContent] = useState({
mcp: {
title: $t('MCP 配置'),
@@ -95,8 +105,12 @@ export const IntegrationAIContainer = forwardRef {
const params: ConfigList = {
mcp: {
@@ -127,10 +141,18 @@ export const IntegrationAIContainer = forwardRef {
setApiKey(value)
}
- const handleChange: CascaderProps