Skip to content

Commit

Permalink
feat(mis-web): 集群和分区信息数据异步请求页面优化 (#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
piccaSun authored Feb 27, 2024
1 parent c422651 commit a970dc7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-forks-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scow/mis-web": patch
---

优化管理系统用户可见分区页面 Loading 样式
1 change: 1 addition & 0 deletions apps/mis-web/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ export default {
getBillingTableErrorMessage: "Failed to retrieve cluster and partition information. "
+ "Please contact the administrator.",
partitionInfo: "Partition Information",
loading: "Loading partitions...",
},
operationLogs: {
userOperationLog: "User Operation Log",
Expand Down
1 change: 1 addition & 0 deletions apps/mis-web/src/i18n/zh_cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ export default {
getBillingTableErrorMessage: "集群和分区信息获取失败,请联系管理员。",

partitionInfo: "分区信息",
loading: "数据加载中...",
},
operationLogs: {
userOperationLog: "本用户操作日志",
Expand Down
23 changes: 18 additions & 5 deletions apps/mis-web/src/pages/user/partitions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import { ClusterTextsConfigSchema } from "@scow/config/build/clusterTexts";
import { getI18nConfigCurrentText } from "@scow/lib-web/build/utils/systemLanguage";
import { Collapse, Divider, Spin, Typography } from "antd";
import { Collapse, Divider, Space, Spin, Typography } from "antd";
import { GetServerSideProps, NextPage } from "next";
import { useCallback, useState } from "react";
import { useAsync } from "react-async";
Expand Down Expand Up @@ -84,9 +84,22 @@ export const PartitionsPage: NextPage<Props> = requireAuth(() => true)((props: P
<div>
<Head title={t(p("partitionInfo"))} />
<PageTitle titleText={t(p("partitionInfo"))} />

<div style={{ marginBottom: "32px" }}>
<Spin spinning={completedRequestCount < clusters.length}>
<div>
{
completedRequestCount < clusters.length ? (
<Spin
spinning={completedRequestCount < clusters.length}
tip={t(p("loading"))}
>
<></>
</Spin>
) : null
}
</div>
<div style={completedRequestCount < clusters.length
? { marginBottom: "32px", marginTop: "48px" } : { marginBottom: "32px" }}
>
<Space direction="vertical" style={{ width: "100%" }}>
{clusters.map((cluster) => {
const data = renderData[cluster.id];
return (
Expand All @@ -105,7 +118,7 @@ export const PartitionsPage: NextPage<Props> = requireAuth(() => true)((props: P
) : null
);
})}
</Spin>
</Space>
</div>

<div>
Expand Down

0 comments on commit a970dc7

Please sign in to comment.