diff --git a/dinky-web/src/pages/RegCenter/Cluster/Instance/components/InstanceList/index.tsx b/dinky-web/src/pages/RegCenter/Cluster/Instance/components/InstanceList/index.tsx index a4b69773f3..6687871d14 100644 --- a/dinky-web/src/pages/RegCenter/Cluster/Instance/components/InstanceList/index.tsx +++ b/dinky-web/src/pages/RegCenter/Cluster/Instance/components/InstanceList/index.tsx @@ -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, @@ -57,7 +57,7 @@ import { Tooltip, Typography } from 'antd'; -import { useRef, useState } from 'react'; +import { useState } from 'react'; const { Text, Paragraph, Link } = Typography; @@ -69,9 +69,8 @@ export default () => { useState(InitClusterInstanceState); const [isAutoCreate, setIsAutoCreate] = useState(false); const [searchKeyWord, setSearchKeyword] = useState(''); - const actionRef = useRef(); - const { data, loading } = useHookRequest(getData, { + const { data, loading, refresh } = useHookRequest(getData, { refreshDeps: [searchKeyWord, isAutoCreate], defaultParams: [ API_CONSTANTS.CLUSTER_INSTANCE_LIST, @@ -88,7 +87,7 @@ export default () => { setClusterInstanceStatus((prevState) => ({ ...prevState, loading: true })); await callback(); setClusterInstanceStatus((prevState) => ({ ...prevState, loading: false })); - actionRef.current?.reload?.(); + await refresh(); }; /** @@ -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'}