From 1c0654001f0ba5c45208165a8c4ae13668e1e0fb Mon Sep 17 00:00:00 2001 From: Chareice Date: Wed, 6 Mar 2024 18:48:30 +0800 Subject: [PATCH] chore: data source list enabled api --- .../plugin-data-source-manager/src/server/plugin.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/server/plugin.ts b/packages/plugins/@nocobase/plugin-data-source-manager/src/server/plugin.ts index 2bb994871..154712d4d 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/server/plugin.ts +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/server/plugin.ts @@ -156,20 +156,24 @@ export class PluginDataSourceManagerServer extends Plugin { const plugin = this; const mapDataSourceWithCollection = (dataSourceModel, appendCollections = true) => { + const dataSource = app.dataSourceManager.dataSources.get(dataSourceModel.get('key')); const dataSourceStatus = plugin.dataSourceStatus[dataSourceModel.get('key')]; + // @ts-ignore + const isDBInstance = !!dataSource.collectionManager.db; + const item: any = { key: dataSourceModel.get('key'), displayName: dataSourceModel.get('displayName'), status: dataSourceStatus, + type: dataSourceModel.get('type'), + isDBInstance, }; if (dataSourceStatus === 'loading-failed' || dataSourceStatus === 'reloading-failed') { item['errorMessage'] = plugin.dataSourceErrors[dataSourceModel.get('key')].message; } - const dataSource = app.dataSourceManager.dataSources.get(dataSourceModel.get('key')); - if (!dataSource) { return item; }