@nocobase/plugin-data-source-manager 1.4.0-alpha.20241105010837 → 1.4.0-alpha.20241105230315
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/externalVersion.js +8 -8
- package/dist/server/plugin.js +9 -8
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.4.0-alpha.
|
|
11
|
+
"@nocobase/client": "1.4.0-alpha.20241105230315",
|
|
12
12
|
"react": "18.2.0",
|
|
13
|
-
"@nocobase/plugin-acl": "1.4.0-alpha.
|
|
14
|
-
"@nocobase/utils": "1.4.0-alpha.
|
|
15
|
-
"@nocobase/server": "1.4.0-alpha.
|
|
13
|
+
"@nocobase/plugin-acl": "1.4.0-alpha.20241105230315",
|
|
14
|
+
"@nocobase/utils": "1.4.0-alpha.20241105230315",
|
|
15
|
+
"@nocobase/server": "1.4.0-alpha.20241105230315",
|
|
16
16
|
"lodash": "4.17.21",
|
|
17
|
-
"@nocobase/data-source-manager": "1.4.0-alpha.
|
|
17
|
+
"@nocobase/data-source-manager": "1.4.0-alpha.20241105230315",
|
|
18
18
|
"@ant-design/icons": "5.2.6",
|
|
19
19
|
"antd": "5.12.8",
|
|
20
20
|
"react-router-dom": "6.21.0",
|
|
@@ -22,10 +22,10 @@ module.exports = {
|
|
|
22
22
|
"react-i18next": "11.18.6",
|
|
23
23
|
"@formily/react": "2.3.0",
|
|
24
24
|
"@emotion/css": "11.13.0",
|
|
25
|
-
"@nocobase/database": "1.4.0-alpha.
|
|
26
|
-
"@nocobase/acl": "1.4.0-alpha.
|
|
25
|
+
"@nocobase/database": "1.4.0-alpha.20241105230315",
|
|
26
|
+
"@nocobase/acl": "1.4.0-alpha.20241105230315",
|
|
27
27
|
"sequelize": "6.35.2",
|
|
28
|
-
"@nocobase/test": "1.4.0-alpha.
|
|
28
|
+
"@nocobase/test": "1.4.0-alpha.20241105230315",
|
|
29
29
|
"@formily/antd-v5": "1.1.9",
|
|
30
30
|
"@formily/core": "2.3.0",
|
|
31
31
|
"@formily/reactive": "2.3.0",
|
package/dist/server/plugin.js
CHANGED
|
@@ -132,7 +132,7 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
|
132
132
|
});
|
|
133
133
|
});
|
|
134
134
|
const app = this.app;
|
|
135
|
-
this.app.use(async (ctx, next)
|
|
135
|
+
this.app.use(async function setDataSourceListItemStatus(ctx, next) {
|
|
136
136
|
await next();
|
|
137
137
|
if (!ctx.action) {
|
|
138
138
|
return;
|
|
@@ -156,10 +156,10 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
|
156
156
|
data["status"] = "loaded";
|
|
157
157
|
return data;
|
|
158
158
|
}
|
|
159
|
-
const dataSourceStatus =
|
|
159
|
+
const dataSourceStatus = plugin.dataSourceStatus[item.get("key")];
|
|
160
160
|
data["status"] = dataSourceStatus;
|
|
161
161
|
if (dataSourceStatus === "loading-failed" || dataSourceStatus === "reloading-failed") {
|
|
162
|
-
data["errorMessage"] =
|
|
162
|
+
data["errorMessage"] = plugin.dataSourceErrors[item.get("key")].message;
|
|
163
163
|
}
|
|
164
164
|
return data;
|
|
165
165
|
})
|
|
@@ -209,7 +209,7 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
|
209
209
|
}
|
|
210
210
|
return item;
|
|
211
211
|
};
|
|
212
|
-
this.app.
|
|
212
|
+
this.app.resourceManager.use(async function setDataSourceListDefaultSort(ctx, next) {
|
|
213
213
|
if (!ctx.action) {
|
|
214
214
|
await next();
|
|
215
215
|
return;
|
|
@@ -222,7 +222,7 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
|
222
222
|
}
|
|
223
223
|
await next();
|
|
224
224
|
});
|
|
225
|
-
this.app.use(async (ctx, next)
|
|
225
|
+
this.app.use(async function handleAppendDataSourceCollection(ctx, next) {
|
|
226
226
|
await next();
|
|
227
227
|
if (!ctx.action) {
|
|
228
228
|
return;
|
|
@@ -415,7 +415,8 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
|
415
415
|
transaction
|
|
416
416
|
});
|
|
417
417
|
});
|
|
418
|
-
|
|
418
|
+
const self = this;
|
|
419
|
+
this.app.resourceManager.use(async function appendDataToRolesCheck(ctx, next) {
|
|
419
420
|
const action = ctx.action;
|
|
420
421
|
await next();
|
|
421
422
|
const { resourceName, actionName } = action.params;
|
|
@@ -424,11 +425,11 @@ class PluginDataSourceManagerServer extends import_server.Plugin {
|
|
|
424
425
|
const dataSources = await ctx.db.getRepository("dataSources").find();
|
|
425
426
|
ctx.bodyMeta = {
|
|
426
427
|
dataSources: dataSources.reduce((carry, dataSourceModel) => {
|
|
427
|
-
const dataSource =
|
|
428
|
+
const dataSource = self.app.dataSourceManager.dataSources.get(dataSourceModel.get("key"));
|
|
428
429
|
if (!dataSource) {
|
|
429
430
|
return carry;
|
|
430
431
|
}
|
|
431
|
-
const dataSourceStatus =
|
|
432
|
+
const dataSourceStatus = self.dataSourceStatus[dataSourceModel.get("key")];
|
|
432
433
|
if (dataSourceStatus !== "loaded") {
|
|
433
434
|
return carry;
|
|
434
435
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-data-source-manager",
|
|
3
|
-
"version": "1.4.0-alpha.
|
|
3
|
+
"version": "1.4.0-alpha.20241105230315",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"displayName": "Data source manager",
|
|
6
6
|
"displayName.zh-CN": "数据源管理",
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
"keywords": [
|
|
18
18
|
"Data model tools"
|
|
19
19
|
],
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "45a0f247ae2dab0d1c9d200cb8bfedae3fe49535"
|
|
21
21
|
}
|