@riil-frontend/component-topology 11.0.30 → 11.0.31
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 +2 -4
- package/build/index.js +34 -49
- package/es/components/MultiResourceDrawer/index.js +18 -16
- package/es/components/ResourceList/ResourceSelect.js +50 -48
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +26 -24
- package/es/components/SingleResourceDrawer/SelectDrawer.js +20 -18
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +25 -23
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
- package/es/core/components/titlebar/widgets/TitleWidget.js +3 -5
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
- package/es/core/editor/components/BackgroundView/index.js +129 -119
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -20
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +17 -15
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +9 -7
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
- package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +13 -11
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +23 -21
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -10
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +27 -21
- 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 +10 -8
- package/es/core/editor/store/topoEdit.js +6 -4
- package/es/core/editor/utils/edgeTypeStyleUtil.js +4 -2
- package/es/core/hooks/usePolling.js +121 -117
- package/es/core/hooks/useResourceConfig.js +66 -58
- package/es/core/hooks/useTopoEdit.js +511 -476
- package/es/core/models/Alarm.js +298 -281
- package/es/core/models/AttributeMetricDisplay.js +107 -101
- package/es/core/models/PluginManager.js +3 -4
- package/es/core/models/SelectionModel.js +5 -4
- package/es/core/models/TopoApp.js +240 -205
- package/es/core/models/TopoGraphView.js +21 -18
- package/es/core/models/cache/CiCache.js +27 -28
- package/es/core/models/cache/CiTypeCache.js +41 -37
- package/es/core/models/cache/DictCache.js +35 -33
- package/es/core/models/graph/Background.js +17 -15
- package/es/core/models/plugins/resourceWebControllUrl.js +82 -76
- package/es/core/models/tagstips/ElementTagTipConfig.js +38 -34
- package/es/core/models/topoData.js +70 -68
- package/es/core/models/utils/linkUtils.js +43 -41
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/es/core/services/alarm.js +16 -14
- package/es/core/services/background.js +67 -59
- package/es/core/services/cmdb/metric.js +11 -9
- package/es/core/services/cmdb.js +20 -18
- package/es/core/services/index.js +45 -39
- package/es/core/services/overview.js +151 -131
- package/es/core/services/topo/basic.js +13 -11
- package/es/core/services/topo/tagtip.js +12 -10
- package/es/core/store/models/ciModel.js +62 -58
- package/es/core/store/models/customIcon.js +134 -120
- package/es/core/store/models/displayConfig.js +19 -15
- package/es/core/store/models/selection.js +6 -4
- package/es/core/store/models/topoAlarm.js +145 -162
- package/es/core/store/models/topoBaseInfoOverview.js +6 -4
- package/es/core/store/models/topoBizMod.js +32 -28
- package/es/core/store/models/topoConfig.js +231 -215
- package/es/core/store/models/topoGraphView.js +6 -4
- package/es/core/store/models/topoMod.js +395 -373
- package/es/core/utils/imageUtil.js +20 -18
- package/es/core/utils/saveSerialize.js +11 -9
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +357 -343
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +205 -189
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -107
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +37 -33
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +19 -17
- package/es/networkTopo/components/Link/hook.js +77 -73
- package/es/networkTopo/components/Link/index.js +94 -86
- package/es/networkTopo/components/Link/setting.js +44 -42
- package/es/networkTopo/getTopoData.js +69 -63
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +32 -30
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +22 -18
- package/es/networkTopo/services/alert.js +22 -18
- package/es/networkTopo/services/authorization.js +55 -45
- package/es/networkTopo/services/cmdb.js +470 -422
- package/es/networkTopo/services/funcAuth.js +24 -22
- package/es/networkTopo/services/link.js +117 -107
- package/es/networkTopo/services/mdc.js +24 -18
- package/es/networkTopo/services/metric.js +27 -23
- package/es/networkTopo/services/model.js +509 -445
- package/es/networkTopo/services/risk.js +11 -9
- package/es/networkTopo/services/topo/auth.js +33 -27
- package/es/networkTopo/services/topo/basic.js +314 -274
- package/es/networkTopo/services/topo/blacklist.js +24 -20
- package/es/networkTopo/services/topo/ciInfo.js +31 -27
- package/es/networkTopo/services/topo/icon.js +59 -49
- package/es/networkTopo/services/topo/networkLink.js +36 -32
- package/es/networkTopo/services/topo/relation.js +11 -9
- package/es/networkTopo/services/topo/resourceWebUrl.js +42 -36
- package/es/networkTopo/store/functionAuth.js +37 -31
- package/es/networkTopo/store/topoCenter.js +152 -142
- package/es/networkTopo/store/topoLinkMod.js +6 -4
- package/es/networkTopo/store/topoTreeMod.js +182 -170
- package/es/networkTopo/utils/exportData.js +54 -52
- package/lib/components/MultiResourceDrawer/index.js +18 -16
- package/lib/components/ResourceList/ResourceSelect.js +50 -48
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +29 -27
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +20 -18
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +32 -30
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
- package/lib/core/components/titlebar/widgets/TitleWidget.js +3 -5
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
- package/lib/core/editor/components/BackgroundView/index.js +128 -118
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +24 -22
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +21 -19
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +10 -8
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +14 -12
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +28 -26
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +14 -12
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +31 -25
- 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 +10 -8
- package/lib/core/editor/store/topoEdit.js +6 -4
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +4 -2
- package/lib/core/hooks/usePolling.js +120 -116
- package/lib/core/hooks/useResourceConfig.js +66 -58
- package/lib/core/hooks/useTopoEdit.js +503 -468
- package/lib/core/models/Alarm.js +292 -275
- package/lib/core/models/AttributeMetricDisplay.js +110 -104
- package/lib/core/models/PluginManager.js +3 -4
- package/lib/core/models/SelectionModel.js +5 -4
- package/lib/core/models/TopoApp.js +240 -205
- package/lib/core/models/TopoGraphView.js +21 -18
- package/lib/core/models/cache/CiCache.js +32 -33
- package/lib/core/models/cache/CiTypeCache.js +42 -38
- package/lib/core/models/cache/DictCache.js +35 -33
- package/lib/core/models/graph/Background.js +18 -16
- package/lib/core/models/plugins/resourceWebControllUrl.js +80 -74
- package/lib/core/models/tagstips/ElementTagTipConfig.js +38 -34
- package/lib/core/models/topoData.js +71 -69
- package/lib/core/models/utils/linkUtils.js +43 -41
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/lib/core/services/alarm.js +20 -18
- package/lib/core/services/background.js +78 -70
- package/lib/core/services/cmdb/metric.js +12 -10
- package/lib/core/services/cmdb.js +22 -20
- package/lib/core/services/index.js +51 -45
- package/lib/core/services/overview.js +151 -131
- package/lib/core/services/topo/basic.js +15 -13
- package/lib/core/services/topo/tagtip.js +14 -12
- package/lib/core/store/models/ciModel.js +70 -66
- package/lib/core/store/models/customIcon.js +134 -120
- package/lib/core/store/models/displayConfig.js +19 -15
- package/lib/core/store/models/selection.js +6 -4
- package/lib/core/store/models/topoAlarm.js +145 -163
- package/lib/core/store/models/topoBaseInfoOverview.js +6 -4
- package/lib/core/store/models/topoBizMod.js +38 -34
- package/lib/core/store/models/topoConfig.js +238 -222
- package/lib/core/store/models/topoGraphView.js +6 -4
- package/lib/core/store/models/topoMod.js +397 -375
- package/lib/core/utils/imageUtil.js +24 -22
- package/lib/core/utils/saveSerialize.js +11 -9
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +358 -344
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +206 -190
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -107
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -29
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +20 -18
- package/lib/networkTopo/components/Link/hook.js +77 -73
- package/lib/networkTopo/components/Link/index.js +95 -87
- package/lib/networkTopo/components/Link/setting.js +44 -42
- package/lib/networkTopo/getTopoData.js +69 -63
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +33 -31
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +22 -18
- package/lib/networkTopo/services/alert.js +22 -18
- package/lib/networkTopo/services/authorization.js +65 -55
- package/lib/networkTopo/services/cmdb.js +470 -422
- package/lib/networkTopo/services/funcAuth.js +26 -24
- package/lib/networkTopo/services/link.js +118 -108
- package/lib/networkTopo/services/mdc.js +27 -21
- package/lib/networkTopo/services/metric.js +31 -27
- package/lib/networkTopo/services/model.js +509 -445
- package/lib/networkTopo/services/risk.js +13 -11
- package/lib/networkTopo/services/topo/auth.js +33 -27
- package/lib/networkTopo/services/topo/basic.js +317 -277
- package/lib/networkTopo/services/topo/blacklist.js +24 -20
- package/lib/networkTopo/services/topo/ciInfo.js +38 -34
- package/lib/networkTopo/services/topo/icon.js +69 -59
- package/lib/networkTopo/services/topo/networkLink.js +36 -32
- package/lib/networkTopo/services/topo/relation.js +13 -11
- package/lib/networkTopo/services/topo/resourceWebUrl.js +50 -44
- package/lib/networkTopo/store/functionAuth.js +37 -31
- package/lib/networkTopo/store/topoCenter.js +152 -142
- package/lib/networkTopo/store/topoLinkMod.js +6 -4
- package/lib/networkTopo/store/topoTreeMod.js +178 -166
- package/lib/networkTopo/utils/exportData.js +61 -59
- package/package.json +3 -3
@@ -15,22 +15,24 @@ var MultiResourceDrawer = function MultiResourceDrawer(props) {
|
|
15
15
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
|
16
16
|
var result;
|
17
17
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
18
|
-
while (1)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
18
|
+
while (1) {
|
19
|
+
switch (_context.prev = _context.next) {
|
20
|
+
case 0:
|
21
|
+
result = selected;
|
22
|
+
|
23
|
+
if (mode === 'all') {
|
24
|
+
result = {
|
25
|
+
"static": [].concat(initialData["static"], selected)
|
26
|
+
};
|
27
|
+
}
|
28
|
+
|
29
|
+
_context.next = 4;
|
30
|
+
return onSave(result);
|
31
|
+
|
32
|
+
case 4:
|
33
|
+
case "end":
|
34
|
+
return _context.stop();
|
35
|
+
}
|
34
36
|
}
|
35
37
|
}, _callee);
|
36
38
|
}));
|
@@ -20,58 +20,60 @@ var getTableData = /*#__PURE__*/function () {
|
|
20
20
|
var _params$current, current, _params$pageSize, pageSize, _params$sortBy, sortBy, _params$sortOrder, sortOrder, like, typeCode, condition, ciType, data, dataSource;
|
21
21
|
|
22
22
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
23
|
-
while (1)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
conditions: condition,
|
31
|
-
searchValue: like,
|
32
|
-
searchIndexArray: ['display_name', 'ipv4_address']
|
33
|
-
};
|
34
|
-
}
|
35
|
-
|
36
|
-
if (typeCode) {
|
37
|
-
ciType = typeCode.split(',');
|
38
|
-
|
39
|
-
if (typeof condition === 'string') {
|
23
|
+
while (1) {
|
24
|
+
switch (_context.prev = _context.next) {
|
25
|
+
case 0:
|
26
|
+
_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;
|
27
|
+
condition = "type('" + RESOURCE_LIMIT_TYPES.join('\',\'') + "') && category('resource')";
|
28
|
+
|
29
|
+
if (like) {
|
40
30
|
condition = {
|
41
31
|
conditions: condition,
|
42
|
-
|
32
|
+
searchValue: like,
|
33
|
+
searchIndexArray: ['display_name', 'ipv4_address']
|
43
34
|
};
|
44
|
-
} else {
|
45
|
-
condition.ciType = ciType;
|
46
35
|
}
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
36
|
+
|
37
|
+
if (typeCode) {
|
38
|
+
ciType = typeCode.split(',');
|
39
|
+
|
40
|
+
if (typeof condition === 'string') {
|
41
|
+
condition = {
|
42
|
+
conditions: condition,
|
43
|
+
ciType: ciType
|
44
|
+
};
|
45
|
+
} else {
|
46
|
+
condition.ciType = ciType;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
_context.next = 6;
|
51
|
+
return fetchCommonQuery(condition, sortBy, sortOrder, current, pageSize, '', {
|
52
|
+
usingExtraConditions: false // 绕过权限过滤
|
53
|
+
|
54
|
+
});
|
55
|
+
|
56
|
+
case 6:
|
57
|
+
data = _context.sent;
|
58
|
+
dataSource = data.content && data.content.map(function (item) {
|
59
|
+
var _item$operation;
|
60
|
+
|
61
|
+
return {
|
62
|
+
id: item.id,
|
63
|
+
displayName: item.attributes.displayName || item.attributes.display_name,
|
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
|
+
}
|
75
77
|
}
|
76
78
|
}, _callee);
|
77
79
|
}));
|
@@ -40,35 +40,37 @@ function ResourceSelectDrawer(props) {
|
|
40
40
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
41
41
|
var selected, shouldClose;
|
42
42
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
43
|
-
while (1)
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
while (1) {
|
44
|
+
switch (_context.prev = _context.next) {
|
45
|
+
case 0:
|
46
|
+
setLoading(true);
|
47
|
+
_context.prev = 1;
|
48
|
+
selected = resourceSelectRef.current.getSelectedRowKeys();
|
49
|
+
_context.next = 5;
|
50
|
+
return onOk(selectionMode === 'single' ? selected[0] : selected);
|
50
51
|
|
51
|
-
|
52
|
-
|
52
|
+
case 5:
|
53
|
+
shouldClose = _context.sent;
|
53
54
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
55
|
+
if (shouldClose !== false) {
|
56
|
+
onClose();
|
57
|
+
} else {
|
58
|
+
setLoading(false);
|
59
|
+
}
|
59
60
|
|
60
|
-
|
61
|
-
|
61
|
+
_context.next = 13;
|
62
|
+
break;
|
62
63
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
64
|
+
case 9:
|
65
|
+
_context.prev = 9;
|
66
|
+
_context.t0 = _context["catch"](1);
|
67
|
+
setLoading(false);
|
68
|
+
rlog.error('ResourceSelectDrawer.handleOk', _context.t0);
|
68
69
|
|
69
|
-
|
70
|
-
|
71
|
-
|
70
|
+
case 13:
|
71
|
+
case "end":
|
72
|
+
return _context.stop();
|
73
|
+
}
|
72
74
|
}
|
73
75
|
}, _callee, null, [[1, 9]]);
|
74
76
|
}));
|
@@ -13,24 +13,26 @@ var SingleSelectDrawer = function SingleSelectDrawer(props) {
|
|
13
13
|
var onDrawerSave = /*#__PURE__*/function () {
|
14
14
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
|
15
15
|
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
|
-
|
16
|
+
while (1) {
|
17
|
+
switch (_context.prev = _context.next) {
|
18
|
+
case 0:
|
19
|
+
if (selected.length) {
|
20
|
+
_context.next = 3;
|
21
|
+
break;
|
22
|
+
}
|
23
|
+
|
24
|
+
_Message.error('请选择一项资源。');
|
25
|
+
|
26
|
+
return _context.abrupt("return", false);
|
27
|
+
|
28
|
+
case 3:
|
29
|
+
_context.next = 5;
|
30
|
+
return onSave(selected[0]);
|
31
|
+
|
32
|
+
case 5:
|
33
|
+
case "end":
|
34
|
+
return _context.stop();
|
35
|
+
}
|
34
36
|
}
|
35
37
|
}, _callee);
|
36
38
|
}));
|
@@ -28,35 +28,37 @@ export default function DisplaySettingDrawer(props) {
|
|
28
28
|
var handleOk = /*#__PURE__*/function () {
|
29
29
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
30
30
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
31
|
-
while (1)
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
while (1) {
|
32
|
+
switch (_context.prev = _context.next) {
|
33
|
+
case 0:
|
34
|
+
setLoading(true);
|
35
|
+
_context.prev = 1;
|
36
|
+
_context.next = 4;
|
37
|
+
return displaySetting.save();
|
37
38
|
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
case 4:
|
40
|
+
setLoading(false);
|
41
|
+
onClose();
|
41
42
|
|
42
|
-
|
43
|
-
|
44
|
-
|
43
|
+
if (!isEditor) {
|
44
|
+
_Message.success('保存成功');
|
45
|
+
}
|
45
46
|
|
46
|
-
|
47
|
-
|
47
|
+
_context.next = 14;
|
48
|
+
break;
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
case 9:
|
51
|
+
_context.prev = 9;
|
52
|
+
_context.t0 = _context["catch"](1);
|
53
|
+
setLoading(false);
|
54
|
+
rlog.error('DisplaySettingDrawer.handleOk', _context.t0);
|
54
55
|
|
55
|
-
|
56
|
+
_Message.warning('保存失败');
|
56
57
|
|
57
|
-
|
58
|
-
|
59
|
-
|
58
|
+
case 14:
|
59
|
+
case "end":
|
60
|
+
return _context.stop();
|
61
|
+
}
|
60
62
|
}
|
61
63
|
}, _callee, null, [[1, 9]]);
|
62
64
|
}));
|
@@ -11,38 +11,40 @@ export default (function (props) {
|
|
11
11
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
12
12
|
var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
|
13
13
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
14
|
-
while (1)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
extraOnOk
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
14
|
+
while (1) {
|
15
|
+
switch (_context.prev = _context.next) {
|
16
|
+
case 0:
|
17
|
+
values = settingRef.current.getValues(); // console.info('保存显示配置', values)
|
18
|
+
// 保存配置
|
19
|
+
|
20
|
+
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
21
|
+
displayConfig = _extends({}, prevDisplayConfig, values);
|
22
|
+
_context.next = 5;
|
23
|
+
return topo.serverApi.saveTopoSettings(topo.id, {
|
24
|
+
alarmSwitch: displayConfig.alarmSwitch,
|
25
|
+
alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
|
26
|
+
extraConfig: JSON.stringify(_extends({}, displayConfig))
|
27
|
+
});
|
28
|
+
|
29
|
+
case 5:
|
30
|
+
// 刷新指标配置
|
31
|
+
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
32
|
+
_context.next = 8;
|
33
|
+
return displayConfigDispatchers.update(displayConfig);
|
34
|
+
|
35
|
+
case 8:
|
36
|
+
// 更新节点名称显示隐藏
|
37
|
+
topo.attributeMetricDisplay.updateNodesNameVisible();
|
38
|
+
extraOnOk = (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk) || (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onDisplaySettingDrawerOk);
|
39
|
+
|
40
|
+
if (extraOnOk) {
|
41
|
+
extraOnOk(displayConfig);
|
42
|
+
}
|
43
|
+
|
44
|
+
case 11:
|
45
|
+
case "end":
|
46
|
+
return _context.stop();
|
47
|
+
}
|
46
48
|
}
|
47
49
|
}, _callee);
|
48
50
|
}));
|
@@ -56,38 +58,40 @@ export default (function (props) {
|
|
56
58
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
57
59
|
var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
|
58
60
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
59
|
-
while (1)
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
while (1) {
|
62
|
+
switch (_context2.prev = _context2.next) {
|
63
|
+
case 0:
|
64
|
+
topo.historyManager.beginTransaction();
|
65
|
+
values = settingRef.current.getValues(); // console.info('保存显示配置', values)
|
66
|
+
// 保存配置
|
67
|
+
|
68
|
+
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
69
|
+
displayConfig = _extends({}, prevDisplayConfig, values); // 刷新指标配置
|
70
|
+
|
71
|
+
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
72
|
+
_context2.next = 7;
|
73
|
+
return displayConfigDispatchers.update(displayConfig);
|
74
|
+
|
75
|
+
case 7:
|
76
|
+
// 更新节点名称显示隐藏
|
77
|
+
topo.attributeMetricDisplay.updateNodesNameVisible();
|
78
|
+
extraOnOk = displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk;
|
79
|
+
|
80
|
+
if (!extraOnOk) {
|
81
|
+
_context2.next = 12;
|
82
|
+
break;
|
83
|
+
}
|
64
84
|
|
65
|
-
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
66
|
-
displayConfig = _extends({}, prevDisplayConfig, values); // 刷新指标配置
|
67
|
-
|
68
|
-
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
69
|
-
_context2.next = 7;
|
70
|
-
return displayConfigDispatchers.update(displayConfig);
|
71
|
-
|
72
|
-
case 7:
|
73
|
-
// 更新节点名称显示隐藏
|
74
|
-
topo.attributeMetricDisplay.updateNodesNameVisible();
|
75
|
-
extraOnOk = displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk;
|
76
|
-
|
77
|
-
if (!extraOnOk) {
|
78
85
|
_context2.next = 12;
|
79
|
-
|
80
|
-
}
|
86
|
+
return extraOnOk(displayConfig);
|
81
87
|
|
82
|
-
|
83
|
-
|
88
|
+
case 12:
|
89
|
+
topo.historyManager.endTransaction();
|
84
90
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
case "end":
|
90
|
-
return _context2.stop();
|
91
|
+
case 13:
|
92
|
+
case "end":
|
93
|
+
return _context2.stop();
|
94
|
+
}
|
91
95
|
}
|
92
96
|
}, _callee2);
|
93
97
|
}));
|
@@ -100,27 +104,29 @@ export default (function (props) {
|
|
100
104
|
var save = /*#__PURE__*/function () {
|
101
105
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
102
106
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
103
|
-
while (1)
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
+
while (1) {
|
108
|
+
switch (_context3.prev = _context3.next) {
|
109
|
+
case 0:
|
110
|
+
if (isEditor) {
|
111
|
+
_context3.next = 5;
|
112
|
+
break;
|
113
|
+
}
|
114
|
+
|
115
|
+
_context3.next = 3;
|
116
|
+
return handleViewerSave();
|
117
|
+
|
118
|
+
case 3:
|
119
|
+
_context3.next = 7;
|
107
120
|
break;
|
108
|
-
}
|
109
|
-
|
110
|
-
_context3.next = 3;
|
111
|
-
return handleViewerSave();
|
112
|
-
|
113
|
-
case 3:
|
114
|
-
_context3.next = 7;
|
115
|
-
break;
|
116
121
|
|
117
|
-
|
118
|
-
|
119
|
-
|
122
|
+
case 5:
|
123
|
+
_context3.next = 7;
|
124
|
+
return handleEditorSave();
|
120
125
|
|
121
|
-
|
122
|
-
|
123
|
-
|
126
|
+
case 7:
|
127
|
+
case "end":
|
128
|
+
return _context3.stop();
|
129
|
+
}
|
124
130
|
}
|
125
131
|
}, _callee3);
|
126
132
|
}));
|
@@ -4,11 +4,9 @@ export default function TitleWidget(props) {
|
|
4
4
|
var topo = props.topo;
|
5
5
|
var store = topo.store;
|
6
6
|
var topoState = store.useModelState('topoMod');
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
topoName = _topoState$currentTop2.name;
|
11
|
-
|
7
|
+
var _topoState$currentTop = topoState.currentTopo;
|
8
|
+
_topoState$currentTop = _topoState$currentTop === void 0 ? {} : _topoState$currentTop;
|
9
|
+
var topoName = _topoState$currentTop.name;
|
12
10
|
return /*#__PURE__*/React.createElement("div", {
|
13
11
|
className: styles.title
|
14
12
|
}, topoName);
|
@@ -142,26 +142,28 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
142
142
|
_this.handleSuccess = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
143
143
|
var onSuccess;
|
144
144
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
145
|
-
while (1)
|
146
|
-
|
147
|
-
|
145
|
+
while (1) {
|
146
|
+
switch (_context.prev = _context.next) {
|
147
|
+
case 0:
|
148
|
+
onSuccess = _this.props.onSuccess;
|
148
149
|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
150
|
+
_Message.show({
|
151
|
+
type: 'success',
|
152
|
+
title: '背景图上传成功'
|
153
|
+
});
|
153
154
|
|
154
|
-
|
155
|
-
|
156
|
-
|
155
|
+
_this.setState({
|
156
|
+
uploading: false
|
157
|
+
});
|
157
158
|
|
158
|
-
|
159
|
+
_this.resetState();
|
159
160
|
|
160
|
-
|
161
|
+
onSuccess();
|
161
162
|
|
162
|
-
|
163
|
-
|
164
|
-
|
163
|
+
case 5:
|
164
|
+
case "end":
|
165
|
+
return _context.stop();
|
166
|
+
}
|
165
167
|
}
|
166
168
|
}, _callee);
|
167
169
|
}));
|