@nocobase/client 0.7.7-alpha.1 → 0.8.0-alpha.4
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/es/acl/ACLShortcut.d.ts +2 -0
- package/es/acl/ACLShortcut.js +31 -2
- package/es/application/Application.d.ts +3 -1
- package/es/application/Application.js +131 -39
- package/es/block-provider/CalendarBlockProvider.d.ts +1 -0
- package/es/block-provider/CalendarBlockProvider.js +6 -3
- package/es/block-provider/TableSelectorProvider.js +21 -6
- package/es/block-provider/hooks/index.d.ts +6 -0
- package/es/block-provider/hooks/index.js +485 -115
- package/es/collection-manager/CollectionManagerProvider.js +26 -45
- package/es/collection-manager/CollectionManagerShortcut.d.ts +2 -0
- package/es/collection-manager/CollectionManagerShortcut.js +38 -3
- package/es/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
- package/es/collection-manager/Configuration/AddFieldAction.js +44 -13
- package/es/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
- package/es/collection-manager/Configuration/EditFieldAction.js +24 -11
- package/es/collection-manager/Configuration/index.d.ts +2 -0
- package/es/collection-manager/Configuration/index.js +2 -0
- package/es/collection-manager/Configuration/schemas/collectionFields.js +2 -2
- package/es/collection-manager/index.d.ts +1 -0
- package/es/collection-manager/index.js +2 -1
- package/es/collection-manager/interfaces/index.d.ts +1 -0
- package/es/collection-manager/interfaces/index.js +1 -0
- package/es/collection-manager/interfaces/json.d.ts +2 -0
- package/es/collection-manager/interfaces/json.js +48 -0
- package/es/collection-manager/interfaces/m2o.js +3 -3
- package/es/collection-manager/interfaces/o2m.js +5 -6
- package/es/collection-manager/interfaces/o2o.js +5 -5
- package/es/collection-manager/interfaces/properties/index.d.ts +14 -0
- package/es/collection-manager/interfaces/properties/index.js +23 -0
- package/es/collection-manager/interfaces/sequence.js +13 -9
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locale/en_US.d.ts +13 -1
- package/es/locale/en_US.js +14 -2
- package/es/locale/ja_JP.d.ts +1 -1
- package/es/locale/ja_JP.js +1 -1
- package/es/locale/ru_RU.d.ts +1 -1
- package/es/locale/ru_RU.js +1 -1
- package/es/locale/tr_TR.d.ts +1 -1
- package/es/locale/tr_TR.js +1 -1
- package/es/locale/zh_CN.d.ts +39 -1
- package/es/locale/zh_CN.js +40 -2
- package/es/plugin-manager/PluginManager.js +35 -23
- package/es/pm/PluginManagerLink.d.ts +2 -0
- package/es/pm/PluginManagerLink.js +111 -0
- package/es/pm/index.d.ts +4 -0
- package/es/pm/index.js +422 -0
- package/es/route-switch/antd/admin-layout/index.js +1 -1
- package/es/schema-component/antd/action/Action.Designer.js +35 -12
- package/es/schema-component/antd/action/Action.Modal.js +4 -2
- package/es/schema-component/antd/action/Action.js +3 -3
- package/es/schema-component/antd/action/context.d.ts +2 -0
- package/es/schema-component/antd/action/hooks.d.ts +1 -0
- package/es/schema-component/antd/calendar/Calendar.Designer.js +19 -6
- package/es/schema-component/antd/calendar/Calendar.js +23 -2
- package/es/schema-component/antd/calendar/Title.js +18 -3
- package/es/schema-component/antd/calendar/components/Header.d.ts +10 -0
- package/es/schema-component/antd/calendar/components/Header.js +43 -0
- package/es/schema-component/antd/calendar/style.less +53 -9
- package/es/schema-component/antd/calendar/types.d.ts +6 -0
- package/es/schema-component/antd/calendar/utils.d.ts +2 -0
- package/es/schema-component/antd/calendar/utils.js +7 -0
- package/es/schema-component/antd/checkbox/Checkbox.js +13 -4
- package/es/schema-component/antd/formula-input/FormulaInput.js +28 -37
- package/es/schema-component/antd/input/Input.d.ts +1 -0
- package/es/schema-component/antd/input/Input.js +2 -0
- package/es/schema-component/antd/input/Json.d.ts +6 -0
- package/es/schema-component/antd/input/Json.js +41 -0
- package/es/schema-component/antd/input/ReadPretty.d.ts +3 -0
- package/es/schema-component/antd/input/ReadPretty.js +15 -0
- package/es/schema-component/antd/input/index.d.ts +1 -0
- package/es/schema-component/antd/input/index.js +2 -1
- package/es/schema-component/antd/markdown/Markdown.Void.js +5 -2
- package/es/schema-component/antd/radio/Radio.js +2 -1
- package/es/schema-component/antd/select/ReadPretty.js +2 -1
- package/es/schema-component/antd/table-v2/TableSelectorDesigner.js +16 -2
- package/es/schema-component/antd/upload/Upload.js +2 -1
- package/es/schema-component/antd/upload/shared.js +5 -6
- package/es/schema-component/antd/upload/type.d.ts +2 -0
- package/es/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/BulkEditFormItemInitializers.js +50 -0
- package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +35 -0
- package/es/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
- package/es/schema-initializer/buttons/FormActionInitializers.js +118 -0
- package/es/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/TabPaneInitializers.js +13 -0
- package/es/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
- package/es/schema-initializer/buttons/TableActionInitializers.js +45 -0
- package/es/schema-initializer/buttons/index.d.ts +2 -0
- package/es/schema-initializer/buttons/index.js +2 -0
- package/es/schema-initializer/components/BulkEditField.d.ts +7 -0
- package/es/schema-initializer/components/BulkEditField.js +187 -0
- package/es/schema-initializer/components/index.d.ts +1 -0
- package/es/schema-initializer/components/index.js +2 -1
- package/es/schema-initializer/items/BlockInitializer.js +8 -8
- package/es/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/BulkEditSubmitActionInitializer.js +24 -0
- package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
- package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +103 -0
- package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.js +61 -0
- package/es/schema-initializer/items/index.d.ts +3 -0
- package/es/schema-initializer/items/index.js +3 -0
- package/es/schema-initializer/utils.d.ts +1 -0
- package/es/schema-initializer/utils.js +67 -12
- package/es/schema-settings/SchemaSettings.d.ts +6 -0
- package/es/schema-settings/SchemaSettings.js +4 -1
- package/es/schema-templates/BlockTemplatePage.d.ts +1 -0
- package/es/schema-templates/BlockTemplatePage.js +7 -0
- package/es/schema-templates/SchemaTemplateShortcut.js +1 -1
- package/es/system-settings/SystemSettingsShortcut.d.ts +2 -0
- package/es/system-settings/SystemSettingsShortcut.js +134 -5
- package/lib/acl/ACLShortcut.d.ts +2 -0
- package/lib/acl/ACLShortcut.js +41 -4
- package/lib/application/Application.d.ts +3 -1
- package/lib/application/Application.js +139 -39
- package/lib/block-provider/CalendarBlockProvider.d.ts +1 -0
- package/lib/block-provider/CalendarBlockProvider.js +6 -3
- package/lib/block-provider/TableSelectorProvider.js +21 -6
- package/lib/block-provider/hooks/index.d.ts +6 -0
- package/lib/block-provider/hooks/index.js +496 -115
- package/lib/collection-manager/CollectionManagerProvider.js +28 -47
- package/lib/collection-manager/CollectionManagerShortcut.d.ts +2 -0
- package/lib/collection-manager/CollectionManagerShortcut.js +47 -4
- package/lib/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
- package/lib/collection-manager/Configuration/AddFieldAction.js +48 -12
- package/lib/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
- package/lib/collection-manager/Configuration/EditFieldAction.js +26 -10
- package/lib/collection-manager/Configuration/index.d.ts +2 -0
- package/lib/collection-manager/Configuration/index.js +26 -0
- package/lib/collection-manager/Configuration/schemas/collectionFields.js +2 -2
- package/lib/collection-manager/index.d.ts +1 -0
- package/lib/collection-manager/index.js +14 -0
- package/lib/collection-manager/interfaces/index.d.ts +1 -0
- package/lib/collection-manager/interfaces/index.js +13 -0
- package/lib/collection-manager/interfaces/json.d.ts +2 -0
- package/lib/collection-manager/interfaces/json.js +58 -0
- package/lib/collection-manager/interfaces/m2o.js +2 -2
- package/lib/collection-manager/interfaces/o2m.js +4 -5
- package/lib/collection-manager/interfaces/o2o.js +4 -4
- package/lib/collection-manager/interfaces/properties/index.d.ts +14 -0
- package/lib/collection-manager/interfaces/properties/index.js +25 -1
- package/lib/collection-manager/interfaces/sequence.js +13 -9
- package/lib/index.d.ts +1 -0
- package/lib/index.js +13 -0
- package/lib/locale/en_US.d.ts +13 -1
- package/lib/locale/en_US.js +14 -2
- package/lib/locale/ja_JP.d.ts +1 -1
- package/lib/locale/ja_JP.js +1 -1
- package/lib/locale/ru_RU.d.ts +1 -1
- package/lib/locale/ru_RU.js +1 -1
- package/lib/locale/tr_TR.d.ts +1 -1
- package/lib/locale/tr_TR.js +1 -1
- package/lib/locale/zh_CN.d.ts +39 -1
- package/lib/locale/zh_CN.js +40 -2
- package/lib/plugin-manager/PluginManager.js +33 -21
- package/lib/pm/PluginManagerLink.d.ts +2 -0
- package/lib/pm/PluginManagerLink.js +138 -0
- package/lib/pm/index.d.ts +4 -0
- package/lib/pm/index.js +474 -0
- package/lib/route-switch/antd/admin-layout/index.js +1 -1
- package/lib/schema-component/antd/action/Action.Designer.js +35 -12
- package/lib/schema-component/antd/action/Action.Modal.js +4 -2
- package/lib/schema-component/antd/action/Action.js +3 -3
- package/lib/schema-component/antd/action/context.d.ts +2 -0
- package/lib/schema-component/antd/action/hooks.d.ts +1 -0
- package/lib/schema-component/antd/calendar/Calendar.Designer.js +19 -6
- package/lib/schema-component/antd/calendar/Calendar.js +24 -2
- package/lib/schema-component/antd/calendar/Title.js +18 -2
- package/lib/schema-component/antd/calendar/components/Header.d.ts +10 -0
- package/lib/schema-component/antd/calendar/components/Header.js +57 -0
- package/lib/schema-component/antd/calendar/style.less +53 -9
- package/lib/schema-component/antd/calendar/types.d.ts +6 -0
- package/lib/schema-component/antd/calendar/utils.d.ts +2 -0
- package/lib/schema-component/antd/calendar/utils.js +18 -2
- package/lib/schema-component/antd/checkbox/Checkbox.js +13 -4
- package/lib/schema-component/antd/formula-input/FormulaInput.js +28 -37
- package/lib/schema-component/antd/input/Input.d.ts +1 -0
- package/lib/schema-component/antd/input/Input.js +3 -0
- package/lib/schema-component/antd/input/Json.d.ts +6 -0
- package/lib/schema-component/antd/input/Json.js +53 -0
- package/lib/schema-component/antd/input/ReadPretty.d.ts +3 -0
- package/lib/schema-component/antd/input/ReadPretty.js +16 -0
- package/lib/schema-component/antd/input/index.d.ts +1 -0
- package/lib/schema-component/antd/input/index.js +13 -0
- package/lib/schema-component/antd/markdown/Markdown.Void.js +8 -2
- package/lib/schema-component/antd/radio/Radio.js +2 -1
- package/lib/schema-component/antd/select/ReadPretty.js +2 -1
- package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +17 -2
- package/lib/schema-component/antd/upload/Upload.js +2 -1
- package/lib/schema-component/antd/upload/shared.js +4 -5
- package/lib/schema-component/antd/upload/type.d.ts +2 -0
- package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.js +66 -0
- package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +50 -0
- package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
- package/lib/schema-initializer/buttons/FormActionInitializers.js +121 -2
- package/lib/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/TabPaneInitializers.js +18 -2
- package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
- package/lib/schema-initializer/buttons/TableActionInitializers.js +45 -0
- package/lib/schema-initializer/buttons/index.d.ts +2 -0
- package/lib/schema-initializer/buttons/index.js +26 -0
- package/lib/schema-initializer/components/BulkEditField.d.ts +7 -0
- package/lib/schema-initializer/components/BulkEditField.js +210 -0
- package/lib/schema-initializer/components/index.d.ts +1 -0
- package/lib/schema-initializer/components/index.js +13 -0
- package/lib/schema-initializer/items/BlockInitializer.js +8 -7
- package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.js +37 -0
- package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +121 -0
- package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.js +74 -0
- package/lib/schema-initializer/items/index.d.ts +3 -0
- package/lib/schema-initializer/items/index.js +39 -0
- package/lib/schema-initializer/utils.d.ts +1 -0
- package/lib/schema-initializer/utils.js +71 -13
- package/lib/schema-settings/SchemaSettings.d.ts +6 -0
- package/lib/schema-settings/SchemaSettings.js +3 -0
- package/lib/schema-templates/BlockTemplatePage.d.ts +1 -0
- package/lib/schema-templates/BlockTemplatePage.js +12 -2
- package/lib/schema-templates/SchemaTemplateShortcut.js +1 -1
- package/lib/system-settings/SystemSettingsShortcut.d.ts +2 -0
- package/lib/system-settings/SystemSettingsShortcut.js +145 -7
- package/package.json +5 -4
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.SettingsCenterDropdown = exports.PluginManagerLink = void 0;
|
|
9
|
+
|
|
10
|
+
var _icons = require("@ant-design/icons");
|
|
11
|
+
|
|
12
|
+
var _shared = require("@formily/shared");
|
|
13
|
+
|
|
14
|
+
var _antd = require("antd");
|
|
15
|
+
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _reactI18next = require("react-i18next");
|
|
19
|
+
|
|
20
|
+
var _reactRouterDom = require("react-router-dom");
|
|
21
|
+
|
|
22
|
+
var _pluginManager = require("../plugin-manager");
|
|
23
|
+
|
|
24
|
+
var _schemaComponent = require("../schema-component");
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
+
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
|
|
36
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
37
|
+
|
|
38
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
+
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
42
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
43
|
+
|
|
44
|
+
var schema = {
|
|
45
|
+
type: 'object',
|
|
46
|
+
properties: _defineProperty({}, (0, _shared.uid)(), {
|
|
47
|
+
'x-component': 'Action.Drawer',
|
|
48
|
+
type: 'void',
|
|
49
|
+
title: '{{t("Collections & Fields")}}',
|
|
50
|
+
properties: {
|
|
51
|
+
configuration: {
|
|
52
|
+
'x-component': 'ConfigurationTable'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
var PluginManagerLink = function PluginManagerLink() {
|
|
59
|
+
var _useState = (0, _react.useState)(false),
|
|
60
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
61
|
+
visible = _useState2[0],
|
|
62
|
+
setVisible = _useState2[1];
|
|
63
|
+
|
|
64
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
65
|
+
t = _useTranslation.t;
|
|
66
|
+
|
|
67
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
68
|
+
return /*#__PURE__*/_react.default.createElement(_schemaComponent.ActionContext.Provider, {
|
|
69
|
+
value: {
|
|
70
|
+
visible: visible,
|
|
71
|
+
setVisible: setVisible
|
|
72
|
+
}
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_pluginManager.PluginManager.Toolbar.Item, {
|
|
74
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.AppstoreAddOutlined, null),
|
|
75
|
+
title: t('Plugin manager'),
|
|
76
|
+
onClick: function onClick() {
|
|
77
|
+
history.push('/admin/pm/list');
|
|
78
|
+
}
|
|
79
|
+
}));
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
exports.PluginManagerLink = PluginManagerLink;
|
|
83
|
+
|
|
84
|
+
var SettingsCenterDropdown = function SettingsCenterDropdown() {
|
|
85
|
+
var _useState3 = (0, _react.useState)(false),
|
|
86
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
87
|
+
visible = _useState4[0],
|
|
88
|
+
setVisible = _useState4[1];
|
|
89
|
+
|
|
90
|
+
var _useTranslation2 = (0, _reactI18next.useTranslation)(),
|
|
91
|
+
t = _useTranslation2.t;
|
|
92
|
+
|
|
93
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
94
|
+
var items = [{
|
|
95
|
+
title: t('Collections & Fields'),
|
|
96
|
+
path: 'collection-manager/collections'
|
|
97
|
+
}, {
|
|
98
|
+
title: t('Roles & Permissions'),
|
|
99
|
+
path: 'acl/roles'
|
|
100
|
+
}, {
|
|
101
|
+
title: t('File storages'),
|
|
102
|
+
path: 'file-manager/storages'
|
|
103
|
+
}, {
|
|
104
|
+
title: t('System settings'),
|
|
105
|
+
path: 'system-settings/system-settings'
|
|
106
|
+
}, {
|
|
107
|
+
title: t('Workflow'),
|
|
108
|
+
path: 'workflow/workflows'
|
|
109
|
+
}, {
|
|
110
|
+
title: t('Graph Collections'),
|
|
111
|
+
path: 'graph/collections'
|
|
112
|
+
}];
|
|
113
|
+
return /*#__PURE__*/_react.default.createElement(_schemaComponent.ActionContext.Provider, {
|
|
114
|
+
value: {
|
|
115
|
+
visible: visible,
|
|
116
|
+
setVisible: setVisible
|
|
117
|
+
}
|
|
118
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Dropdown, {
|
|
119
|
+
overlay: /*#__PURE__*/_react.default.createElement(_antd.Menu, null, /*#__PURE__*/_react.default.createElement(_antd.Menu.ItemGroup, {
|
|
120
|
+
title: t('Bookmark')
|
|
121
|
+
}, items.map(function (item) {
|
|
122
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
123
|
+
onClick: function onClick() {
|
|
124
|
+
history.push('/admin/settings/' + item.path);
|
|
125
|
+
},
|
|
126
|
+
key: item.path
|
|
127
|
+
}, item.title);
|
|
128
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Menu.Divider, null), /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
129
|
+
onClick: function onClick() {
|
|
130
|
+
history.push('/admin/settings');
|
|
131
|
+
}
|
|
132
|
+
}, t('Settings center')))
|
|
133
|
+
}, /*#__PURE__*/_react.default.createElement(_pluginManager.PluginManager.Toolbar.Item, {
|
|
134
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.SettingOutlined, null)
|
|
135
|
+
})));
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
exports.SettingsCenterDropdown = SettingsCenterDropdown;
|
package/lib/pm/index.js
ADDED
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
var _exportNames = {
|
|
9
|
+
SettingsCenterProvider: true,
|
|
10
|
+
PMProvider: true
|
|
11
|
+
};
|
|
12
|
+
exports.default = exports.SettingsCenterProvider = exports.PMProvider = void 0;
|
|
13
|
+
|
|
14
|
+
var _icons = require("@ant-design/icons");
|
|
15
|
+
|
|
16
|
+
var _css = require("@emotion/css");
|
|
17
|
+
|
|
18
|
+
var _antd = require("antd");
|
|
19
|
+
|
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
+
|
|
22
|
+
var _reactI18next = require("react-i18next");
|
|
23
|
+
|
|
24
|
+
var _reactRouterDom = require("react-router-dom");
|
|
25
|
+
|
|
26
|
+
var _acl = require("../acl");
|
|
27
|
+
|
|
28
|
+
var _apiClient = require("../api-client");
|
|
29
|
+
|
|
30
|
+
var _collectionManager = require("../collection-manager");
|
|
31
|
+
|
|
32
|
+
var _documentTitle = require("../document-title");
|
|
33
|
+
|
|
34
|
+
var _icon = require("../icon");
|
|
35
|
+
|
|
36
|
+
var _routeSwitch = require("../route-switch");
|
|
37
|
+
|
|
38
|
+
var _schemaComponent = require("../schema-component");
|
|
39
|
+
|
|
40
|
+
var _schemaTemplates = require("../schema-templates");
|
|
41
|
+
|
|
42
|
+
var _systemSettings = require("../system-settings");
|
|
43
|
+
|
|
44
|
+
var _PluginManagerLink = require("./PluginManagerLink");
|
|
45
|
+
|
|
46
|
+
Object.keys(_PluginManagerLink).forEach(function (key) {
|
|
47
|
+
if (key === "default" || key === "__esModule") return;
|
|
48
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
49
|
+
if (key in exports && exports[key] === _PluginManagerLink[key]) return;
|
|
50
|
+
Object.defineProperty(exports, key, {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function get() {
|
|
53
|
+
return _PluginManagerLink[key];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
var _excluded = ["routes"];
|
|
58
|
+
|
|
59
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
60
|
+
|
|
61
|
+
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); }
|
|
62
|
+
|
|
63
|
+
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; }
|
|
64
|
+
|
|
65
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
66
|
+
|
|
67
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
68
|
+
|
|
69
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
70
|
+
|
|
71
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
72
|
+
|
|
73
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
74
|
+
|
|
75
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
76
|
+
|
|
77
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
78
|
+
|
|
79
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
80
|
+
|
|
81
|
+
var SettingsCenterContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
82
|
+
|
|
83
|
+
var PluginCard = function PluginCard(props) {
|
|
84
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
85
|
+
var _props$data = props.data,
|
|
86
|
+
data = _props$data === void 0 ? {} : _props$data;
|
|
87
|
+
var api = (0, _apiClient.useAPIClient)();
|
|
88
|
+
|
|
89
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
90
|
+
t = _useTranslation.t;
|
|
91
|
+
|
|
92
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Card, {
|
|
93
|
+
bordered: false,
|
|
94
|
+
style: {
|
|
95
|
+
width: 'calc(20% - 24px)',
|
|
96
|
+
marginRight: 24,
|
|
97
|
+
marginBottom: 24
|
|
98
|
+
},
|
|
99
|
+
actions: [data.enabled ? /*#__PURE__*/_react.default.createElement(_icons.SettingOutlined, {
|
|
100
|
+
onClick: function onClick() {
|
|
101
|
+
history.push("/admin/settings/".concat(data.name));
|
|
102
|
+
}
|
|
103
|
+
}) : null, /*#__PURE__*/_react.default.createElement(_antd.Popconfirm, {
|
|
104
|
+
title: t('Are you sure to delete this plugin?'),
|
|
105
|
+
onConfirm: function () {
|
|
106
|
+
var _onConfirm = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
107
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
108
|
+
while (1) {
|
|
109
|
+
switch (_context.prev = _context.next) {
|
|
110
|
+
case 0:
|
|
111
|
+
_context.next = 2;
|
|
112
|
+
return api.request({
|
|
113
|
+
url: "pm:remove/".concat(data.name)
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
case 2:
|
|
117
|
+
_antd.message.success(t('插件删除成功'));
|
|
118
|
+
|
|
119
|
+
window.location.reload();
|
|
120
|
+
|
|
121
|
+
case 4:
|
|
122
|
+
case "end":
|
|
123
|
+
return _context.stop();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}, _callee);
|
|
127
|
+
}));
|
|
128
|
+
|
|
129
|
+
function onConfirm() {
|
|
130
|
+
return _onConfirm.apply(this, arguments);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return onConfirm;
|
|
134
|
+
}(),
|
|
135
|
+
onCancel: function onCancel() {},
|
|
136
|
+
okText: t('Yes'),
|
|
137
|
+
cancelText: t('No')
|
|
138
|
+
}, /*#__PURE__*/_react.default.createElement(_icons.DeleteOutlined, null)), /*#__PURE__*/_react.default.createElement(_antd.Switch, {
|
|
139
|
+
size: 'small',
|
|
140
|
+
onChange: function () {
|
|
141
|
+
var _onChange = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(checked) {
|
|
142
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
143
|
+
while (1) {
|
|
144
|
+
switch (_context2.prev = _context2.next) {
|
|
145
|
+
case 0:
|
|
146
|
+
_context2.next = 2;
|
|
147
|
+
return api.request({
|
|
148
|
+
url: "pm:".concat(checked ? 'enable' : 'disable', "/").concat(data.name)
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
case 2:
|
|
152
|
+
_antd.message.success(checked ? t('插件激活成功') : t('插件禁用成功'));
|
|
153
|
+
|
|
154
|
+
window.location.reload();
|
|
155
|
+
|
|
156
|
+
case 4:
|
|
157
|
+
case "end":
|
|
158
|
+
return _context2.stop();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}, _callee2);
|
|
162
|
+
}));
|
|
163
|
+
|
|
164
|
+
function onChange(_x) {
|
|
165
|
+
return _onChange.apply(this, arguments);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return onChange;
|
|
169
|
+
}(),
|
|
170
|
+
defaultChecked: data.enabled
|
|
171
|
+
})].filter(Boolean)
|
|
172
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Card.Meta, {
|
|
173
|
+
className: (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-card-meta-avatar {\n margin-top: 8px;\n .ant-avatar {\n border-radius: 2px;\n }\n }\n "]))),
|
|
174
|
+
avatar: /*#__PURE__*/_react.default.createElement(_antd.Avatar, null),
|
|
175
|
+
description: data.description,
|
|
176
|
+
title: /*#__PURE__*/_react.default.createElement("span", null, data.name, /*#__PURE__*/_react.default.createElement("span", {
|
|
177
|
+
className: (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: block;\n color: rgba(0, 0, 0, 0.45);\n font-weight: normal;\n font-size: 13px;\n // margin-left: 8px;\n "])))
|
|
178
|
+
}, data.version))
|
|
179
|
+
}));
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
var BuiltInPluginCard = function BuiltInPluginCard(props) {
|
|
183
|
+
var data = props.data;
|
|
184
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Card, {
|
|
185
|
+
bordered: false,
|
|
186
|
+
style: {
|
|
187
|
+
width: 'calc(20% - 24px)',
|
|
188
|
+
marginRight: 24,
|
|
189
|
+
marginBottom: 24
|
|
190
|
+
}
|
|
191
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Card.Meta, {
|
|
192
|
+
className: (0, _css.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ant-card-meta-avatar {\n margin-top: 8px;\n .ant-avatar {\n border-radius: 2px;\n }\n }\n "]))),
|
|
193
|
+
avatar: /*#__PURE__*/_react.default.createElement(_antd.Avatar, null),
|
|
194
|
+
description: data.description,
|
|
195
|
+
title: /*#__PURE__*/_react.default.createElement("span", null, data.name, /*#__PURE__*/_react.default.createElement("span", {
|
|
196
|
+
className: (0, _css.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: block;\n color: rgba(0, 0, 0, 0.45);\n font-weight: normal;\n font-size: 13px;\n // margin-left: 8px;\n "])))
|
|
197
|
+
}, data.version))
|
|
198
|
+
}));
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
var LocalPlugins = function LocalPlugins() {
|
|
202
|
+
var _data$data;
|
|
203
|
+
|
|
204
|
+
var _useRequest = (0, _apiClient.useRequest)({
|
|
205
|
+
url: 'applicationPlugins:list',
|
|
206
|
+
params: {
|
|
207
|
+
filter: {
|
|
208
|
+
'builtIn.$isFalsy': true
|
|
209
|
+
},
|
|
210
|
+
sort: 'name'
|
|
211
|
+
}
|
|
212
|
+
}),
|
|
213
|
+
data = _useRequest.data,
|
|
214
|
+
loading = _useRequest.loading;
|
|
215
|
+
|
|
216
|
+
if (loading) {
|
|
217
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Spin, null);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (item) {
|
|
221
|
+
return /*#__PURE__*/_react.default.createElement(PluginCard, {
|
|
222
|
+
data: item
|
|
223
|
+
});
|
|
224
|
+
}));
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
var BuiltinPlugins = function BuiltinPlugins() {
|
|
228
|
+
var _data$data2;
|
|
229
|
+
|
|
230
|
+
var _useRequest2 = (0, _apiClient.useRequest)({
|
|
231
|
+
url: 'applicationPlugins:list',
|
|
232
|
+
params: {
|
|
233
|
+
filter: {
|
|
234
|
+
'builtIn.$isTruly': true
|
|
235
|
+
},
|
|
236
|
+
sort: 'name'
|
|
237
|
+
}
|
|
238
|
+
}),
|
|
239
|
+
data = _useRequest2.data,
|
|
240
|
+
loading = _useRequest2.loading;
|
|
241
|
+
|
|
242
|
+
if (loading) {
|
|
243
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Spin, null);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.map(function (item) {
|
|
247
|
+
return /*#__PURE__*/_react.default.createElement(BuiltInPluginCard, {
|
|
248
|
+
data: item
|
|
249
|
+
});
|
|
250
|
+
}));
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
var MarketplacePlugins = function MarketplacePlugins() {
|
|
254
|
+
var _useTranslation2 = (0, _reactI18next.useTranslation)(),
|
|
255
|
+
t = _useTranslation2.t;
|
|
256
|
+
|
|
257
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
258
|
+
style: {
|
|
259
|
+
fontSize: 18
|
|
260
|
+
}
|
|
261
|
+
}, t('Coming soon...'));
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
var PluginList = function PluginList(props) {
|
|
265
|
+
var match = (0, _reactRouterDom.useRouteMatch)();
|
|
266
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
267
|
+
|
|
268
|
+
var _ref = match.params || {},
|
|
269
|
+
_ref$tabName = _ref.tabName,
|
|
270
|
+
tabName = _ref$tabName === void 0 ? 'local' : _ref$tabName;
|
|
271
|
+
|
|
272
|
+
var _useDocumentTitle = (0, _documentTitle.useDocumentTitle)(),
|
|
273
|
+
setTitle = _useDocumentTitle.setTitle;
|
|
274
|
+
|
|
275
|
+
var _useTranslation3 = (0, _reactI18next.useTranslation)(),
|
|
276
|
+
t = _useTranslation3.t;
|
|
277
|
+
|
|
278
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_antd.PageHeader, {
|
|
279
|
+
ghost: false,
|
|
280
|
+
title: t('Plugin manager'),
|
|
281
|
+
footer: /*#__PURE__*/_react.default.createElement(_antd.Tabs, {
|
|
282
|
+
activeKey: tabName,
|
|
283
|
+
onChange: function onChange(activeKey) {
|
|
284
|
+
history.push("/admin/pm/list/".concat(activeKey));
|
|
285
|
+
}
|
|
286
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Tabs.TabPane, {
|
|
287
|
+
tab: t('Local'),
|
|
288
|
+
key: 'local'
|
|
289
|
+
}), /*#__PURE__*/_react.default.createElement(_antd.Tabs.TabPane, {
|
|
290
|
+
tab: t('Built-in'),
|
|
291
|
+
key: 'built-in'
|
|
292
|
+
}), /*#__PURE__*/_react.default.createElement(_antd.Tabs.TabPane, {
|
|
293
|
+
tab: t('Marketplace'),
|
|
294
|
+
key: 'marketplace'
|
|
295
|
+
}))
|
|
296
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
297
|
+
style: {
|
|
298
|
+
margin: 24,
|
|
299
|
+
display: 'flex',
|
|
300
|
+
flexFlow: 'row wrap'
|
|
301
|
+
}
|
|
302
|
+
}, /*#__PURE__*/_react.default.createElement({
|
|
303
|
+
local: LocalPlugins,
|
|
304
|
+
'built-in': BuiltinPlugins,
|
|
305
|
+
marketplace: MarketplacePlugins
|
|
306
|
+
}[tabName])));
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
var settings = {
|
|
310
|
+
acl: {
|
|
311
|
+
title: '{{t("ACL")}}',
|
|
312
|
+
icon: 'LockOutlined',
|
|
313
|
+
tabs: {
|
|
314
|
+
roles: {
|
|
315
|
+
title: '{{t("Roles & Permissions")}}',
|
|
316
|
+
component: _acl.ACLPane
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
'block-templates': {
|
|
321
|
+
title: '{{t("Block templates")}}',
|
|
322
|
+
icon: 'LayoutOutlined',
|
|
323
|
+
tabs: {
|
|
324
|
+
list: {
|
|
325
|
+
title: '{{t("Block templates")}}',
|
|
326
|
+
component: _schemaTemplates.BlockTemplatesPane
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
'collection-manager': {
|
|
331
|
+
icon: 'DatabaseOutlined',
|
|
332
|
+
title: '{{t("Collection manager")}}',
|
|
333
|
+
tabs: {
|
|
334
|
+
collections: {
|
|
335
|
+
title: '{{t("Collections & Fields")}}',
|
|
336
|
+
component: _collectionManager.CollectionManagerPane
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
'system-settings': {
|
|
341
|
+
icon: 'SettingOutlined',
|
|
342
|
+
title: '{{t("System settings")}}',
|
|
343
|
+
tabs: {
|
|
344
|
+
'system-settings': {
|
|
345
|
+
title: '{{t("System settings")}}',
|
|
346
|
+
component: _systemSettings.SystemSettingsPane
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
var SettingsCenter = function SettingsCenter(props) {
|
|
353
|
+
var _items$pluginName3, _items$pluginName3$ta, _items$pluginName3$ta2, _items$pluginName4, _items$pluginName5;
|
|
354
|
+
|
|
355
|
+
var match = (0, _reactRouterDom.useRouteMatch)();
|
|
356
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
357
|
+
var items = (0, _react.useContext)(SettingsCenterContext);
|
|
358
|
+
var compile = (0, _schemaComponent.useCompile)();
|
|
359
|
+
var firstUri = (0, _react.useMemo)(function () {
|
|
360
|
+
var _items$pluginName;
|
|
361
|
+
|
|
362
|
+
var keys = Object.keys(items).sort();
|
|
363
|
+
var pluginName = keys.shift();
|
|
364
|
+
var tabName = Object.keys((items === null || items === void 0 ? void 0 : (_items$pluginName = items[pluginName]) === null || _items$pluginName === void 0 ? void 0 : _items$pluginName.tabs) || {}).shift();
|
|
365
|
+
return "/admin/settings/".concat(pluginName, "/").concat(tabName);
|
|
366
|
+
}, [items]);
|
|
367
|
+
|
|
368
|
+
var _ref2 = match.params || {},
|
|
369
|
+
pluginName = _ref2.pluginName,
|
|
370
|
+
tabName = _ref2.tabName;
|
|
371
|
+
|
|
372
|
+
if (!pluginName) {
|
|
373
|
+
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Redirect, {
|
|
374
|
+
to: firstUri
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
if (!items[pluginName]) {
|
|
379
|
+
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Redirect, {
|
|
380
|
+
to: firstUri
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
if (!tabName) {
|
|
385
|
+
var _items$pluginName2;
|
|
386
|
+
|
|
387
|
+
var firstTabName = Object.keys((_items$pluginName2 = items[pluginName]) === null || _items$pluginName2 === void 0 ? void 0 : _items$pluginName2.tabs).shift();
|
|
388
|
+
return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Redirect, {
|
|
389
|
+
to: "/admin/settings/".concat(pluginName, "/").concat(firstTabName)
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
var component = (_items$pluginName3 = items[pluginName]) === null || _items$pluginName3 === void 0 ? void 0 : (_items$pluginName3$ta = _items$pluginName3.tabs) === null || _items$pluginName3$ta === void 0 ? void 0 : (_items$pluginName3$ta2 = _items$pluginName3$ta[tabName]) === null || _items$pluginName3$ta2 === void 0 ? void 0 : _items$pluginName3$ta2.component;
|
|
394
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_antd.Layout, null, /*#__PURE__*/_react.default.createElement(_antd.Layout.Sider, {
|
|
395
|
+
theme: 'light'
|
|
396
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Menu, {
|
|
397
|
+
selectedKeys: [pluginName],
|
|
398
|
+
style: {
|
|
399
|
+
height: 'calc(100vh - 46px)'
|
|
400
|
+
}
|
|
401
|
+
}, Object.keys(items).sort().map(function (key) {
|
|
402
|
+
var item = items[key];
|
|
403
|
+
var tabKey = Object.keys(item.tabs).shift();
|
|
404
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
405
|
+
key: key,
|
|
406
|
+
icon: item.icon ? /*#__PURE__*/_react.default.createElement(_icon.Icon, {
|
|
407
|
+
type: item.icon
|
|
408
|
+
}) : null,
|
|
409
|
+
onClick: function onClick() {
|
|
410
|
+
history.push("/admin/settings/".concat(key, "/").concat(tabKey));
|
|
411
|
+
}
|
|
412
|
+
}, compile(item.title));
|
|
413
|
+
}))), /*#__PURE__*/_react.default.createElement(_antd.Layout.Content, null, /*#__PURE__*/_react.default.createElement(_antd.PageHeader, {
|
|
414
|
+
ghost: false,
|
|
415
|
+
title: compile((_items$pluginName4 = items[pluginName]) === null || _items$pluginName4 === void 0 ? void 0 : _items$pluginName4.title),
|
|
416
|
+
footer: /*#__PURE__*/_react.default.createElement(_antd.Tabs, {
|
|
417
|
+
activeKey: tabName,
|
|
418
|
+
onChange: function onChange(activeKey) {
|
|
419
|
+
history.push("/admin/settings/".concat(pluginName, "/").concat(activeKey));
|
|
420
|
+
}
|
|
421
|
+
}, Object.keys((_items$pluginName5 = items[pluginName]) === null || _items$pluginName5 === void 0 ? void 0 : _items$pluginName5.tabs).map(function (tabKey) {
|
|
422
|
+
var _items$pluginName$tab;
|
|
423
|
+
|
|
424
|
+
var tab = (_items$pluginName$tab = items[pluginName].tabs) === null || _items$pluginName$tab === void 0 ? void 0 : _items$pluginName$tab[tabKey];
|
|
425
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Tabs.TabPane, {
|
|
426
|
+
tab: compile(tab === null || tab === void 0 ? void 0 : tab.title),
|
|
427
|
+
key: tabKey
|
|
428
|
+
});
|
|
429
|
+
}))
|
|
430
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
431
|
+
style: {
|
|
432
|
+
margin: 24
|
|
433
|
+
}
|
|
434
|
+
}, component && /*#__PURE__*/_react.default.createElement(component)))));
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
var SettingsCenterProvider = function SettingsCenterProvider(props) {
|
|
438
|
+
var _props$settings = props.settings,
|
|
439
|
+
settings = _props$settings === void 0 ? {} : _props$settings;
|
|
440
|
+
var items = (0, _react.useContext)(SettingsCenterContext);
|
|
441
|
+
return /*#__PURE__*/_react.default.createElement(SettingsCenterContext.Provider, {
|
|
442
|
+
value: _objectSpread(_objectSpread({}, items), settings)
|
|
443
|
+
}, props.children);
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
exports.SettingsCenterProvider = SettingsCenterProvider;
|
|
447
|
+
|
|
448
|
+
var PMProvider = function PMProvider(props) {
|
|
449
|
+
var _useContext = (0, _react.useContext)(_routeSwitch.RouteSwitchContext),
|
|
450
|
+
routes = _useContext.routes,
|
|
451
|
+
others = _objectWithoutProperties(_useContext, _excluded);
|
|
452
|
+
|
|
453
|
+
routes[1].routes.unshift({
|
|
454
|
+
type: 'route',
|
|
455
|
+
path: '/admin/pm/list/:tabName?',
|
|
456
|
+
component: PluginList
|
|
457
|
+
}, {
|
|
458
|
+
type: 'route',
|
|
459
|
+
path: '/admin/settings/:pluginName?/:tabName?',
|
|
460
|
+
component: SettingsCenter,
|
|
461
|
+
uiSchemaUid: routes[1].uiSchemaUid
|
|
462
|
+
});
|
|
463
|
+
return /*#__PURE__*/_react.default.createElement(SettingsCenterProvider, {
|
|
464
|
+
settings: settings
|
|
465
|
+
}, /*#__PURE__*/_react.default.createElement(_routeSwitch.RouteSwitchContext.Provider, {
|
|
466
|
+
value: _objectSpread(_objectSpread({}, others), {}, {
|
|
467
|
+
routes: routes
|
|
468
|
+
})
|
|
469
|
+
}, props.children));
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
exports.PMProvider = PMProvider;
|
|
473
|
+
var _default = PMProvider;
|
|
474
|
+
exports.default = _default;
|
|
@@ -225,7 +225,7 @@ var InternalAdminLayout = function InternalAdminLayout(props) {
|
|
|
225
225
|
theme: 'light',
|
|
226
226
|
ref: sideMenuRef
|
|
227
227
|
}), /*#__PURE__*/_react.default.createElement(_antd.Layout.Content, {
|
|
228
|
-
className: (0, _css.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-height: calc(100vh - 46px);\n position: relative;\n padding-bottom: 70px;\n > div {\n position: relative;\n z-index: 1;\n }\n .ant-layout-footer {\n position: absolute;\n bottom: 0;\n text-align: center;\n width: 100%;\n z-index: 0;\n }\n "])))
|
|
228
|
+
className: (0, _css.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-height: calc(100vh - 46px);\n padding-bottom: 42px;\n position: relative;\n // padding-bottom: 70px;\n > div {\n position: relative;\n // z-index: 1;\n }\n .ant-layout-footer {\n position: absolute;\n bottom: 0;\n text-align: center;\n width: 100%;\n z-index: 0;\n padding: 10px 50px;\n }\n "])))
|
|
229
229
|
}, service.contentLoading ? /*#__PURE__*/_react.default.createElement(_antd.Spin, null) : props.children, /*#__PURE__*/_react.default.createElement(_antd.Layout.Footer, null, /*#__PURE__*/_react.default.createElement(_poweredBy.PoweredBy, null)))));
|
|
230
230
|
};
|
|
231
231
|
|