@riil-frontend/component-topology 11.0.34 → 12.0.0-dev.1
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 +57 -34
- package/es/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/MultiResourceDrawer/index.js +16 -18
- package/es/components/ResourceList/ResourceSelect.js +48 -50
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +24 -26
- package/es/components/SingleResourceDrawer/SelectDrawer.js +18 -20
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +23 -25
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
- 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 +119 -129
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +20 -22
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +15 -17
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +7 -9
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +11 -13
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +21 -23
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +10 -12
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +21 -27
- package/es/core/editor/hooks/useKeyboardShortcut.js +36 -32
- 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/copyElementUtil.js +171 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +117 -121
- package/es/core/hooks/useResourceConfig.js +58 -66
- package/es/core/hooks/useTopoEdit.js +473 -503
- package/es/core/models/Alarm.js +281 -298
- package/es/core/models/AttributeMetricDisplay.js +101 -107
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +205 -240
- package/es/core/models/TopoGraphView.js +18 -21
- package/es/core/models/cache/CiCache.js +28 -27
- package/es/core/models/cache/CiTypeCache.js +37 -41
- package/es/core/models/cache/DictCache.js +33 -35
- package/es/core/models/graph/Background.js +15 -17
- package/es/core/models/plugins/resourceWebControllUrl.js +76 -82
- package/es/core/models/tagstips/ElementTagTipConfig.js +34 -38
- package/es/core/models/topoData.js +68 -70
- package/es/core/models/utils/linkUtils.js +41 -43
- 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 +9 -11
- package/es/core/services/cmdb.js +20 -20
- package/es/core/services/index.js +39 -45
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +37 -41
- package/es/core/services/topo/tagtip.js +10 -12
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +120 -134
- 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 +18 -20
- package/es/core/utils/metricUtil.js +5 -0
- package/es/core/utils/saveSerialize.js +9 -11
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +343 -357
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +189 -205
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -37
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +17 -19
- package/es/networkTopo/components/Link/hook.js +73 -77
- package/es/networkTopo/components/Link/index.js +86 -94
- package/es/networkTopo/components/Link/setting.js +42 -44
- package/es/networkTopo/getTopoData.js +63 -69
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +30 -32
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +18 -22
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +422 -470
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +18 -24
- package/es/networkTopo/services/metric.js +23 -27
- package/es/networkTopo/services/model.js +445 -509
- 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 +52 -54
- package/lib/components/BatchAttrMetric/setting.js +1 -1
- package/lib/components/MultiResourceDrawer/index.js +16 -18
- package/lib/components/ResourceList/ResourceSelect.js +48 -50
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +27 -29
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +18 -20
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +30 -32
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
- 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 +118 -128
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -24
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +19 -21
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -10
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +12 -14
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +26 -28
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -14
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +25 -31
- package/lib/core/editor/hooks/useKeyboardShortcut.js +37 -34
- 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/copyElementUtil.js +182 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +116 -120
- package/lib/core/hooks/useResourceConfig.js +58 -66
- package/lib/core/hooks/useTopoEdit.js +465 -495
- package/lib/core/models/Alarm.js +275 -292
- package/lib/core/models/AttributeMetricDisplay.js +104 -110
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +205 -240
- package/lib/core/models/TopoGraphView.js +18 -21
- package/lib/core/models/cache/CiCache.js +33 -32
- package/lib/core/models/cache/CiTypeCache.js +38 -42
- package/lib/core/models/cache/DictCache.js +33 -35
- package/lib/core/models/graph/Background.js +16 -18
- package/lib/core/models/plugins/resourceWebControllUrl.js +74 -80
- package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -38
- package/lib/core/models/topoData.js +69 -71
- package/lib/core/models/utils/linkUtils.js +41 -43
- 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 +10 -12
- package/lib/core/services/cmdb.js +22 -22
- package/lib/core/services/index.js +45 -51
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +37 -41
- package/lib/core/services/topo/tagtip.js +12 -14
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +120 -134
- 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 +22 -24
- package/lib/core/utils/metricUtil.js +5 -0
- package/lib/core/utils/saveSerialize.js +9 -11
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +344 -358
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +190 -206
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +29 -33
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +18 -20
- package/lib/networkTopo/components/Link/hook.js +73 -77
- package/lib/networkTopo/components/Link/index.js +87 -95
- package/lib/networkTopo/components/Link/setting.js +42 -44
- package/lib/networkTopo/getTopoData.js +63 -69
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +31 -33
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +18 -22
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +422 -470
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +21 -27
- package/lib/networkTopo/services/metric.js +27 -31
- package/lib/networkTopo/services/model.js +445 -509
- 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 +59 -61
- package/lib/utils/htElementDataUtil.js +4 -2
- package/package.json +5 -3
@@ -46,60 +46,58 @@ 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
|
-
|
49
|
+
while (1) switch (_context.prev = _context.next) {
|
50
|
+
case 0:
|
51
|
+
_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;
|
52
|
+
condition = "type('" + _ResourceTypeLimit.RESOURCE_LIMIT_TYPES.join('\',\'') + "') && category('resource')";
|
53
|
+
|
54
|
+
if (like) {
|
55
|
+
condition = {
|
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') {
|
56
66
|
condition = {
|
57
67
|
conditions: condition,
|
58
|
-
|
59
|
-
searchIndexArray: ['display_name', 'ipv4_address']
|
68
|
+
ciType: ciType
|
60
69
|
};
|
70
|
+
} else {
|
71
|
+
condition.ciType = ciType;
|
61
72
|
}
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
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
|
-
}
|
73
|
+
}
|
74
|
+
|
75
|
+
_context.next = 6;
|
76
|
+
return (0, _cmdb.fetchCommonQuery)(condition, sortBy, sortOrder, current, pageSize, '', {
|
77
|
+
usingExtraConditions: false // 绕过权限过滤
|
78
|
+
|
79
|
+
});
|
80
|
+
|
81
|
+
case 6:
|
82
|
+
data = _context.sent;
|
83
|
+
dataSource = data.content && data.content.map(function (item) {
|
84
|
+
var _item$operation;
|
85
|
+
|
86
|
+
return {
|
87
|
+
id: item.id,
|
88
|
+
displayName: item.attributes.displayName || item.attributes.display_name,
|
89
|
+
ipAddress: item.attributes.ipAddress || item.attributes.ipv4_address,
|
90
|
+
company: item.attributes.company,
|
91
|
+
typeCode: item.typeCode,
|
92
|
+
operation: (_item$operation = item.operation) !== null && _item$operation !== void 0 ? _item$operation : null // 权限字段
|
93
|
+
|
94
|
+
};
|
95
|
+
});
|
96
|
+
return _context.abrupt("return", (0, _format.formatDataForTable)(dataSource, data.totalRecord, data.pageIndex, data.pageSize));
|
97
|
+
|
98
|
+
case 9:
|
99
|
+
case "end":
|
100
|
+
return _context.stop();
|
103
101
|
}
|
104
102
|
}, _callee);
|
105
103
|
}));
|
@@ -58,38 +58,36 @@ 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
|
-
|
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);
|
61
|
+
while (1) switch (_context.prev = _context.next) {
|
62
|
+
case 0:
|
63
|
+
setLoading(true);
|
64
|
+
_context.prev = 1;
|
65
|
+
selected = resourceSelectRef.current.getSelectedRowKeys();
|
66
|
+
_context.next = 5;
|
67
|
+
return onOk(selectionMode === 'single' ? selected[0] : selected);
|
68
|
+
|
69
|
+
case 5:
|
70
|
+
shouldClose = _context.sent;
|
71
|
+
|
72
|
+
if (shouldClose !== false) {
|
73
|
+
onClose();
|
74
|
+
} else {
|
85
75
|
setLoading(false);
|
76
|
+
}
|
86
77
|
|
87
|
-
|
78
|
+
_context.next = 13;
|
79
|
+
break;
|
88
80
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
81
|
+
case 9:
|
82
|
+
_context.prev = 9;
|
83
|
+
_context.t0 = _context["catch"](1);
|
84
|
+
setLoading(false);
|
85
|
+
|
86
|
+
_rlog["default"].error('ResourceSelectDrawer.handleOk', _context.t0);
|
87
|
+
|
88
|
+
case 13:
|
89
|
+
case "end":
|
90
|
+
return _context.stop();
|
93
91
|
}
|
94
92
|
}, _callee, null, [[1, 9]]);
|
95
93
|
}));
|
@@ -28,26 +28,24 @@ 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
|
-
|
49
|
-
return _context.stop();
|
50
|
-
}
|
31
|
+
while (1) switch (_context.prev = _context.next) {
|
32
|
+
case 0:
|
33
|
+
if (selected.length) {
|
34
|
+
_context.next = 3;
|
35
|
+
break;
|
36
|
+
}
|
37
|
+
|
38
|
+
_message["default"].error('请选择一项资源。');
|
39
|
+
|
40
|
+
return _context.abrupt("return", false);
|
41
|
+
|
42
|
+
case 3:
|
43
|
+
_context.next = 5;
|
44
|
+
return onSave(selected[0]);
|
45
|
+
|
46
|
+
case 5:
|
47
|
+
case "end":
|
48
|
+
return _context.stop();
|
51
49
|
}
|
52
50
|
}, _callee);
|
53
51
|
}));
|
@@ -48,38 +48,36 @@ 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
|
-
|
81
|
-
return _context.stop();
|
82
|
-
}
|
51
|
+
while (1) switch (_context.prev = _context.next) {
|
52
|
+
case 0:
|
53
|
+
setLoading(true);
|
54
|
+
_context.prev = 1;
|
55
|
+
_context.next = 4;
|
56
|
+
return displaySetting.save();
|
57
|
+
|
58
|
+
case 4:
|
59
|
+
setLoading(false);
|
60
|
+
onClose();
|
61
|
+
|
62
|
+
if (!isEditor) {
|
63
|
+
_message["default"].success('保存成功');
|
64
|
+
}
|
65
|
+
|
66
|
+
_context.next = 14;
|
67
|
+
break;
|
68
|
+
|
69
|
+
case 9:
|
70
|
+
_context.prev = 9;
|
71
|
+
_context.t0 = _context["catch"](1);
|
72
|
+
setLoading(false);
|
73
|
+
|
74
|
+
_rlog["default"].error('DisplaySettingDrawer.handleOk', _context.t0);
|
75
|
+
|
76
|
+
_message["default"].warning('保存失败');
|
77
|
+
|
78
|
+
case 14:
|
79
|
+
case "end":
|
80
|
+
return _context.stop();
|
83
81
|
}
|
84
82
|
}, _callee, null, [[1, 9]]);
|
85
83
|
}));
|
@@ -21,40 +21,38 @@ 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
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
return _context.stop();
|
57
|
-
}
|
24
|
+
while (1) switch (_context.prev = _context.next) {
|
25
|
+
case 0:
|
26
|
+
values = settingRef.current.getValues(); // console.info('保存显示配置', values)
|
27
|
+
// 保存配置
|
28
|
+
|
29
|
+
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
30
|
+
displayConfig = (0, _extends2["default"])({}, prevDisplayConfig, values);
|
31
|
+
_context.next = 5;
|
32
|
+
return topo.serverApi.saveTopoSettings(topo.id, {
|
33
|
+
alarmSwitch: displayConfig.alarmSwitch,
|
34
|
+
alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
|
35
|
+
extraConfig: JSON.stringify((0, _extends2["default"])({}, displayConfig))
|
36
|
+
});
|
37
|
+
|
38
|
+
case 5:
|
39
|
+
// 刷新指标配置
|
40
|
+
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
41
|
+
_context.next = 8;
|
42
|
+
return displayConfigDispatchers.update(displayConfig);
|
43
|
+
|
44
|
+
case 8:
|
45
|
+
// 更新节点名称显示隐藏
|
46
|
+
topo.attributeMetricDisplay.updateNodesNameVisible();
|
47
|
+
extraOnOk = (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk) || (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onDisplaySettingDrawerOk);
|
48
|
+
|
49
|
+
if (extraOnOk) {
|
50
|
+
extraOnOk(displayConfig);
|
51
|
+
}
|
52
|
+
|
53
|
+
case 11:
|
54
|
+
case "end":
|
55
|
+
return _context.stop();
|
58
56
|
}
|
59
57
|
}, _callee);
|
60
58
|
}));
|
@@ -68,40 +66,38 @@ var _default = function _default(props) {
|
|
68
66
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
69
67
|
var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
|
70
68
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
71
|
-
while (1) {
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
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
|
-
}
|
69
|
+
while (1) switch (_context2.prev = _context2.next) {
|
70
|
+
case 0:
|
71
|
+
topo.historyManager.beginTransaction();
|
72
|
+
values = settingRef.current.getValues(); // console.info('保存显示配置', values)
|
73
|
+
// 保存配置
|
94
74
|
|
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) {
|
95
88
|
_context2.next = 12;
|
96
|
-
|
89
|
+
break;
|
90
|
+
}
|
97
91
|
|
98
|
-
|
99
|
-
|
92
|
+
_context2.next = 12;
|
93
|
+
return extraOnOk(displayConfig);
|
100
94
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
95
|
+
case 12:
|
96
|
+
topo.historyManager.endTransaction();
|
97
|
+
|
98
|
+
case 13:
|
99
|
+
case "end":
|
100
|
+
return _context2.stop();
|
105
101
|
}
|
106
102
|
}, _callee2);
|
107
103
|
}));
|
@@ -114,29 +110,27 @@ var _default = function _default(props) {
|
|
114
110
|
var save = /*#__PURE__*/function () {
|
115
111
|
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
116
112
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
117
|
-
while (1) {
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
_context3.next = 5;
|
122
|
-
break;
|
123
|
-
}
|
124
|
-
|
125
|
-
_context3.next = 3;
|
126
|
-
return handleViewerSave();
|
127
|
-
|
128
|
-
case 3:
|
129
|
-
_context3.next = 7;
|
113
|
+
while (1) switch (_context3.prev = _context3.next) {
|
114
|
+
case 0:
|
115
|
+
if (isEditor) {
|
116
|
+
_context3.next = 5;
|
130
117
|
break;
|
118
|
+
}
|
119
|
+
|
120
|
+
_context3.next = 3;
|
121
|
+
return handleViewerSave();
|
122
|
+
|
123
|
+
case 3:
|
124
|
+
_context3.next = 7;
|
125
|
+
break;
|
131
126
|
|
132
|
-
|
133
|
-
|
134
|
-
|
127
|
+
case 5:
|
128
|
+
_context3.next = 7;
|
129
|
+
return handleEditorSave();
|
135
130
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
}
|
131
|
+
case 7:
|
132
|
+
case "end":
|
133
|
+
return _context3.stop();
|
140
134
|
}
|
141
135
|
}, _callee3);
|
142
136
|
}));
|
@@ -13,9 +13,11 @@ function TitleWidget(props) {
|
|
13
13
|
var topo = props.topo;
|
14
14
|
var store = topo.store;
|
15
15
|
var topoState = store.useModelState('topoMod');
|
16
|
-
|
17
|
-
_topoState$currentTop =
|
18
|
-
|
16
|
+
|
17
|
+
var _topoState$currentTop = topoState.currentTopo,
|
18
|
+
_topoState$currentTop2 = _topoState$currentTop === void 0 ? {} : _topoState$currentTop,
|
19
|
+
topoName = _topoState$currentTop2.name;
|
20
|
+
|
19
21
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
20
22
|
className: _TitleBarModule["default"].title
|
21
23
|
}, topoName);
|
@@ -27,6 +27,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
27
27
|
|
28
28
|
var _lodash = _interopRequireDefault(require("lodash"));
|
29
29
|
|
30
|
+
var _utils = require("@riil-frontend/utils");
|
31
|
+
|
30
32
|
var _indexModule = _interopRequireDefault(require("./index.module.scss"));
|
31
33
|
|
32
34
|
var config = _configProvider["default"].config;
|
@@ -161,28 +163,26 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
161
163
|
_this.handleSuccess = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
162
164
|
var onSuccess;
|
163
165
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
164
|
-
while (1) {
|
165
|
-
|
166
|
-
|
167
|
-
onSuccess = _this.props.onSuccess;
|
166
|
+
while (1) switch (_context.prev = _context.next) {
|
167
|
+
case 0:
|
168
|
+
onSuccess = _this.props.onSuccess;
|
168
169
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
170
|
+
_message["default"].show({
|
171
|
+
type: 'success',
|
172
|
+
title: '背景图上传成功'
|
173
|
+
});
|
173
174
|
|
174
|
-
|
175
|
-
|
176
|
-
|
175
|
+
_this.setState({
|
176
|
+
uploading: false
|
177
|
+
});
|
177
178
|
|
178
|
-
|
179
|
+
_this.resetState();
|
179
180
|
|
180
|
-
|
181
|
+
onSuccess();
|
181
182
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
}
|
183
|
+
case 5:
|
184
|
+
case "end":
|
185
|
+
return _context.stop();
|
186
186
|
}
|
187
187
|
}, _callee);
|
188
188
|
}));
|
@@ -238,7 +238,7 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
238
238
|
value: files,
|
239
239
|
action: "/topo/v1/api/background/upload/" + this.props.type,
|
240
240
|
headers: {
|
241
|
-
Authorization:
|
241
|
+
Authorization: (0, _utils.getToken)()
|
242
242
|
},
|
243
243
|
accept: ".png",
|
244
244
|
autoUpload: false,
|