diff --git a/src/component/Task/component/DatabaseSelecter/index.tsx b/src/component/Task/component/DatabaseSelecter/index.tsx index dadc3bf7b..3dc447590 100644 --- a/src/component/Task/component/DatabaseSelecter/index.tsx +++ b/src/component/Task/component/DatabaseSelecter/index.tsx @@ -25,6 +25,7 @@ import Icon, { DeleteOutlined } from '@ant-design/icons'; import { Empty, Popconfirm, Space, Spin, Tree, Typography, Checkbox, Tooltip } from 'antd'; import classnames from 'classnames'; import styles from './index.less'; +import datasourceStatus from '@/store/datasourceStatus'; const { Text } = Typography; @@ -52,6 +53,7 @@ const DatabaseSelecter: React.FC = function ({ try { const res = await listDatabases(projectId, null, null, null, null, null, null, true, null); if (res?.contents) { + datasourceStatus.asyncUpdateStatus(res?.contents?.map((item) => item?.dataSource?.id)); setDatabaseList(res?.contents); } } catch (e) { diff --git a/src/component/Task/component/TableSelecter/index.tsx b/src/component/Task/component/TableSelecter/index.tsx index cb11299f0..423256b2b 100644 --- a/src/component/Task/component/TableSelecter/index.tsx +++ b/src/component/Task/component/TableSelecter/index.tsx @@ -38,6 +38,7 @@ import { isNumber } from 'lodash'; import styles from './index.less'; import { EnvColorMap } from '@/constant'; import DataBaseStatusIcon from '@/component/StatusIcon/DatabaseIcon'; +import datasourceStatus from '@/store/datasourceStatus'; export type TableItem = { databaseId: number; tableName: string; tableId?: number }; @@ -222,6 +223,7 @@ const TableSelecter: React.ForwardRefRenderFunction = try { const res = await listDatabases(projectId, null, null, null, null, null, null, true, true); if (res?.contents) { + datasourceStatus.asyncUpdateStatus(res?.contents?.map((item) => item?.dataSource?.id)); const list: IDataBaseWithTable[] = res.contents.map((db) => ({ ...db, tableList: [],