Skip to content

Commit ad3eef4

Browse files
committed
fix: topo 图,zone 数量展示不正确
1 parent 89d8d52 commit ad3eef4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

ui/src/components/TopoComponent/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,11 @@ export default function TopoComponent({
485485
}, []);
486486
const isCreateResourcePool = modalType.current === 'createResourcePools';
487487
// Use different pictures for nodes in different states
488+
489+
const topology = {
490+
topology: originTopoData?.topoData?.children,
491+
...(originTopoData?.basicInfo as API.ClusterInfo),
492+
};
488493
return (
489494
<div style={{ position: 'relative', height: '100vh' }}>
490495
{header
@@ -493,7 +498,7 @@ export default function TopoComponent({
493498
<BasicInfo
494499
extra={false}
495500
style={{ backgroundColor: '#f5f8fe', border: 'none' }}
496-
{...(originTopoData.basicInfo as API.ClusterInfo)}
501+
{...(topology as API.ClusterInfo)}
497502
/>
498503
)}
499504

ui/src/pages/Cluster/Detail/Overview/BasicInfo.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ export default function BasicInfo({
289289
})}
290290
>
291291
{(
292-
props.topology?.map((zone) => zone.observers?.length ?? ' / ') ?? []
292+
props.topology?.map(
293+
(zone) => (zone.observers || zone.children)?.length ?? ' / ',
294+
) ?? []
293295
).join('-')}
294296
</Descriptions.Item>
295297
<Descriptions.Item

0 commit comments

Comments
 (0)