Skip to content

Commit

Permalink
fix(mis): 修复了当getClusterNodesInfo接口不存在时,进度条为NaN的情况 (#1418)
Browse files Browse the repository at this point in the history
  • Loading branch information
usaveh authored Sep 2, 2024
1 parent a47aa76 commit 213c7f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/six-lobsters-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/portal-web": patch
---

修复了当 getClusterNodesInfo 接口不存在时,进度条为 NaN 的情况。
22 changes: 12 additions & 10 deletions apps/portal-web/src/pageComponents/dashboard/OverviewTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,18 @@ export const OverviewTable: React.FC<Props> = ({ clusterInfo, failedClusters,
compareWithUndefined(a.info?.usageRatePercentage, b.info?.usageRatePercentage, sortOrder)}
hidden={clusterInfo.every((item) => item.usageRatePercentage === undefined)}
render={(_, r) => (
r.info?.usageRatePercentage !== undefined ? (
<div>
<CustomProgress
percent={Math.min(Number(r.info?.usageRatePercentage.toFixed(2) ?? 0), 100)}
width="120px"
height="15px"
bgColor={gray[0]}
progressColor={blue[5]}
/>
</div>
(r.info?.usageRatePercentage !== undefined && !isNaN(r.info.usageRatePercentage)) ? (
(
<div>
<CustomProgress
percent={Math.min(Number(r.info?.usageRatePercentage.toFixed(2) ?? 0), 100)}
width="120px"
height="15px"
bgColor={gray[0]}
progressColor={blue[5]}
/>
</div>
)
) : "-"
)}
/>
Expand Down

0 comments on commit 213c7f2

Please sign in to comment.