From 61c687fa201b2118264135712cbbe2e05bca19b3 Mon Sep 17 00:00:00 2001 From: CH3CHO Date: Thu, 16 Jan 2025 15:28:37 +0800 Subject: [PATCH] feat: Show port info of MCP services --- .../com/alibaba/higress/sdk/service/ServiceServiceImpl.java | 6 ++++-- frontend/src/pages/service-source/index.tsx | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/sdk/src/main/java/com/alibaba/higress/sdk/service/ServiceServiceImpl.java b/backend/sdk/src/main/java/com/alibaba/higress/sdk/service/ServiceServiceImpl.java index 62442d7b..d9a87a0d 100644 --- a/backend/sdk/src/main/java/com/alibaba/higress/sdk/service/ServiceServiceImpl.java +++ b/backend/sdk/src/main/java/com/alibaba/higress/sdk/service/ServiceServiceImpl.java @@ -38,6 +38,8 @@ @Slf4j class ServiceServiceImpl implements ServiceService { + private static final boolean SHOW_MCP_SERVICE_PORTS = true; + private final KubernetesClientService kubernetesClientService; public ServiceServiceImpl(KubernetesClientService kubernetesClientService) { @@ -65,8 +67,8 @@ public PaginatedResult list(CommonPageQuery query) { String name = registryzService.getHostname(); List endpoints = getServiceEndpoints(serviceEndpoint, namespace, name); - if (CommonKey.MCP_NAMESPACE.equals(namespace) || CollectionUtils.isEmpty(registryzService.getPorts())) { - // We don't care about the port number of services got from McpBridge. + if (CollectionUtils.isEmpty(registryzService.getPorts()) + || (!SHOW_MCP_SERVICE_PORTS && CommonKey.MCP_NAMESPACE.equals(namespace))) { Service service = new Service(); service.setName(name); service.setNamespace(namespace); diff --git a/frontend/src/pages/service-source/index.tsx b/frontend/src/pages/service-source/index.tsx index da854f2e..6fffead9 100644 --- a/frontend/src/pages/service-source/index.tsx +++ b/frontend/src/pages/service-source/index.tsx @@ -51,9 +51,6 @@ const SourceList: React.FC = () => { dataIndex: 'port', key: 'port', render: (value, record) => { - if (record.type === ServiceSourceTypes.static.key) { - return '-'; - } return value != null ? value : '-'; }, },