@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
@@ -46,58 +46,60 @@ var getTableData = /*#__PURE__*/function () {
|
|
46
46
|
var _params$current, current, _params$pageSize, pageSize, _params$sortBy, sortBy, _params$sortOrder, sortOrder, like, typeCode, condition, ciType, data, dataSource;
|
47
47
|
|
48
48
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
49
|
-
while (1)
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
conditions: condition,
|
57
|
-
searchValue: like,
|
58
|
-
searchIndexArray: ['display_name', 'ipv4_address']
|
59
|
-
};
|
60
|
-
}
|
61
|
-
|
62
|
-
if (typeCode) {
|
63
|
-
ciType = typeCode.split(',');
|
64
|
-
|
65
|
-
if (typeof condition === 'string') {
|
49
|
+
while (1) {
|
50
|
+
switch (_context.prev = _context.next) {
|
51
|
+
case 0:
|
52
|
+
_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;
|
53
|
+
condition = "type('" + _ResourceTypeLimit.RESOURCE_LIMIT_TYPES.join('\',\'') + "') && category('resource')";
|
54
|
+
|
55
|
+
if (like) {
|
66
56
|
condition = {
|
67
57
|
conditions: condition,
|
68
|
-
|
58
|
+
searchValue: like,
|
59
|
+
searchIndexArray: ['display_name', 'ipv4_address']
|
69
60
|
};
|
70
|
-
} else {
|
71
|
-
condition.ciType = ciType;
|
72
61
|
}
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
62
|
+
|
63
|
+
if (typeCode) {
|
64
|
+
ciType = typeCode.split(',');
|
65
|
+
|
66
|
+
if (typeof condition === 'string') {
|
67
|
+
condition = {
|
68
|
+
conditions: condition,
|
69
|
+
ciType: ciType
|
70
|
+
};
|
71
|
+
} else {
|
72
|
+
condition.ciType = ciType;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
_context.next = 6;
|
77
|
+
return (0, _cmdb.fetchCommonQuery)(condition, sortBy, sortOrder, current, pageSize, '', {
|
78
|
+
usingExtraConditions: false // 绕过权限过滤
|
79
|
+
|
80
|
+
});
|
81
|
+
|
82
|
+
case 6:
|
83
|
+
data = _context.sent;
|
84
|
+
dataSource = data.content && data.content.map(function (item) {
|
85
|
+
var _item$operation;
|
86
|
+
|
87
|
+
return {
|
88
|
+
id: item.id,
|
89
|
+
displayName: item.attributes.displayName || item.attributes.display_name,
|
90
|
+
ipAddress: item.attributes.ipAddress || item.attributes.ipv4_address,
|
91
|
+
company: item.attributes.company,
|
92
|
+
typeCode: item.typeCode,
|
93
|
+
operation: (_item$operation = item.operation) !== null && _item$operation !== void 0 ? _item$operation : null // 权限字段
|
94
|
+
|
95
|
+
};
|
96
|
+
});
|
97
|
+
return _context.abrupt("return", (0, _format.formatDataForTable)(dataSource, data.totalRecord, data.pageIndex, data.pageSize));
|
98
|
+
|
99
|
+
case 9:
|
100
|
+
case "end":
|
101
|
+
return _context.stop();
|
102
|
+
}
|
101
103
|
}
|
102
104
|
}, _callee);
|
103
105
|
}));
|
@@ -58,36 +58,38 @@ function ResourceSelectDrawer(props) {
|
|
58
58
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
59
59
|
var selected, shouldClose;
|
60
60
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
61
|
-
while (1)
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
61
|
+
while (1) {
|
62
|
+
switch (_context.prev = _context.next) {
|
63
|
+
case 0:
|
64
|
+
setLoading(true);
|
65
|
+
_context.prev = 1;
|
66
|
+
selected = resourceSelectRef.current.getSelectedRowKeys();
|
67
|
+
_context.next = 5;
|
68
|
+
return onOk(selectionMode === 'single' ? selected[0] : selected);
|
69
|
+
|
70
|
+
case 5:
|
71
|
+
shouldClose = _context.sent;
|
72
|
+
|
73
|
+
if (shouldClose !== false) {
|
74
|
+
onClose();
|
75
|
+
} else {
|
76
|
+
setLoading(false);
|
77
|
+
}
|
78
|
+
|
79
|
+
_context.next = 13;
|
80
|
+
break;
|
81
|
+
|
82
|
+
case 9:
|
83
|
+
_context.prev = 9;
|
84
|
+
_context.t0 = _context["catch"](1);
|
75
85
|
setLoading(false);
|
76
|
-
}
|
77
86
|
|
78
|
-
|
79
|
-
break;
|
87
|
+
_rlog["default"].error('ResourceSelectDrawer.handleOk', _context.t0);
|
80
88
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
_rlog["default"].error('ResourceSelectDrawer.handleOk', _context.t0);
|
87
|
-
|
88
|
-
case 13:
|
89
|
-
case "end":
|
90
|
-
return _context.stop();
|
89
|
+
case 13:
|
90
|
+
case "end":
|
91
|
+
return _context.stop();
|
92
|
+
}
|
91
93
|
}
|
92
94
|
}, _callee, null, [[1, 9]]);
|
93
95
|
}));
|
@@ -28,24 +28,26 @@ var SingleSelectDrawer = function SingleSelectDrawer(props) {
|
|
28
28
|
var onDrawerSave = /*#__PURE__*/function () {
|
29
29
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(selected) {
|
30
30
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
31
|
-
while (1)
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
31
|
+
while (1) {
|
32
|
+
switch (_context.prev = _context.next) {
|
33
|
+
case 0:
|
34
|
+
if (selected.length) {
|
35
|
+
_context.next = 3;
|
36
|
+
break;
|
37
|
+
}
|
38
|
+
|
39
|
+
_message["default"].error('请选择一项资源。');
|
40
|
+
|
41
|
+
return _context.abrupt("return", false);
|
42
|
+
|
43
|
+
case 3:
|
44
|
+
_context.next = 5;
|
45
|
+
return onSave(selected[0]);
|
46
|
+
|
47
|
+
case 5:
|
48
|
+
case "end":
|
49
|
+
return _context.stop();
|
50
|
+
}
|
49
51
|
}
|
50
52
|
}, _callee);
|
51
53
|
}));
|
@@ -48,36 +48,38 @@ function DisplaySettingDrawer(props) {
|
|
48
48
|
var handleOk = /*#__PURE__*/function () {
|
49
49
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
50
50
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
51
|
-
while (1)
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
51
|
+
while (1) {
|
52
|
+
switch (_context.prev = _context.next) {
|
53
|
+
case 0:
|
54
|
+
setLoading(true);
|
55
|
+
_context.prev = 1;
|
56
|
+
_context.next = 4;
|
57
|
+
return displaySetting.save();
|
58
|
+
|
59
|
+
case 4:
|
60
|
+
setLoading(false);
|
61
|
+
onClose();
|
62
|
+
|
63
|
+
if (!isEditor) {
|
64
|
+
_message["default"].success('保存成功');
|
65
|
+
}
|
66
|
+
|
67
|
+
_context.next = 14;
|
68
|
+
break;
|
69
|
+
|
70
|
+
case 9:
|
71
|
+
_context.prev = 9;
|
72
|
+
_context.t0 = _context["catch"](1);
|
73
|
+
setLoading(false);
|
74
|
+
|
75
|
+
_rlog["default"].error('DisplaySettingDrawer.handleOk', _context.t0);
|
76
|
+
|
77
|
+
_message["default"].warning('保存失败');
|
78
|
+
|
79
|
+
case 14:
|
80
|
+
case "end":
|
81
|
+
return _context.stop();
|
82
|
+
}
|
81
83
|
}
|
82
84
|
}, _callee, null, [[1, 9]]);
|
83
85
|
}));
|
@@ -21,38 +21,40 @@ var _default = function _default(props) {
|
|
21
21
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
22
22
|
var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
|
23
23
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
24
|
-
while (1)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
extraOnOk
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
24
|
+
while (1) {
|
25
|
+
switch (_context.prev = _context.next) {
|
26
|
+
case 0:
|
27
|
+
values = settingRef.current.getValues(); // console.info('保存显示配置', values)
|
28
|
+
// 保存配置
|
29
|
+
|
30
|
+
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
31
|
+
displayConfig = (0, _extends2["default"])({}, prevDisplayConfig, values);
|
32
|
+
_context.next = 5;
|
33
|
+
return topo.serverApi.saveTopoSettings(topo.id, {
|
34
|
+
alarmSwitch: displayConfig.alarmSwitch,
|
35
|
+
alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
|
36
|
+
extraConfig: JSON.stringify((0, _extends2["default"])({}, displayConfig))
|
37
|
+
});
|
38
|
+
|
39
|
+
case 5:
|
40
|
+
// 刷新指标配置
|
41
|
+
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
42
|
+
_context.next = 8;
|
43
|
+
return displayConfigDispatchers.update(displayConfig);
|
44
|
+
|
45
|
+
case 8:
|
46
|
+
// 更新节点名称显示隐藏
|
47
|
+
topo.attributeMetricDisplay.updateNodesNameVisible();
|
48
|
+
extraOnOk = (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk) || (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onDisplaySettingDrawerOk);
|
49
|
+
|
50
|
+
if (extraOnOk) {
|
51
|
+
extraOnOk(displayConfig);
|
52
|
+
}
|
53
|
+
|
54
|
+
case 11:
|
55
|
+
case "end":
|
56
|
+
return _context.stop();
|
57
|
+
}
|
56
58
|
}
|
57
59
|
}, _callee);
|
58
60
|
}));
|
@@ -66,38 +68,40 @@ var _default = function _default(props) {
|
|
66
68
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
67
69
|
var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
|
68
70
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
69
|
-
while (1)
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
71
|
+
while (1) {
|
72
|
+
switch (_context2.prev = _context2.next) {
|
73
|
+
case 0:
|
74
|
+
topo.historyManager.beginTransaction();
|
75
|
+
values = settingRef.current.getValues(); // console.info('保存显示配置', values)
|
76
|
+
// 保存配置
|
77
|
+
|
78
|
+
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
79
|
+
displayConfig = (0, _extends2["default"])({}, prevDisplayConfig, values); // 刷新指标配置
|
80
|
+
|
81
|
+
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
82
|
+
_context2.next = 7;
|
83
|
+
return displayConfigDispatchers.update(displayConfig);
|
84
|
+
|
85
|
+
case 7:
|
86
|
+
// 更新节点名称显示隐藏
|
87
|
+
topo.attributeMetricDisplay.updateNodesNameVisible();
|
88
|
+
extraOnOk = displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk;
|
89
|
+
|
90
|
+
if (!extraOnOk) {
|
91
|
+
_context2.next = 12;
|
92
|
+
break;
|
93
|
+
}
|
74
94
|
|
75
|
-
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
76
|
-
displayConfig = (0, _extends2["default"])({}, prevDisplayConfig, values); // 刷新指标配置
|
77
|
-
|
78
|
-
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
79
|
-
_context2.next = 7;
|
80
|
-
return displayConfigDispatchers.update(displayConfig);
|
81
|
-
|
82
|
-
case 7:
|
83
|
-
// 更新节点名称显示隐藏
|
84
|
-
topo.attributeMetricDisplay.updateNodesNameVisible();
|
85
|
-
extraOnOk = displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk;
|
86
|
-
|
87
|
-
if (!extraOnOk) {
|
88
95
|
_context2.next = 12;
|
89
|
-
|
90
|
-
}
|
96
|
+
return extraOnOk(displayConfig);
|
91
97
|
|
92
|
-
|
93
|
-
|
98
|
+
case 12:
|
99
|
+
topo.historyManager.endTransaction();
|
94
100
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
case "end":
|
100
|
-
return _context2.stop();
|
101
|
+
case 13:
|
102
|
+
case "end":
|
103
|
+
return _context2.stop();
|
104
|
+
}
|
101
105
|
}
|
102
106
|
}, _callee2);
|
103
107
|
}));
|
@@ -110,27 +114,29 @@ var _default = function _default(props) {
|
|
110
114
|
var save = /*#__PURE__*/function () {
|
111
115
|
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
112
116
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
113
|
-
while (1)
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
+
while (1) {
|
118
|
+
switch (_context3.prev = _context3.next) {
|
119
|
+
case 0:
|
120
|
+
if (isEditor) {
|
121
|
+
_context3.next = 5;
|
122
|
+
break;
|
123
|
+
}
|
124
|
+
|
125
|
+
_context3.next = 3;
|
126
|
+
return handleViewerSave();
|
127
|
+
|
128
|
+
case 3:
|
129
|
+
_context3.next = 7;
|
117
130
|
break;
|
118
|
-
}
|
119
|
-
|
120
|
-
_context3.next = 3;
|
121
|
-
return handleViewerSave();
|
122
|
-
|
123
|
-
case 3:
|
124
|
-
_context3.next = 7;
|
125
|
-
break;
|
126
131
|
|
127
|
-
|
128
|
-
|
129
|
-
|
132
|
+
case 5:
|
133
|
+
_context3.next = 7;
|
134
|
+
return handleEditorSave();
|
130
135
|
|
131
|
-
|
132
|
-
|
133
|
-
|
136
|
+
case 7:
|
137
|
+
case "end":
|
138
|
+
return _context3.stop();
|
139
|
+
}
|
134
140
|
}
|
135
141
|
}, _callee3);
|
136
142
|
}));
|
@@ -13,11 +13,9 @@ function TitleWidget(props) {
|
|
13
13
|
var topo = props.topo;
|
14
14
|
var store = topo.store;
|
15
15
|
var topoState = store.useModelState('topoMod');
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
topoName = _topoState$currentTop2.name;
|
20
|
-
|
16
|
+
var _topoState$currentTop = topoState.currentTopo;
|
17
|
+
_topoState$currentTop = _topoState$currentTop === void 0 ? {} : _topoState$currentTop;
|
18
|
+
var topoName = _topoState$currentTop.name;
|
21
19
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
22
20
|
className: _TitleBarModule["default"].title
|
23
21
|
}, topoName);
|
@@ -161,26 +161,28 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
161
161
|
_this.handleSuccess = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
162
162
|
var onSuccess;
|
163
163
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
164
|
-
while (1)
|
165
|
-
|
166
|
-
|
164
|
+
while (1) {
|
165
|
+
switch (_context.prev = _context.next) {
|
166
|
+
case 0:
|
167
|
+
onSuccess = _this.props.onSuccess;
|
167
168
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
169
|
+
_message["default"].show({
|
170
|
+
type: 'success',
|
171
|
+
title: '背景图上传成功'
|
172
|
+
});
|
172
173
|
|
173
|
-
|
174
|
-
|
175
|
-
|
174
|
+
_this.setState({
|
175
|
+
uploading: false
|
176
|
+
});
|
176
177
|
|
177
|
-
|
178
|
+
_this.resetState();
|
178
179
|
|
179
|
-
|
180
|
+
onSuccess();
|
180
181
|
|
181
|
-
|
182
|
-
|
183
|
-
|
182
|
+
case 5:
|
183
|
+
case "end":
|
184
|
+
return _context.stop();
|
185
|
+
}
|
184
186
|
}
|
185
187
|
}, _callee);
|
186
188
|
}));
|