Skip to content

Commit 854e755

Browse files
authored
fix:新增初次进入租户sql 分析页面,loading展示 (#910)
1 parent b5d3c14 commit 854e755

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

ui/src/pages/Tenant/Detail/Sql/index.tsx

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { intl } from '@/utils/intl';
88
import { SettingOutlined } from '@ant-design/icons';
99
import type { ActionType, ProColumns } from '@ant-design/pro-components';
1010
import { ProTable } from '@ant-design/pro-components';
11+
import { Spin } from '@oceanbase/design';
1112
import {
1213
Link,
1314
history,
@@ -201,12 +202,13 @@ export default function SqlList() {
201202
},
202203
);
203204

204-
const { data: tenantDetailResponse, run: getTenantDetail } = useRequest(
205-
getTenant,
206-
{
207-
defaultParams: [{ ns: ns!, name: name! }],
208-
},
209-
);
205+
const {
206+
data: tenantDetailResponse,
207+
run: getTenantDetail,
208+
loading: tenantDetailLoading,
209+
} = useRequest(getTenant, {
210+
defaultParams: [{ ns: ns!, name: name! }],
211+
});
210212

211213
const defaultSqlAnalyzer = tenantDetailResponse?.info?.sqlAnalyzerEnabled;
212214

@@ -609,13 +611,25 @@ export default function SqlList() {
609611
padding: 24,
610612
}}
611613
>
612-
{defaultSqlAnalyzer ? (
614+
{tenantDetailLoading ? (
615+
<div
616+
style={{
617+
display: 'flex',
618+
alignItems: 'center',
619+
justifyContent: 'center',
620+
minHeight: 'calc(100vh - 98px)',
621+
}}
622+
>
623+
<Spin />
624+
</div>
625+
) : defaultSqlAnalyzer ? (
613626
<>
614627
<ProTable<API.SqlInfo>
615628
headerTitle={intl.formatMessage({
616629
id: 'src.pages.Tenant.Detail.Sql.SqlAnalysis',
617630
defaultMessage: 'SQL 分析',
618631
})}
632+
loading={tenantDetailLoading}
619633
actionRef={actionRef}
620634
rowKey={(record) =>
621635
`${record.sqlId}_${record.svrIp}_${record.svrPort}_${record.planId}_${record.userName}_${record.dbName}`

0 commit comments

Comments
 (0)