@riil-frontend/component-topology 11.0.33 → 11.0.35
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/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +4 -2
- package/build/index.js +52 -45
- package/es/components/MultiResourceDrawer/index.js +22 -26
- package/es/components/ResourceList/ResourceSelect.js +55 -58
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
- package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
- package/es/core/editor/components/BackgroundView/index.js +149 -178
- package/es/core/editor/components/BackgroundView/index.module.scss +2 -1
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
- package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/es/core/editor/hooks/useNewElementTheme.js +2 -2
- package/es/core/editor/store/background.js +8 -10
- package/es/core/editor/store/topoEdit.js +4 -6
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +130 -142
- package/es/core/hooks/useResourceConfig.js +76 -100
- package/es/core/hooks/useTopoEdit.js +525 -623
- package/es/core/models/Alarm.js +319 -402
- package/es/core/models/AttributeMetricDisplay.js +115 -143
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +279 -436
- package/es/core/models/TopoGraphView.js +28 -41
- package/es/core/models/cache/CiCache.js +34 -39
- package/es/core/models/cache/CiTypeCache.js +47 -61
- package/es/core/models/cache/DictCache.js +36 -42
- package/es/core/models/graph/Background.js +21 -26
- package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
- package/es/core/models/tagstips/ElementTagTipConfig.js +44 -58
- package/es/core/models/topoData.js +73 -77
- package/es/core/models/utils/linkUtils.js +46 -51
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/es/core/services/alarm.js +14 -16
- package/es/core/services/background.js +59 -67
- package/es/core/services/cmdb/metric.js +14 -18
- package/es/core/services/cmdb.js +23 -27
- package/es/core/services/index.js +48 -68
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +37 -41
- package/es/core/services/topo/tagtip.js +15 -19
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +126 -145
- package/es/core/store/models/displayConfig.js +15 -19
- package/es/core/store/models/selection.js +4 -6
- package/es/core/store/models/topoAlarm.js +162 -145
- package/es/core/store/models/topoBaseInfoOverview.js +4 -6
- package/es/core/store/models/topoBizMod.js +9 -11
- package/es/core/store/models/topoConfig.js +215 -231
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +373 -395
- package/es/core/utils/imageUtil.js +23 -27
- package/es/core/utils/saveSerialize.js +14 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
- package/es/networkTopo/components/Link/hook.js +85 -96
- package/es/networkTopo/components/Link/index.js +104 -126
- package/es/networkTopo/components/Link/setting.js +48 -52
- package/es/networkTopo/getTopoData.js +73 -92
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +28 -46
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +548 -696
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +33 -48
- package/es/networkTopo/services/metric.js +38 -47
- package/es/networkTopo/services/model.js +616 -809
- package/es/networkTopo/services/risk.js +9 -11
- package/es/networkTopo/services/topo/auth.js +27 -33
- package/es/networkTopo/services/topo/basic.js +251 -289
- package/es/networkTopo/services/topo/blacklist.js +20 -24
- package/es/networkTopo/services/topo/ciInfo.js +27 -31
- package/es/networkTopo/services/topo/icon.js +49 -59
- package/es/networkTopo/services/topo/networkLink.js +32 -36
- package/es/networkTopo/services/topo/relation.js +9 -11
- package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
- package/es/networkTopo/store/functionAuth.js +31 -37
- package/es/networkTopo/store/topoCenter.js +142 -152
- package/es/networkTopo/store/topoLinkMod.js +4 -6
- package/es/networkTopo/store/topoTreeMod.js +170 -182
- package/es/networkTopo/utils/exportData.js +57 -61
- package/lib/components/MultiResourceDrawer/index.js +22 -26
- package/lib/components/ResourceList/ResourceSelect.js +54 -58
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
- package/lib/core/editor/components/BackgroundView/index.js +148 -177
- package/lib/core/editor/components/BackgroundView/index.module.scss +2 -1
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
- package/lib/core/editor/store/background.js +8 -10
- package/lib/core/editor/store/topoEdit.js +4 -6
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +129 -141
- package/lib/core/hooks/useResourceConfig.js +76 -100
- package/lib/core/hooks/useTopoEdit.js +517 -615
- package/lib/core/models/Alarm.js +313 -396
- package/lib/core/models/AttributeMetricDisplay.js +118 -146
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +279 -436
- package/lib/core/models/TopoGraphView.js +28 -41
- package/lib/core/models/cache/CiCache.js +39 -44
- package/lib/core/models/cache/CiTypeCache.js +48 -62
- package/lib/core/models/cache/DictCache.js +39 -45
- package/lib/core/models/graph/Background.js +22 -27
- package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
- package/lib/core/models/tagstips/ElementTagTipConfig.js +44 -58
- package/lib/core/models/topoData.js +73 -78
- package/lib/core/models/utils/linkUtils.js +45 -51
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/lib/core/services/alarm.js +18 -20
- package/lib/core/services/background.js +70 -78
- package/lib/core/services/cmdb/metric.js +14 -19
- package/lib/core/services/cmdb.js +24 -29
- package/lib/core/services/index.js +53 -72
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +37 -41
- package/lib/core/services/topo/tagtip.js +16 -21
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +126 -145
- package/lib/core/store/models/displayConfig.js +15 -19
- package/lib/core/store/models/selection.js +4 -6
- package/lib/core/store/models/topoAlarm.js +163 -145
- package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
- package/lib/core/store/models/topoBizMod.js +9 -11
- package/lib/core/store/models/topoConfig.js +222 -238
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +375 -397
- package/lib/core/utils/imageUtil.js +26 -31
- package/lib/core/utils/saveSerialize.js +13 -18
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
- package/lib/networkTopo/components/Link/hook.js +86 -98
- package/lib/networkTopo/components/Link/index.js +105 -127
- package/lib/networkTopo/components/Link/setting.js +48 -52
- package/lib/networkTopo/getTopoData.js +73 -92
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +28 -46
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +551 -700
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +35 -51
- package/lib/networkTopo/services/metric.js +37 -47
- package/lib/networkTopo/services/model.js +615 -809
- package/lib/networkTopo/services/risk.js +11 -13
- package/lib/networkTopo/services/topo/auth.js +27 -33
- package/lib/networkTopo/services/topo/basic.js +252 -290
- package/lib/networkTopo/services/topo/blacklist.js +20 -24
- package/lib/networkTopo/services/topo/ciInfo.js +34 -38
- package/lib/networkTopo/services/topo/icon.js +59 -69
- package/lib/networkTopo/services/topo/networkLink.js +32 -36
- package/lib/networkTopo/services/topo/relation.js +11 -13
- package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
- package/lib/networkTopo/store/functionAuth.js +31 -37
- package/lib/networkTopo/store/topoCenter.js +142 -152
- package/lib/networkTopo/store/topoLinkMod.js +4 -6
- package/lib/networkTopo/store/topoTreeMod.js +166 -178
- package/lib/networkTopo/utils/exportData.js +63 -68
- package/package.json +4 -3
@@ -4,6 +4,8 @@ import React, { useRef } from 'react';
|
|
4
4
|
import NetworkTopoResourceSelectDrawer from "../NetworkTopoResourceSelectDrawer";
|
5
5
|
|
6
6
|
var MultiResourceDrawer = function MultiResourceDrawer(props) {
|
7
|
+
var _ref;
|
8
|
+
|
7
9
|
var visible = props.visible,
|
8
10
|
mode = props.mode,
|
9
11
|
initialData = props.initialData,
|
@@ -11,36 +13,30 @@ var MultiResourceDrawer = function MultiResourceDrawer(props) {
|
|
11
13
|
onSave = props.onSave,
|
12
14
|
onClose = props.onClose;
|
13
15
|
|
14
|
-
var onDrawerSave =
|
15
|
-
|
16
|
+
var onDrawerSave = function onDrawerSave(_x) {
|
17
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
|
16
18
|
var result;
|
17
19
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
18
|
-
while (1) {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
return _context.stop();
|
35
|
-
}
|
20
|
+
while (1) switch (_context.prev = _context.next) {
|
21
|
+
case 0:
|
22
|
+
result = selected;
|
23
|
+
|
24
|
+
if (mode === 'all') {
|
25
|
+
result = {
|
26
|
+
"static": [].concat(initialData["static"], selected)
|
27
|
+
};
|
28
|
+
}
|
29
|
+
|
30
|
+
_context.next = 4;
|
31
|
+
return onSave(result);
|
32
|
+
|
33
|
+
case 4:
|
34
|
+
case "end":
|
35
|
+
return _context.stop();
|
36
36
|
}
|
37
37
|
}, _callee);
|
38
|
-
}));
|
39
|
-
|
40
|
-
return function onDrawerSave(_x) {
|
41
|
-
return _ref.apply(this, arguments);
|
42
|
-
};
|
43
|
-
}();
|
38
|
+
}))).apply(this, arguments);
|
39
|
+
};
|
44
40
|
|
45
41
|
return /*#__PURE__*/React.createElement(NetworkTopoResourceSelectDrawer, {
|
46
42
|
visible: visible,
|
@@ -1,4 +1,7 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
|
3
|
+
var _ref;
|
4
|
+
|
2
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
6
|
import React, { useEffect, useImperativeHandle } from 'react';
|
4
7
|
import _ from 'lodash';
|
@@ -15,73 +18,67 @@ import styles from "./ResourceSelect.module.scss";
|
|
15
18
|
import { RESOURCE_LIMIT_TYPES } from "../../constants/ResourceTypeLimit";
|
16
19
|
var PRIMARY_KEY = 'id';
|
17
20
|
|
18
|
-
var getTableData =
|
19
|
-
|
21
|
+
var getTableData = function getTableData(_x) {
|
22
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
|
20
23
|
var _params$current, current, _params$pageSize, pageSize, _params$sortBy, sortBy, _params$sortOrder, sortOrder, like, typeCode, condition, ciType, data, dataSource;
|
21
24
|
|
22
25
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
23
|
-
while (1) {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
while (1) switch (_context.prev = _context.next) {
|
27
|
+
case 0:
|
28
|
+
_params$current = params.current, current = _params$current === void 0 ? 1 : _params$current, _params$pageSize = params.pageSize, pageSize = _params$pageSize === void 0 ? 20 : _params$pageSize, _params$sortBy = params.sortBy, sortBy = _params$sortBy === void 0 ? 'displayName' : _params$sortBy, _params$sortOrder = params.sortOrder, sortOrder = _params$sortOrder === void 0 ? 'asc' : _params$sortOrder, like = params.like, typeCode = params.typeCode;
|
29
|
+
condition = "type('" + RESOURCE_LIMIT_TYPES.join('\',\'') + "') && category('resource')";
|
30
|
+
|
31
|
+
if (like) {
|
32
|
+
condition = {
|
33
|
+
conditions: condition,
|
34
|
+
searchValue: like,
|
35
|
+
searchIndexArray: ['display_name', 'ipv4_address']
|
36
|
+
};
|
37
|
+
}
|
38
|
+
|
39
|
+
if (typeCode) {
|
40
|
+
ciType = typeCode.split(',');
|
41
|
+
|
42
|
+
if (typeof condition === 'string') {
|
30
43
|
condition = {
|
31
44
|
conditions: condition,
|
32
|
-
|
33
|
-
searchIndexArray: ['display_name', 'ipv4_address']
|
45
|
+
ciType: ciType
|
34
46
|
};
|
47
|
+
} else {
|
48
|
+
condition.ciType = ciType;
|
35
49
|
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
ipAddress: item.attributes.ipAddress || item.attributes.ipv4_address,
|
65
|
-
company: item.attributes.company,
|
66
|
-
typeCode: item.typeCode,
|
67
|
-
operation: (_item$operation = item.operation) !== null && _item$operation !== void 0 ? _item$operation : null // 权限字段
|
68
|
-
|
69
|
-
};
|
70
|
-
});
|
71
|
-
return _context.abrupt("return", formatDataForTable(dataSource, data.totalRecord, data.pageIndex, data.pageSize));
|
72
|
-
|
73
|
-
case 9:
|
74
|
-
case "end":
|
75
|
-
return _context.stop();
|
76
|
-
}
|
50
|
+
}
|
51
|
+
|
52
|
+
_context.next = 6;
|
53
|
+
return fetchCommonQuery(condition, sortBy, sortOrder, current, pageSize, '', {
|
54
|
+
usingExtraConditions: false // 绕过权限过滤
|
55
|
+
|
56
|
+
});
|
57
|
+
|
58
|
+
case 6:
|
59
|
+
data = _context.sent;
|
60
|
+
dataSource = data.content && data.content.map(function (item) {
|
61
|
+
var _item$operation;
|
62
|
+
|
63
|
+
return {
|
64
|
+
id: item.id,
|
65
|
+
displayName: item.attributes.displayName || item.attributes.display_name,
|
66
|
+
ipAddress: item.attributes.ipAddress || item.attributes.ipv4_address,
|
67
|
+
company: item.attributes.company,
|
68
|
+
typeCode: item.typeCode,
|
69
|
+
operation: (_item$operation = item.operation) !== null && _item$operation !== void 0 ? _item$operation : null // 权限字段
|
70
|
+
|
71
|
+
};
|
72
|
+
});
|
73
|
+
return _context.abrupt("return", formatDataForTable(dataSource, data.totalRecord, data.pageIndex, data.pageSize));
|
74
|
+
|
75
|
+
case 9:
|
76
|
+
case "end":
|
77
|
+
return _context.stop();
|
77
78
|
}
|
78
79
|
}, _callee);
|
79
|
-
}));
|
80
|
-
|
81
|
-
return function getTableData(_x) {
|
82
|
-
return _ref.apply(this, arguments);
|
83
|
-
};
|
84
|
-
}();
|
80
|
+
}))).apply(this, arguments);
|
81
|
+
};
|
85
82
|
|
86
83
|
var ResourceList = function ResourceList(props, ref) {
|
87
84
|
var customGetTableData = props.getTableData,
|
@@ -15,6 +15,8 @@ import styles from "./ResourceSelectDrawer.module.scss";
|
|
15
15
|
*/
|
16
16
|
|
17
17
|
function ResourceSelectDrawer(props) {
|
18
|
+
var _ref;
|
19
|
+
|
18
20
|
var visible = props.visible,
|
19
21
|
title = props.title,
|
20
22
|
selectionMode = props.selectionMode,
|
@@ -36,49 +38,43 @@ function ResourceSelectDrawer(props) {
|
|
36
38
|
}
|
37
39
|
}, [visible]);
|
38
40
|
|
39
|
-
var handleOk =
|
40
|
-
|
41
|
+
var handleOk = function handleOk() {
|
42
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
41
43
|
var selected, shouldClose;
|
42
44
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
43
|
-
while (1) {
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
return onOk(selectionMode === 'single' ? selected[0] : selected);
|
45
|
+
while (1) switch (_context.prev = _context.next) {
|
46
|
+
case 0:
|
47
|
+
setLoading(true);
|
48
|
+
_context.prev = 1;
|
49
|
+
selected = resourceSelectRef.current.getSelectedRowKeys();
|
50
|
+
_context.next = 5;
|
51
|
+
return onOk(selectionMode === 'single' ? selected[0] : selected);
|
51
52
|
|
52
|
-
|
53
|
-
|
53
|
+
case 5:
|
54
|
+
shouldClose = _context.sent;
|
54
55
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
if (shouldClose !== false) {
|
57
|
+
onClose();
|
58
|
+
} else {
|
59
|
+
setLoading(false);
|
60
|
+
}
|
60
61
|
|
61
|
-
|
62
|
-
|
62
|
+
_context.next = 13;
|
63
|
+
break;
|
63
64
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
65
|
+
case 9:
|
66
|
+
_context.prev = 9;
|
67
|
+
_context.t0 = _context["catch"](1);
|
68
|
+
setLoading(false);
|
69
|
+
rlog.error('ResourceSelectDrawer.handleOk', _context.t0);
|
69
70
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
}
|
71
|
+
case 13:
|
72
|
+
case "end":
|
73
|
+
return _context.stop();
|
74
74
|
}
|
75
75
|
}, _callee, null, [[1, 9]]);
|
76
|
-
}));
|
77
|
-
|
78
|
-
return function handleOk() {
|
79
|
-
return _ref.apply(this, arguments);
|
80
|
-
};
|
81
|
-
}();
|
76
|
+
}))).apply(this, arguments);
|
77
|
+
};
|
82
78
|
|
83
79
|
var finalExcludeIds = [];
|
84
80
|
|
@@ -5,42 +5,38 @@ import React, { useRef } from 'react';
|
|
5
5
|
import ResourceSelectDrawer from "../NetworkTopoResourceSelectDrawer";
|
6
6
|
|
7
7
|
var SingleSelectDrawer = function SingleSelectDrawer(props) {
|
8
|
+
var _ref;
|
9
|
+
|
8
10
|
var visible = props.visible,
|
9
11
|
totalSelection = props.totalSelection,
|
10
12
|
onSave = props.onSave,
|
11
13
|
onClose = props.onClose;
|
12
14
|
|
13
|
-
var onDrawerSave =
|
14
|
-
|
15
|
+
var onDrawerSave = function onDrawerSave(_x) {
|
16
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
|
15
17
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
16
|
-
while (1) {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
return _context.stop();
|
35
|
-
}
|
18
|
+
while (1) switch (_context.prev = _context.next) {
|
19
|
+
case 0:
|
20
|
+
if (selected.length) {
|
21
|
+
_context.next = 3;
|
22
|
+
break;
|
23
|
+
}
|
24
|
+
|
25
|
+
_Message.error('请选择一项资源。');
|
26
|
+
|
27
|
+
return _context.abrupt("return", false);
|
28
|
+
|
29
|
+
case 3:
|
30
|
+
_context.next = 5;
|
31
|
+
return onSave(selected[0]);
|
32
|
+
|
33
|
+
case 5:
|
34
|
+
case "end":
|
35
|
+
return _context.stop();
|
36
36
|
}
|
37
37
|
}, _callee);
|
38
|
-
}));
|
39
|
-
|
40
|
-
return function onDrawerSave(_x) {
|
41
|
-
return _ref.apply(this, arguments);
|
42
|
-
};
|
43
|
-
}();
|
38
|
+
}))).apply(this, arguments);
|
39
|
+
};
|
44
40
|
|
45
41
|
return /*#__PURE__*/React.createElement(ResourceSelectDrawer, {
|
46
42
|
visible: visible,
|
@@ -8,6 +8,8 @@ import Drawer from "../../../components/Drawer";
|
|
8
8
|
import DisplaySetting from "./DisplaySetting";
|
9
9
|
import useDisplaySetting from "./hooks/useDisplaySetting";
|
10
10
|
export default function DisplaySettingDrawer(props) {
|
11
|
+
var _ref;
|
12
|
+
|
11
13
|
var visible = props.visible,
|
12
14
|
topo = props.topo,
|
13
15
|
displaySettingProps = props.displaySettingProps,
|
@@ -25,48 +27,42 @@ export default function DisplaySettingDrawer(props) {
|
|
25
27
|
isEditor: isEditor
|
26
28
|
}));
|
27
29
|
|
28
|
-
var handleOk =
|
29
|
-
|
30
|
+
var handleOk = function handleOk() {
|
31
|
+
return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
30
32
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
31
|
-
while (1) {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
return displaySetting.save();
|
33
|
+
while (1) switch (_context.prev = _context.next) {
|
34
|
+
case 0:
|
35
|
+
setLoading(true);
|
36
|
+
_context.prev = 1;
|
37
|
+
_context.next = 4;
|
38
|
+
return displaySetting.save();
|
38
39
|
|
39
|
-
|
40
|
-
|
41
|
-
|
40
|
+
case 4:
|
41
|
+
setLoading(false);
|
42
|
+
onClose();
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
44
|
+
if (!isEditor) {
|
45
|
+
_Message.success('保存成功');
|
46
|
+
}
|
46
47
|
|
47
|
-
|
48
|
-
|
48
|
+
_context.next = 14;
|
49
|
+
break;
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
case 9:
|
52
|
+
_context.prev = 9;
|
53
|
+
_context.t0 = _context["catch"](1);
|
54
|
+
setLoading(false);
|
55
|
+
rlog.error('DisplaySettingDrawer.handleOk', _context.t0);
|
55
56
|
|
56
|
-
|
57
|
+
_Message.warning('保存失败');
|
57
58
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
}
|
59
|
+
case 14:
|
60
|
+
case "end":
|
61
|
+
return _context.stop();
|
62
62
|
}
|
63
63
|
}, _callee, null, [[1, 9]]);
|
64
|
-
}));
|
65
|
-
|
66
|
-
return function handleOk() {
|
67
|
-
return _ref.apply(this, arguments);
|
68
|
-
};
|
69
|
-
}();
|
64
|
+
}))).apply(this, arguments);
|
65
|
+
};
|
70
66
|
|
71
67
|
var DisplaySettingWidget = displaySettingRender || DisplaySetting;
|
72
68
|
return /*#__PURE__*/React.createElement(Drawer, {
|