diff --git a/shell/app/modules/msp/env-overview/topology/pages/topology/component/topology-comp.tsx b/shell/app/modules/msp/env-overview/topology/pages/topology/component/topology-comp.tsx index 79a5ce2cf2..e424a51ef4 100644 --- a/shell/app/modules/msp/env-overview/topology/pages/topology/component/topology-comp.tsx +++ b/shell/app/modules/msp/env-overview/topology/pages/topology/component/topology-comp.tsx @@ -48,8 +48,8 @@ const genEle = (nodes: TOPOLOGY.INode[], filterKey: INodeKey) => { let node = genNodes(nodes, edge); switch (filterKey) { case 'unhealthyService': - edge = edge.filter((t) => t.data?.isUnhealthy); - node = node.filter((t) => t.data?.isUnhealthy); + edge = edge.filter((t) => t.data?.isUnhealthy && t.data.isService); + node = node.filter((t) => t.data?.isUnhealthy && t.data.isService); break; case 'addon': edge = edge.filter((t) => t.data?.isAddon); @@ -65,7 +65,7 @@ const genEle = (nodes: TOPOLOGY.INode[], filterKey: INodeKey) => { break; case 'freeService': edge = []; - node = node.filter((t) => t.data?.parentCount === 0 && t.data?.childrenCount === 0); + node = node.filter((t) => t.data?.parentCount === 0 && t.data.childrenCount === 0 && t.data.isService); break; } return { node, edge }; diff --git a/shell/app/modules/msp/env-overview/topology/pages/topology/component/topology-overview.tsx b/shell/app/modules/msp/env-overview/topology/pages/topology/component/topology-overview.tsx index ae033e8447..6f1a1e8f37 100644 --- a/shell/app/modules/msp/env-overview/topology/pages/topology/component/topology-overview.tsx +++ b/shell/app/modules/msp/env-overview/topology/pages/topology/component/topology-overview.tsx @@ -13,7 +13,7 @@ import React from 'react'; import i18n from 'i18n'; -import { genEdges, genNodes, notAddonTypes, servicesTypes } from 'msp/env-overview/topology/pages/topology/utils'; +import { genEdges, genNodes } from 'msp/env-overview/topology/pages/topology/utils'; import ErdaIcon from 'common/components/erda-icon'; export type INodeKey = 'node' | 'service' | 'addon' | 'unhealthyService' | 'freeService' | 'circularDependencies'; @@ -82,18 +82,17 @@ const TopologyOverview: React.FC = ({ data, onClick }) => { temp.node = node.length; node.forEach((item) => { if (item.data?.metaData) { - const { parentCount, childrenCount, metaData, isCircular } = item.data; - const { metric, type } = metaData; - if (metric.error_rate > 0) { + const { parentCount, childrenCount, isCircular, isService, isUnhealthy, isAddon } = item.data; + if (isUnhealthy && isService) { temp.unhealthyService = temp.unhealthyService + 1; } - if (servicesTypes.includes(type.toLocaleLowerCase())) { + if (isService) { temp.service = temp.service + 1; } - if (!notAddonTypes.includes(type.toLocaleLowerCase())) { + if (isAddon) { temp.addon = temp.addon + 1; } - if (parentCount === 0 && childrenCount === 0) { + if (parentCount === 0 && childrenCount === 0 && isService) { temp.freeService = temp.freeService + 1; } if (isCircular) {