@nocobase/plugin-multi-app-manager 0.9.2-alpha.4 → 0.9.4-alpha.1
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/lib/client/AppManager.js +10 -2
- package/lib/client/index.js +6 -1
- package/lib/client/locale/es-ES.d.ts +10 -0
- package/lib/client/locale/es-ES.js +16 -0
- package/lib/client/settings/schemas/applications.d.ts +5 -0
- package/lib/client/settings/schemas/applications.js +10 -0
- package/lib/server/server.js +19 -2
- package/package.json +3 -3
package/lib/client/AppManager.js
CHANGED
|
@@ -28,12 +28,20 @@ function _react() {
|
|
|
28
28
|
var _applications = require("./settings/schemas/applications");
|
|
29
29
|
var _utils = require("./utils");
|
|
30
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
-
const
|
|
31
|
+
const useLink = () => {
|
|
32
|
+
var _record$options;
|
|
32
33
|
const record = (0, _client().useRecord)();
|
|
34
|
+
if (((_record$options = record.options) === null || _record$options === void 0 ? void 0 : _record$options.standaloneDeployment) && record.cname) {
|
|
35
|
+
return `//${record.cname}`;
|
|
36
|
+
}
|
|
37
|
+
return `/apps/${record.name}/admin/`;
|
|
38
|
+
};
|
|
39
|
+
const AppVisitor = () => {
|
|
33
40
|
const _usePluginUtils = (0, _utils.usePluginUtils)(),
|
|
34
41
|
t = _usePluginUtils.t;
|
|
42
|
+
const link = useLink();
|
|
35
43
|
return _react().default.createElement("a", {
|
|
36
|
-
href:
|
|
44
|
+
href: link,
|
|
37
45
|
target: '_blank',
|
|
38
46
|
rel: "noreferrer"
|
|
39
47
|
}, t('View', {
|
package/lib/client/index.js
CHANGED
|
@@ -57,10 +57,15 @@ const MultiAppManager = () => {
|
|
|
57
57
|
const _usePluginUtils = (0, _utils.usePluginUtils)(),
|
|
58
58
|
t = _usePluginUtils.t;
|
|
59
59
|
const menu = _react().default.createElement(_antd().Menu, null, ((data === null || data === void 0 ? void 0 : data.data) || []).map(app => {
|
|
60
|
+
var _app$options;
|
|
61
|
+
let link = `/apps/${app.name}/admin/`;
|
|
62
|
+
if (((_app$options = app.options) === null || _app$options === void 0 ? void 0 : _app$options.standaloneDeployment) && app.cname) {
|
|
63
|
+
link = `//${app.cname}`;
|
|
64
|
+
}
|
|
60
65
|
return _react().default.createElement(_antd().Menu.Item, {
|
|
61
66
|
key: app.name,
|
|
62
67
|
onClick: () => {
|
|
63
|
-
window.open(
|
|
68
|
+
window.open(link, '_blank');
|
|
64
69
|
}
|
|
65
70
|
}, app.displayName || app.name);
|
|
66
71
|
}), ((data === null || data === void 0 ? void 0 : data.data) || []).length > 0 && _react().default.createElement(_antd().Menu.Divider, null), _react().default.createElement(_antd().Menu.Item, {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
"Multi-app manager": "Gestor de aplicaciones múltiples",
|
|
9
|
+
"Applications": "Aplicaciones",
|
|
10
|
+
"App display name": "Mostrar nombre de aplicación",
|
|
11
|
+
"App ID": "ID de aplicación",
|
|
12
|
+
"Pin to menu": " Fijar al menú",
|
|
13
|
+
"Custom domain": "Dominio personalizado",
|
|
14
|
+
"Manage applications": "Gestionar aplicaciones"
|
|
15
|
+
};
|
|
16
|
+
exports.default = _default;
|
|
@@ -35,6 +35,11 @@ export declare const tableActionColumnSchema: {
|
|
|
35
35
|
'x-component': string;
|
|
36
36
|
'x-decorator': string;
|
|
37
37
|
};
|
|
38
|
+
'options.standaloneDeployment': {
|
|
39
|
+
'x-component': string;
|
|
40
|
+
'x-decorator': string;
|
|
41
|
+
'x-content': string;
|
|
42
|
+
};
|
|
38
43
|
cname: {
|
|
39
44
|
title: string;
|
|
40
45
|
'x-component': string;
|
|
@@ -152,6 +152,11 @@ const tableActionColumnSchema = {
|
|
|
152
152
|
'x-component': 'CollectionField',
|
|
153
153
|
'x-decorator': 'FormItem'
|
|
154
154
|
},
|
|
155
|
+
'options.standaloneDeployment': {
|
|
156
|
+
'x-component': 'Checkbox',
|
|
157
|
+
'x-decorator': 'FormItem',
|
|
158
|
+
'x-content': '{{t("Standalone deployment")}}'
|
|
159
|
+
},
|
|
155
160
|
cname: {
|
|
156
161
|
title: (0, _utils.i18nText)('Custom domain'),
|
|
157
162
|
'x-component': 'Input',
|
|
@@ -280,6 +285,11 @@ const schema = {
|
|
|
280
285
|
'x-component': 'CollectionField',
|
|
281
286
|
'x-decorator': 'FormItem'
|
|
282
287
|
},
|
|
288
|
+
'options.standaloneDeployment': {
|
|
289
|
+
'x-component': 'Checkbox',
|
|
290
|
+
'x-decorator': 'FormItem',
|
|
291
|
+
'x-content': '{{t("Standalone deployment")}}'
|
|
292
|
+
},
|
|
283
293
|
cname: {
|
|
284
294
|
title: (0, _utils.i18nText)('Custom domain'),
|
|
285
295
|
'x-component': 'Input',
|
package/lib/server/server.js
CHANGED
|
@@ -205,6 +205,11 @@ class PluginMultiAppManager extends _server().Plugin {
|
|
|
205
205
|
name
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
|
+
const instanceOptions = applicationRecord.get('options');
|
|
209
|
+
// skip standalone deployment application
|
|
210
|
+
if ((instanceOptions === null || instanceOptions === void 0 ? void 0 : instanceOptions.standaloneDeployment) && appManager.runningMode !== 'single') {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
208
213
|
if (!applicationRecord) {
|
|
209
214
|
return;
|
|
210
215
|
}
|
|
@@ -224,13 +229,25 @@ class PluginMultiAppManager extends _server().Plugin {
|
|
|
224
229
|
var _ref6 = _asyncToGenerator(function* (app, options) {
|
|
225
230
|
const cliArgs = options === null || options === void 0 ? void 0 : options.cliArgs;
|
|
226
231
|
const repository = _this.db.getRepository('applications');
|
|
227
|
-
const
|
|
232
|
+
const findOptions = {};
|
|
233
|
+
const appManager = _this.app.appManager;
|
|
234
|
+
if (appManager.runningMode == 'single') {
|
|
235
|
+
findOptions['filter'] = {
|
|
236
|
+
name: appManager.singleAppName
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
const instances = yield repository.find(findOptions);
|
|
228
240
|
var _iterator = _createForOfIteratorHelper(instances),
|
|
229
241
|
_step;
|
|
230
242
|
try {
|
|
231
243
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
232
244
|
const instance = _step.value;
|
|
233
|
-
const
|
|
245
|
+
const instanceOptions = instance.get('options');
|
|
246
|
+
// skip standalone deployment application
|
|
247
|
+
if ((instanceOptions === null || instanceOptions === void 0 ? void 0 : instanceOptions.standaloneDeployment) && appManager.runningMode !== 'single') {
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
const subApp = yield appManager.getApplication(instance.name, {
|
|
234
251
|
upgrading: true
|
|
235
252
|
});
|
|
236
253
|
try {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-multi-app-manager",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/server": "0.9.
|
|
9
|
+
"@nocobase/server": "0.9.4-alpha.1"
|
|
10
10
|
},
|
|
11
|
-
"gitHead": "
|
|
11
|
+
"gitHead": "0b4936be557be918dbdf8196dadcbc7eb395906d"
|
|
12
12
|
}
|