Skip to content

Commit

Permalink
fix(portal-web): dashboard的监控数据的clusterId (#1132)
Browse files Browse the repository at this point in the history
### 仪表盘的监控数据替换clusterId,适配器返回的clusterName和SCOW配置文件中的clusterId没关系
  • Loading branch information
OYX-1 authored Feb 21, 2024
1 parent 7ddb789 commit 2f687c5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/serious-llamas-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/portal-web": patch
---

仪表盘返回的监控数据替换 clusterId
14 changes: 14 additions & 0 deletions apps/portal-web/src/pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ export const DashboardPage: NextPage<Props> = requireAuth(() => true)(() => {

// 处理成功的结果
const successfulResults = rawClusterInfoResults
// 替换clusterId,适配器返回的clusterName和SCOW配置文件中的clusterId没关系
.map((result, idx) => {
if (result.status === "fulfilled") {
return {
...result,
value:{
clusterInfo:{ clusterName:clusters[idx].id,
partitions:result.value.clusterInfo.partitions },
},
} as PromiseSettledResult<FulfilledResult>;
}

return result;
})
.filter(
(result): result is PromiseFulfilledResult<FulfilledResult> =>
result.status === "fulfilled")
Expand Down

0 comments on commit 2f687c5

Please sign in to comment.