From 94e3ebb066f0ca43b82a92d4d6023e33d60a334d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=95=85=E6=99=9A?= Date: Wed, 7 Aug 2024 16:29:01 +0800 Subject: [PATCH] PullRequest: 496 Fixes oceanbase/odc#3110 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge branch 'fix/dev-4.3.1-3110 of git@code.alipay.com:oceanbase/oceanbase-developer-center.git into dev-4.3.1 https://code.alipay.com/oceanbase/oceanbase-developer-center/pull_requests/496 Signed-off-by: 晓康 * Fixes oceanbase/odc#3110、 --- src/component/Task/component/DatabaseSelecter/index.tsx | 2 ++ src/component/Task/component/TableSelecter/index.tsx | 2 ++ 2 files changed, 4 insertions(+) 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: [],