@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
@@ -130,7 +130,7 @@ var Setting = function Setting(_ref) {
|
|
130
130
|
}, /*#__PURE__*/React.createElement(_Grid.Col, {
|
131
131
|
span: 8,
|
132
132
|
className: styles['tree-wrap']
|
133
|
-
}, dataSource.length && /*#__PURE__*/React.createElement(ActionTree, {
|
133
|
+
}, !!dataSource.length && /*#__PURE__*/React.createElement(ActionTree, {
|
134
134
|
dataSource: dataSource,
|
135
135
|
onSelect: onTreeSelect,
|
136
136
|
draggable: false,
|
@@ -15,24 +15,22 @@ 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
|
-
|
34
|
-
return _context.stop();
|
35
|
-
}
|
18
|
+
while (1) switch (_context.prev = _context.next) {
|
19
|
+
case 0:
|
20
|
+
result = selected;
|
21
|
+
|
22
|
+
if (mode === 'all') {
|
23
|
+
result = {
|
24
|
+
"static": [].concat(initialData["static"], selected)
|
25
|
+
};
|
26
|
+
}
|
27
|
+
|
28
|
+
_context.next = 4;
|
29
|
+
return onSave(result);
|
30
|
+
|
31
|
+
case 4:
|
32
|
+
case "end":
|
33
|
+
return _context.stop();
|
36
34
|
}
|
37
35
|
}, _callee);
|
38
36
|
}));
|
@@ -20,60 +20,58 @@ 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
|
-
|
23
|
+
while (1) switch (_context.prev = _context.next) {
|
24
|
+
case 0:
|
25
|
+
_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;
|
26
|
+
condition = "type('" + RESOURCE_LIMIT_TYPES.join('\',\'') + "') && category('resource')";
|
27
|
+
|
28
|
+
if (like) {
|
29
|
+
condition = {
|
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') {
|
30
40
|
condition = {
|
31
41
|
conditions: condition,
|
32
|
-
|
33
|
-
searchIndexArray: ['display_name', 'ipv4_address']
|
42
|
+
ciType: ciType
|
34
43
|
};
|
44
|
+
} else {
|
45
|
+
condition.ciType = ciType;
|
35
46
|
}
|
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
|
-
}
|
47
|
+
}
|
48
|
+
|
49
|
+
_context.next = 6;
|
50
|
+
return fetchCommonQuery(condition, sortBy, sortOrder, current, pageSize, '', {
|
51
|
+
usingExtraConditions: false // 绕过权限过滤
|
52
|
+
|
53
|
+
});
|
54
|
+
|
55
|
+
case 6:
|
56
|
+
data = _context.sent;
|
57
|
+
dataSource = data.content && data.content.map(function (item) {
|
58
|
+
var _item$operation;
|
59
|
+
|
60
|
+
return {
|
61
|
+
id: item.id,
|
62
|
+
displayName: item.attributes.displayName || item.attributes.display_name,
|
63
|
+
ipAddress: item.attributes.ipAddress || item.attributes.ipv4_address,
|
64
|
+
company: item.attributes.company,
|
65
|
+
typeCode: item.typeCode,
|
66
|
+
operation: (_item$operation = item.operation) !== null && _item$operation !== void 0 ? _item$operation : null // 权限字段
|
67
|
+
|
68
|
+
};
|
69
|
+
});
|
70
|
+
return _context.abrupt("return", formatDataForTable(dataSource, data.totalRecord, data.pageIndex, data.pageSize));
|
71
|
+
|
72
|
+
case 9:
|
73
|
+
case "end":
|
74
|
+
return _context.stop();
|
77
75
|
}
|
78
76
|
}, _callee);
|
79
77
|
}));
|
@@ -40,37 +40,35 @@ 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
|
-
|
50
|
-
return onOk(selectionMode === 'single' ? selected[0] : selected);
|
43
|
+
while (1) switch (_context.prev = _context.next) {
|
44
|
+
case 0:
|
45
|
+
setLoading(true);
|
46
|
+
_context.prev = 1;
|
47
|
+
selected = resourceSelectRef.current.getSelectedRowKeys();
|
48
|
+
_context.next = 5;
|
49
|
+
return onOk(selectionMode === 'single' ? selected[0] : selected);
|
51
50
|
|
52
|
-
|
53
|
-
|
51
|
+
case 5:
|
52
|
+
shouldClose = _context.sent;
|
54
53
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
if (shouldClose !== false) {
|
55
|
+
onClose();
|
56
|
+
} else {
|
57
|
+
setLoading(false);
|
58
|
+
}
|
60
59
|
|
61
|
-
|
62
|
-
|
60
|
+
_context.next = 13;
|
61
|
+
break;
|
63
62
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
case 9:
|
64
|
+
_context.prev = 9;
|
65
|
+
_context.t0 = _context["catch"](1);
|
66
|
+
setLoading(false);
|
67
|
+
rlog.error('ResourceSelectDrawer.handleOk', _context.t0);
|
69
68
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
}
|
69
|
+
case 13:
|
70
|
+
case "end":
|
71
|
+
return _context.stop();
|
74
72
|
}
|
75
73
|
}, _callee, null, [[1, 9]]);
|
76
74
|
}));
|
@@ -13,26 +13,24 @@ 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
|
-
|
34
|
-
return _context.stop();
|
35
|
-
}
|
16
|
+
while (1) switch (_context.prev = _context.next) {
|
17
|
+
case 0:
|
18
|
+
if (selected.length) {
|
19
|
+
_context.next = 3;
|
20
|
+
break;
|
21
|
+
}
|
22
|
+
|
23
|
+
_Message.error('请选择一项资源。');
|
24
|
+
|
25
|
+
return _context.abrupt("return", false);
|
26
|
+
|
27
|
+
case 3:
|
28
|
+
_context.next = 5;
|
29
|
+
return onSave(selected[0]);
|
30
|
+
|
31
|
+
case 5:
|
32
|
+
case "end":
|
33
|
+
return _context.stop();
|
36
34
|
}
|
37
35
|
}, _callee);
|
38
36
|
}));
|
@@ -28,37 +28,35 @@ 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
|
-
|
37
|
-
return displaySetting.save();
|
31
|
+
while (1) switch (_context.prev = _context.next) {
|
32
|
+
case 0:
|
33
|
+
setLoading(true);
|
34
|
+
_context.prev = 1;
|
35
|
+
_context.next = 4;
|
36
|
+
return displaySetting.save();
|
38
37
|
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
case 4:
|
39
|
+
setLoading(false);
|
40
|
+
onClose();
|
42
41
|
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
if (!isEditor) {
|
43
|
+
_Message.success('保存成功');
|
44
|
+
}
|
46
45
|
|
47
|
-
|
48
|
-
|
46
|
+
_context.next = 14;
|
47
|
+
break;
|
49
48
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
49
|
+
case 9:
|
50
|
+
_context.prev = 9;
|
51
|
+
_context.t0 = _context["catch"](1);
|
52
|
+
setLoading(false);
|
53
|
+
rlog.error('DisplaySettingDrawer.handleOk', _context.t0);
|
55
54
|
|
56
|
-
|
55
|
+
_Message.warning('保存失败');
|
57
56
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
}
|
57
|
+
case 14:
|
58
|
+
case "end":
|
59
|
+
return _context.stop();
|
62
60
|
}
|
63
61
|
}, _callee, null, [[1, 9]]);
|
64
62
|
}));
|
@@ -11,40 +11,38 @@ 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
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
return _context.stop();
|
47
|
-
}
|
14
|
+
while (1) switch (_context.prev = _context.next) {
|
15
|
+
case 0:
|
16
|
+
values = settingRef.current.getValues(); // console.info('保存显示配置', values)
|
17
|
+
// 保存配置
|
18
|
+
|
19
|
+
prevDisplayConfig = topo.store.getModelState('displayConfig');
|
20
|
+
displayConfig = _extends({}, prevDisplayConfig, values);
|
21
|
+
_context.next = 5;
|
22
|
+
return topo.serverApi.saveTopoSettings(topo.id, {
|
23
|
+
alarmSwitch: displayConfig.alarmSwitch,
|
24
|
+
alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
|
25
|
+
extraConfig: JSON.stringify(_extends({}, displayConfig))
|
26
|
+
});
|
27
|
+
|
28
|
+
case 5:
|
29
|
+
// 刷新指标配置
|
30
|
+
displayConfigDispatchers = topo.store.getModelDispatchers('displayConfig');
|
31
|
+
_context.next = 8;
|
32
|
+
return displayConfigDispatchers.update(displayConfig);
|
33
|
+
|
34
|
+
case 8:
|
35
|
+
// 更新节点名称显示隐藏
|
36
|
+
topo.attributeMetricDisplay.updateNodesNameVisible();
|
37
|
+
extraOnOk = (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onOk) || (displaySettingProps === null || displaySettingProps === void 0 ? void 0 : displaySettingProps.onDisplaySettingDrawerOk);
|
38
|
+
|
39
|
+
if (extraOnOk) {
|
40
|
+
extraOnOk(displayConfig);
|
41
|
+
}
|
42
|
+
|
43
|
+
case 11:
|
44
|
+
case "end":
|
45
|
+
return _context.stop();
|
48
46
|
}
|
49
47
|
}, _callee);
|
50
48
|
}));
|
@@ -58,40 +56,38 @@ export default (function (props) {
|
|
58
56
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
59
57
|
var values, prevDisplayConfig, displayConfig, displayConfigDispatchers, extraOnOk;
|
60
58
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
61
|
-
while (1) {
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
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
|
-
}
|
59
|
+
while (1) switch (_context2.prev = _context2.next) {
|
60
|
+
case 0:
|
61
|
+
topo.historyManager.beginTransaction();
|
62
|
+
values = settingRef.current.getValues(); // console.info('保存显示配置', values)
|
63
|
+
// 保存配置
|
84
64
|
|
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) {
|
85
78
|
_context2.next = 12;
|
86
|
-
|
79
|
+
break;
|
80
|
+
}
|
87
81
|
|
88
|
-
|
89
|
-
|
82
|
+
_context2.next = 12;
|
83
|
+
return extraOnOk(displayConfig);
|
90
84
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
85
|
+
case 12:
|
86
|
+
topo.historyManager.endTransaction();
|
87
|
+
|
88
|
+
case 13:
|
89
|
+
case "end":
|
90
|
+
return _context2.stop();
|
95
91
|
}
|
96
92
|
}, _callee2);
|
97
93
|
}));
|
@@ -104,29 +100,27 @@ export default (function (props) {
|
|
104
100
|
var save = /*#__PURE__*/function () {
|
105
101
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
106
102
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
107
|
-
while (1) {
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
_context3.next = 5;
|
112
|
-
break;
|
113
|
-
}
|
114
|
-
|
115
|
-
_context3.next = 3;
|
116
|
-
return handleViewerSave();
|
117
|
-
|
118
|
-
case 3:
|
119
|
-
_context3.next = 7;
|
103
|
+
while (1) switch (_context3.prev = _context3.next) {
|
104
|
+
case 0:
|
105
|
+
if (isEditor) {
|
106
|
+
_context3.next = 5;
|
120
107
|
break;
|
108
|
+
}
|
109
|
+
|
110
|
+
_context3.next = 3;
|
111
|
+
return handleViewerSave();
|
112
|
+
|
113
|
+
case 3:
|
114
|
+
_context3.next = 7;
|
115
|
+
break;
|
121
116
|
|
122
|
-
|
123
|
-
|
124
|
-
|
117
|
+
case 5:
|
118
|
+
_context3.next = 7;
|
119
|
+
return handleEditorSave();
|
125
120
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
}
|
121
|
+
case 7:
|
122
|
+
case "end":
|
123
|
+
return _context3.stop();
|
130
124
|
}
|
131
125
|
}, _callee3);
|
132
126
|
}));
|
@@ -4,9 +4,11 @@ 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
|
-
_topoState$currentTop =
|
9
|
-
|
7
|
+
|
8
|
+
var _topoState$currentTop = topoState.currentTopo,
|
9
|
+
_topoState$currentTop2 = _topoState$currentTop === void 0 ? {} : _topoState$currentTop,
|
10
|
+
topoName = _topoState$currentTop2.name;
|
11
|
+
|
10
12
|
return /*#__PURE__*/React.createElement("div", {
|
11
13
|
className: styles.title
|
12
14
|
}, topoName);
|
@@ -9,6 +9,7 @@ import _ConfigProvider from "@alifd/next/es/config-provider";
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
10
10
|
import React from 'react';
|
11
11
|
import _ from 'lodash';
|
12
|
+
import { getToken } from '@riil-frontend/utils';
|
12
13
|
import styles from "./index.module.scss";
|
13
14
|
var config = _ConfigProvider.config;
|
14
15
|
|
@@ -142,28 +143,26 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
142
143
|
_this.handleSuccess = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
143
144
|
var onSuccess;
|
144
145
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
145
|
-
while (1) {
|
146
|
-
|
147
|
-
|
148
|
-
onSuccess = _this.props.onSuccess;
|
146
|
+
while (1) switch (_context.prev = _context.next) {
|
147
|
+
case 0:
|
148
|
+
onSuccess = _this.props.onSuccess;
|
149
149
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
150
|
+
_Message.show({
|
151
|
+
type: 'success',
|
152
|
+
title: '背景图上传成功'
|
153
|
+
});
|
154
154
|
|
155
|
-
|
156
|
-
|
157
|
-
|
155
|
+
_this.setState({
|
156
|
+
uploading: false
|
157
|
+
});
|
158
158
|
|
159
|
-
|
159
|
+
_this.resetState();
|
160
160
|
|
161
|
-
|
161
|
+
onSuccess();
|
162
162
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
}
|
163
|
+
case 5:
|
164
|
+
case "end":
|
165
|
+
return _context.stop();
|
167
166
|
}
|
168
167
|
}, _callee);
|
169
168
|
}));
|
@@ -219,7 +218,7 @@ var UploadIconDialog = /*#__PURE__*/function (_React$Component) {
|
|
219
218
|
value: files,
|
220
219
|
action: "/topo/v1/api/background/upload/" + this.props.type,
|
221
220
|
headers: {
|
222
|
-
Authorization:
|
221
|
+
Authorization: getToken()
|
223
222
|
},
|
224
223
|
accept: ".png",
|
225
224
|
autoUpload: false,
|