@nocobase/plugin-multi-app-manager 0.9.1-alpha.2 → 0.9.2-alpha.2
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/client.d.ts +4 -0
- package/client.js +30 -0
- package/lib/client/AppManager.d.ts +1 -0
- package/lib/client/AppManager.js +52 -0
- package/lib/client/AppNameInput.d.ts +2 -0
- package/lib/client/AppNameInput.js +39 -0
- package/lib/client/Settings.d.ts +1 -0
- package/lib/client/Settings.js +39 -0
- package/lib/client/index.d.ts +3 -0
- package/lib/client/index.js +118 -0
- package/lib/client/locale/pt-BR.d.ts +10 -0
- package/lib/client/locale/pt-BR.js +16 -0
- package/lib/client/locale/zh-CN.d.ts +10 -0
- package/lib/client/locale/zh-CN.js +16 -0
- package/lib/client/settings/schemas/applications.d.ts +82 -0
- package/lib/client/settings/schemas/applications.js +384 -0
- package/lib/client/utils.d.ts +4 -0
- package/lib/client/utils.js +25 -0
- package/lib/index.d.ts +1 -3
- package/lib/index.js +3 -11
- package/lib/{collections → server/collections}/applications.js +16 -29
- package/lib/server/index.d.ts +3 -0
- package/lib/server/index.js +19 -0
- package/lib/{models → server/models}/application.d.ts +2 -4
- package/lib/server/models/application.js +39 -0
- package/lib/{server.d.ts → server/server.d.ts} +3 -4
- package/lib/server/server.js +290 -0
- package/package.json +3 -3
- package/server.d.ts +4 -0
- package/server.js +30 -0
- package/lib/models/application.js +0 -94
- package/lib/server.js +0 -250
- /package/lib/{collections → server/collections}/applications.d.ts +0 -0
package/client.d.ts
ADDED
package/client.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
4
|
+
|
|
5
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
6
|
+
|
|
7
|
+
var _index = _interopRequireWildcard(require("./lib/client"));
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: true
|
|
11
|
+
});
|
|
12
|
+
var _exportNames = {};
|
|
13
|
+
Object.defineProperty(exports, "default", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _index.default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
Object.keys(_index).forEach(function (key) {
|
|
21
|
+
if (key === "default" || key === "__esModule") return;
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
23
|
+
if (key in exports && exports[key] === _index[key]) return;
|
|
24
|
+
Object.defineProperty(exports, key, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _index[key];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AppManager: () => JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AppManager = void 0;
|
|
7
|
+
function _client() {
|
|
8
|
+
const data = require("@nocobase/client");
|
|
9
|
+
_client = function _client() {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _antd() {
|
|
15
|
+
const data = require("antd");
|
|
16
|
+
_antd = function _antd() {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _react() {
|
|
22
|
+
const data = _interopRequireDefault(require("react"));
|
|
23
|
+
_react = function _react() {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
var _applications = require("./settings/schemas/applications");
|
|
29
|
+
var _utils = require("./utils");
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
const AppVisitor = () => {
|
|
32
|
+
const record = (0, _client().useRecord)();
|
|
33
|
+
const _usePluginUtils = (0, _utils.usePluginUtils)(),
|
|
34
|
+
t = _usePluginUtils.t;
|
|
35
|
+
return _react().default.createElement("a", {
|
|
36
|
+
href: `/apps/${record.name}/admin/`,
|
|
37
|
+
target: '_blank'
|
|
38
|
+
}, t('View', {
|
|
39
|
+
ns: 'client'
|
|
40
|
+
}));
|
|
41
|
+
};
|
|
42
|
+
const AppManager = () => {
|
|
43
|
+
return _react().default.createElement(_antd().Card, {
|
|
44
|
+
bordered: false
|
|
45
|
+
}, _react().default.createElement(_client().SchemaComponent, {
|
|
46
|
+
schema: _applications.schema,
|
|
47
|
+
components: {
|
|
48
|
+
AppVisitor
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
};
|
|
52
|
+
exports.AppManager = AppManager;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AppNameInput = void 0;
|
|
7
|
+
function _react() {
|
|
8
|
+
const data = require("@formily/react");
|
|
9
|
+
_react = function _react() {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _antd() {
|
|
15
|
+
const data = require("antd");
|
|
16
|
+
_antd = function _antd() {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _react2() {
|
|
22
|
+
const data = _interopRequireDefault(require("react"));
|
|
23
|
+
_react2 = function _react2() {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
const ReadPretty = props => {
|
|
30
|
+
const content = props.value && _react2().default.createElement("a", {
|
|
31
|
+
target: '_blank',
|
|
32
|
+
href: `/apps/${props.value}/admin`
|
|
33
|
+
}, props.value);
|
|
34
|
+
return _react2().default.createElement("div", {
|
|
35
|
+
style: props.style
|
|
36
|
+
}, props.addonBefore, props.prefix, content, props.suffix, props.addonAfter);
|
|
37
|
+
};
|
|
38
|
+
const AppNameInput = (0, _react().connect)(_antd().Input, (0, _react().mapReadPretty)(ReadPretty));
|
|
39
|
+
exports.AppNameInput = AppNameInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Settings: () => JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Settings = void 0;
|
|
7
|
+
function _client() {
|
|
8
|
+
const data = require("@nocobase/client");
|
|
9
|
+
_client = function _client() {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _antd() {
|
|
15
|
+
const data = require("antd");
|
|
16
|
+
_antd = function _antd() {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _react() {
|
|
22
|
+
const data = _interopRequireDefault(require("react"));
|
|
23
|
+
_react = function _react() {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
const schema = {
|
|
30
|
+
type: 'object'
|
|
31
|
+
};
|
|
32
|
+
const Settings = () => {
|
|
33
|
+
return _react().default.createElement(_antd().Card, {
|
|
34
|
+
bordered: false
|
|
35
|
+
}, _react().default.createElement(_client().SchemaComponent, {
|
|
36
|
+
schema: schema
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
exports.Settings = Settings;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
Object.defineProperty(exports, "tableActionColumnSchema", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _applications.tableActionColumnSchema;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
function _client() {
|
|
14
|
+
const data = require("@nocobase/client");
|
|
15
|
+
_client = function _client() {
|
|
16
|
+
return data;
|
|
17
|
+
};
|
|
18
|
+
return data;
|
|
19
|
+
}
|
|
20
|
+
function _antd() {
|
|
21
|
+
const data = require("antd");
|
|
22
|
+
_antd = function _antd() {
|
|
23
|
+
return data;
|
|
24
|
+
};
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
function _react() {
|
|
28
|
+
const data = _interopRequireDefault(require("react"));
|
|
29
|
+
_react = function _react() {
|
|
30
|
+
return data;
|
|
31
|
+
};
|
|
32
|
+
return data;
|
|
33
|
+
}
|
|
34
|
+
function _reactRouterDom() {
|
|
35
|
+
const data = require("react-router-dom");
|
|
36
|
+
_reactRouterDom = function _reactRouterDom() {
|
|
37
|
+
return data;
|
|
38
|
+
};
|
|
39
|
+
return data;
|
|
40
|
+
}
|
|
41
|
+
var _AppManager = require("./AppManager");
|
|
42
|
+
var _AppNameInput = require("./AppNameInput");
|
|
43
|
+
var _utils = require("./utils");
|
|
44
|
+
var _applications = require("./settings/schemas/applications");
|
|
45
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
46
|
+
const MultiAppManager = () => {
|
|
47
|
+
const history = (0, _reactRouterDom().useHistory)();
|
|
48
|
+
const _useRequest = (0, _client().useRequest)({
|
|
49
|
+
resource: 'applications',
|
|
50
|
+
action: 'listPinned'
|
|
51
|
+
}, {
|
|
52
|
+
manual: true
|
|
53
|
+
}),
|
|
54
|
+
data = _useRequest.data,
|
|
55
|
+
loading = _useRequest.loading,
|
|
56
|
+
run = _useRequest.run;
|
|
57
|
+
const _usePluginUtils = (0, _utils.usePluginUtils)(),
|
|
58
|
+
t = _usePluginUtils.t;
|
|
59
|
+
const menu = _react().default.createElement(_antd().Menu, null, ((data === null || data === void 0 ? void 0 : data.data) || []).map(app => {
|
|
60
|
+
return _react().default.createElement(_antd().Menu.Item, {
|
|
61
|
+
key: app.name,
|
|
62
|
+
onClick: () => {
|
|
63
|
+
window.open(`/apps/${app.name}/admin/`, '_blank');
|
|
64
|
+
}
|
|
65
|
+
}, app.displayName || app.name);
|
|
66
|
+
}), ((data === null || data === void 0 ? void 0 : data.data) || []).length > 0 && _react().default.createElement(_antd().Menu.Divider, null), _react().default.createElement(_antd().Menu.Item, {
|
|
67
|
+
onClick: () => {
|
|
68
|
+
history.push('/admin/settings/multi-app-manager/applications');
|
|
69
|
+
}
|
|
70
|
+
}, t('Manage applications')));
|
|
71
|
+
return _react().default.createElement(_antd().Dropdown, {
|
|
72
|
+
onVisibleChange: visible => {
|
|
73
|
+
run();
|
|
74
|
+
},
|
|
75
|
+
overlay: menu
|
|
76
|
+
}, _react().default.createElement(_antd().Button, {
|
|
77
|
+
title: 'Apps',
|
|
78
|
+
icon: _react().default.createElement(_client().Icon, {
|
|
79
|
+
type: 'AppstoreOutlined'
|
|
80
|
+
})
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
var _default = props => {
|
|
84
|
+
const _usePluginUtils2 = (0, _utils.usePluginUtils)(),
|
|
85
|
+
t = _usePluginUtils2.t;
|
|
86
|
+
return _react().default.createElement(_client().PinnedPluginListProvider, {
|
|
87
|
+
items: {
|
|
88
|
+
am: {
|
|
89
|
+
order: 201,
|
|
90
|
+
component: 'MultiAppManager',
|
|
91
|
+
pin: true
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}, _react().default.createElement(_client().SchemaComponentOptions, {
|
|
95
|
+
components: {
|
|
96
|
+
MultiAppManager,
|
|
97
|
+
AppNameInput: _AppNameInput.AppNameInput
|
|
98
|
+
}
|
|
99
|
+
}, _react().default.createElement(_client().SettingsCenterProvider, {
|
|
100
|
+
settings: {
|
|
101
|
+
'multi-app-manager': {
|
|
102
|
+
title: t('Multi-app manager'),
|
|
103
|
+
icon: 'AppstoreOutlined',
|
|
104
|
+
tabs: {
|
|
105
|
+
applications: {
|
|
106
|
+
title: t('Applications'),
|
|
107
|
+
component: () => _react().default.createElement(_AppManager.AppManager, null)
|
|
108
|
+
}
|
|
109
|
+
// settings: {
|
|
110
|
+
// title: 'Settings',
|
|
111
|
+
// component: () => <Settings />,
|
|
112
|
+
// },
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}, props.children)));
|
|
117
|
+
};
|
|
118
|
+
exports.default = _default;
|
|
@@ -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': 'Gerenciador de aplicativos múltiplos',
|
|
9
|
+
'Applications': 'Aplicativos',
|
|
10
|
+
'App display name': 'Nome de exibição do aplicativo',
|
|
11
|
+
'App ID': 'ID do aplicativo',
|
|
12
|
+
'Pin to menu': 'Fixar no menu',
|
|
13
|
+
'Custom domain': 'Domínio personalizado',
|
|
14
|
+
'Manage applications': 'Gerenciar aplicativos'
|
|
15
|
+
};
|
|
16
|
+
exports.default = _default;
|
|
@@ -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': '多应用管理',
|
|
9
|
+
Applications: '应用',
|
|
10
|
+
'App display name': '应用名称',
|
|
11
|
+
'App ID': '应用标识',
|
|
12
|
+
'Pin to menu': '在菜单上显示',
|
|
13
|
+
'Custom domain': '自定义域名',
|
|
14
|
+
'Manage applications': '管理应用'
|
|
15
|
+
};
|
|
16
|
+
exports.default = _default;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ISchema } from '@formily/react';
|
|
2
|
+
export declare const useDestroy: () => {
|
|
3
|
+
run(): Promise<void>;
|
|
4
|
+
};
|
|
5
|
+
export declare const useDestroyAll: () => {
|
|
6
|
+
run(): Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
export declare const tableActionColumnSchema: {
|
|
9
|
+
properties: {
|
|
10
|
+
view: {
|
|
11
|
+
type: string;
|
|
12
|
+
'x-component': string;
|
|
13
|
+
'x-component-props': {};
|
|
14
|
+
};
|
|
15
|
+
update: {
|
|
16
|
+
type: string;
|
|
17
|
+
title: string;
|
|
18
|
+
'x-component': string;
|
|
19
|
+
'x-component-props': {};
|
|
20
|
+
properties: {
|
|
21
|
+
drawer: {
|
|
22
|
+
type: string;
|
|
23
|
+
'x-component': string;
|
|
24
|
+
'x-decorator': string;
|
|
25
|
+
'x-decorator-props': {
|
|
26
|
+
useValues: string;
|
|
27
|
+
};
|
|
28
|
+
title: string;
|
|
29
|
+
properties: {
|
|
30
|
+
displayName: {
|
|
31
|
+
'x-component': string;
|
|
32
|
+
'x-decorator': string;
|
|
33
|
+
};
|
|
34
|
+
pinned: {
|
|
35
|
+
'x-component': string;
|
|
36
|
+
'x-decorator': string;
|
|
37
|
+
};
|
|
38
|
+
cname: {
|
|
39
|
+
title: string;
|
|
40
|
+
'x-component': string;
|
|
41
|
+
'x-decorator': string;
|
|
42
|
+
};
|
|
43
|
+
footer: {
|
|
44
|
+
type: string;
|
|
45
|
+
'x-component': string;
|
|
46
|
+
properties: {
|
|
47
|
+
cancel: {
|
|
48
|
+
title: string;
|
|
49
|
+
'x-component': string;
|
|
50
|
+
'x-component-props': {
|
|
51
|
+
useAction: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
submit: {
|
|
55
|
+
title: string;
|
|
56
|
+
'x-component': string;
|
|
57
|
+
'x-component-props': {
|
|
58
|
+
type: string;
|
|
59
|
+
useAction: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
delete: {
|
|
69
|
+
type: string;
|
|
70
|
+
title: string;
|
|
71
|
+
'x-component': string;
|
|
72
|
+
'x-component-props': {
|
|
73
|
+
confirm: {
|
|
74
|
+
title: string;
|
|
75
|
+
content: string;
|
|
76
|
+
};
|
|
77
|
+
useAction: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export declare const schema: ISchema;
|