Skip to content

Commit

Permalink
Fix clusterinstancelist bug (#2682)
Browse files Browse the repository at this point in the history
* Spotless Apply

* fix-clusterinstancelist-bug

* Spotless Apply

* delete un use code

* Spotless Apply

---------

Co-authored-by: Zzm0809 <[email protected]>
  • Loading branch information
Zzm0809 and Zzm0809 authored Dec 18, 2023
1 parent 5b80c76 commit 88f4c6c
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { InitClusterInstanceState } from '@/types/RegCenter/init.d';
import { ClusterInstanceState } from '@/types/RegCenter/state.d';
import { l } from '@/utils/intl';
import { CheckCircleOutlined, ExclamationCircleOutlined, HeartTwoTone } from '@ant-design/icons';
import { ActionType, ProList } from '@ant-design/pro-components';
import { ProList } from '@ant-design/pro-components';
import {
Badge,
Button,
Expand All @@ -57,7 +57,7 @@ import {
Tooltip,
Typography
} from 'antd';
import { useRef, useState } from 'react';
import { useState } from 'react';

const { Text, Paragraph, Link } = Typography;

Expand All @@ -69,9 +69,8 @@ export default () => {
useState<ClusterInstanceState>(InitClusterInstanceState);
const [isAutoCreate, setIsAutoCreate] = useState<boolean>(false);
const [searchKeyWord, setSearchKeyword] = useState<string>('');
const actionRef = useRef<ActionType>();

const { data, loading } = useHookRequest(getData, {
const { data, loading, refresh } = useHookRequest(getData, {
refreshDeps: [searchKeyWord, isAutoCreate],
defaultParams: [
API_CONSTANTS.CLUSTER_INSTANCE_LIST,
Expand All @@ -88,7 +87,7 @@ export default () => {
setClusterInstanceStatus((prevState) => ({ ...prevState, loading: true }));
await callback();
setClusterInstanceStatus((prevState) => ({ ...prevState, loading: false }));
actionRef.current?.reload?.();
await refresh();
};

/**
Expand Down Expand Up @@ -319,7 +318,6 @@ export default () => {
{...(PRO_LIST_CARD_OPTIONS as any)}
grid={{ gutter: 24, column: 4 }}
pagination={{ size: 'small', defaultPageSize: 12, hideOnSinglePage: true }}
actionRef={actionRef}
dataSource={data}
loading={loading}
itemLayout={'vertical'}
Expand Down

0 comments on commit 88f4c6c

Please sign in to comment.