@riil-frontend/component-topology 11.0.33 → 11.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +4 -2
- package/build/index.js +52 -45
- package/es/components/MultiResourceDrawer/index.js +22 -26
- package/es/components/ResourceList/ResourceSelect.js +55 -58
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
- package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
- package/es/core/editor/components/BackgroundView/index.js +149 -178
- package/es/core/editor/components/BackgroundView/index.module.scss +2 -1
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
- package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/es/core/editor/hooks/useNewElementTheme.js +2 -2
- package/es/core/editor/store/background.js +8 -10
- package/es/core/editor/store/topoEdit.js +4 -6
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +130 -142
- package/es/core/hooks/useResourceConfig.js +76 -100
- package/es/core/hooks/useTopoEdit.js +525 -623
- package/es/core/models/Alarm.js +319 -402
- package/es/core/models/AttributeMetricDisplay.js +115 -143
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +279 -436
- package/es/core/models/TopoGraphView.js +28 -41
- package/es/core/models/cache/CiCache.js +34 -39
- package/es/core/models/cache/CiTypeCache.js +47 -61
- package/es/core/models/cache/DictCache.js +36 -42
- package/es/core/models/graph/Background.js +21 -26
- package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
- package/es/core/models/tagstips/ElementTagTipConfig.js +44 -58
- package/es/core/models/topoData.js +73 -77
- package/es/core/models/utils/linkUtils.js +46 -51
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/es/core/services/alarm.js +14 -16
- package/es/core/services/background.js +59 -67
- package/es/core/services/cmdb/metric.js +14 -18
- package/es/core/services/cmdb.js +23 -27
- package/es/core/services/index.js +48 -68
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +37 -41
- package/es/core/services/topo/tagtip.js +15 -19
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +126 -145
- package/es/core/store/models/displayConfig.js +15 -19
- package/es/core/store/models/selection.js +4 -6
- package/es/core/store/models/topoAlarm.js +162 -145
- package/es/core/store/models/topoBaseInfoOverview.js +4 -6
- package/es/core/store/models/topoBizMod.js +9 -11
- package/es/core/store/models/topoConfig.js +215 -231
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +373 -395
- package/es/core/utils/imageUtil.js +23 -27
- package/es/core/utils/saveSerialize.js +14 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
- package/es/networkTopo/components/Link/hook.js +85 -96
- package/es/networkTopo/components/Link/index.js +104 -126
- package/es/networkTopo/components/Link/setting.js +48 -52
- package/es/networkTopo/getTopoData.js +73 -92
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +28 -46
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +548 -696
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +33 -48
- package/es/networkTopo/services/metric.js +38 -47
- package/es/networkTopo/services/model.js +616 -809
- package/es/networkTopo/services/risk.js +9 -11
- package/es/networkTopo/services/topo/auth.js +27 -33
- package/es/networkTopo/services/topo/basic.js +251 -289
- package/es/networkTopo/services/topo/blacklist.js +20 -24
- package/es/networkTopo/services/topo/ciInfo.js +27 -31
- package/es/networkTopo/services/topo/icon.js +49 -59
- package/es/networkTopo/services/topo/networkLink.js +32 -36
- package/es/networkTopo/services/topo/relation.js +9 -11
- package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
- package/es/networkTopo/store/functionAuth.js +31 -37
- package/es/networkTopo/store/topoCenter.js +142 -152
- package/es/networkTopo/store/topoLinkMod.js +4 -6
- package/es/networkTopo/store/topoTreeMod.js +170 -182
- package/es/networkTopo/utils/exportData.js +57 -61
- package/lib/components/MultiResourceDrawer/index.js +22 -26
- package/lib/components/ResourceList/ResourceSelect.js +54 -58
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
- package/lib/core/editor/components/BackgroundView/index.js +148 -177
- package/lib/core/editor/components/BackgroundView/index.module.scss +2 -1
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
- package/lib/core/editor/store/background.js +8 -10
- package/lib/core/editor/store/topoEdit.js +4 -6
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +129 -141
- package/lib/core/hooks/useResourceConfig.js +76 -100
- package/lib/core/hooks/useTopoEdit.js +517 -615
- package/lib/core/models/Alarm.js +313 -396
- package/lib/core/models/AttributeMetricDisplay.js +118 -146
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +279 -436
- package/lib/core/models/TopoGraphView.js +28 -41
- package/lib/core/models/cache/CiCache.js +39 -44
- package/lib/core/models/cache/CiTypeCache.js +48 -62
- package/lib/core/models/cache/DictCache.js +39 -45
- package/lib/core/models/graph/Background.js +22 -27
- package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
- package/lib/core/models/tagstips/ElementTagTipConfig.js +44 -58
- package/lib/core/models/topoData.js +73 -78
- package/lib/core/models/utils/linkUtils.js +45 -51
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/lib/core/services/alarm.js +18 -20
- package/lib/core/services/background.js +70 -78
- package/lib/core/services/cmdb/metric.js +14 -19
- package/lib/core/services/cmdb.js +24 -29
- package/lib/core/services/index.js +53 -72
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +37 -41
- package/lib/core/services/topo/tagtip.js +16 -21
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +126 -145
- package/lib/core/store/models/displayConfig.js +15 -19
- package/lib/core/store/models/selection.js +4 -6
- package/lib/core/store/models/topoAlarm.js +163 -145
- package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
- package/lib/core/store/models/topoBizMod.js +9 -11
- package/lib/core/store/models/topoConfig.js +222 -238
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +375 -397
- package/lib/core/utils/imageUtil.js +26 -31
- package/lib/core/utils/saveSerialize.js +13 -18
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
- package/lib/networkTopo/components/Link/hook.js +86 -98
- package/lib/networkTopo/components/Link/index.js +105 -127
- package/lib/networkTopo/components/Link/setting.js +48 -52
- package/lib/networkTopo/getTopoData.js +73 -92
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +28 -46
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +551 -700
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +35 -51
- package/lib/networkTopo/services/metric.js +37 -47
- package/lib/networkTopo/services/model.js +615 -809
- package/lib/networkTopo/services/risk.js +11 -13
- package/lib/networkTopo/services/topo/auth.js +27 -33
- package/lib/networkTopo/services/topo/basic.js +252 -290
- package/lib/networkTopo/services/topo/blacklist.js +20 -24
- package/lib/networkTopo/services/topo/ciInfo.js +34 -38
- package/lib/networkTopo/services/topo/icon.js +59 -69
- package/lib/networkTopo/services/topo/networkLink.js +32 -36
- package/lib/networkTopo/services/topo/relation.js +11 -13
- package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
- package/lib/networkTopo/store/functionAuth.js +31 -37
- package/lib/networkTopo/store/topoCenter.js +142 -152
- package/lib/networkTopo/store/topoLinkMod.js +4 -6
- package/lib/networkTopo/store/topoTreeMod.js +166 -178
- package/lib/networkTopo/utils/exportData.js +63 -68
- package/package.json +4 -3
@@ -34,6 +34,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
34
34
|
* 通过ref调用show方法来打开,编辑场景传入link对象
|
35
35
|
*/
|
36
36
|
var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
37
|
+
var _ref2, _ref3, _ref4, _ref5;
|
38
|
+
|
37
39
|
var topoContext = props.topoContext,
|
38
40
|
topo = props.topo;
|
39
41
|
var store = topo.store;
|
@@ -101,155 +103,131 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
101
103
|
}
|
102
104
|
}, [urlParams.showAddLink]); // 链路更新,通过资源重新获取链路信息通知HT来更新
|
103
105
|
|
104
|
-
var refreshLink =
|
105
|
-
|
106
|
+
var refreshLink = function refreshLink() {
|
107
|
+
return (_ref2 = _ref2 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
106
108
|
var data;
|
107
109
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
108
|
-
while (1) {
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
return _context.stop();
|
126
|
-
}
|
110
|
+
while (1) switch (_context.prev = _context.next) {
|
111
|
+
case 0:
|
112
|
+
_rlog["default"].debug('useTopoEdit.refreshLink');
|
113
|
+
|
114
|
+
_context.next = 3;
|
115
|
+
return editDispatchers.fetchData();
|
116
|
+
|
117
|
+
case 3:
|
118
|
+
data = _context.sent;
|
119
|
+
topo.view.topoClient.emitEvent(_componentTopologyGraph.TopoEvent.EVENT_DATA_RESULT, {
|
120
|
+
type: _componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO,
|
121
|
+
data: data
|
122
|
+
});
|
123
|
+
|
124
|
+
case 5:
|
125
|
+
case "end":
|
126
|
+
return _context.stop();
|
127
127
|
}
|
128
128
|
}, _callee);
|
129
|
-
}));
|
130
|
-
|
131
|
-
return function refreshLink() {
|
132
|
-
return _ref2.apply(this, arguments);
|
133
|
-
};
|
134
|
-
}();
|
129
|
+
}))).apply(this, arguments);
|
130
|
+
};
|
135
131
|
|
136
|
-
var getLink =
|
137
|
-
|
132
|
+
var getLink = function getLink(_x) {
|
133
|
+
return (_ref3 = _ref3 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
|
138
134
|
var data;
|
139
135
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
140
|
-
while (1) {
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
return
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
return _context2.stop();
|
155
|
-
}
|
136
|
+
while (1) switch (_context2.prev = _context2.next) {
|
137
|
+
case 0:
|
138
|
+
_context2.next = 2;
|
139
|
+
return editDispatchers.fetchData();
|
140
|
+
|
141
|
+
case 2:
|
142
|
+
data = _context2.sent;
|
143
|
+
return _context2.abrupt("return", data.filter(function (item) {
|
144
|
+
return item.id === id;
|
145
|
+
})[0]);
|
146
|
+
|
147
|
+
case 4:
|
148
|
+
case "end":
|
149
|
+
return _context2.stop();
|
156
150
|
}
|
157
151
|
}, _callee2);
|
158
|
-
}));
|
159
|
-
|
160
|
-
return function getLink(_x) {
|
161
|
-
return _ref3.apply(this, arguments);
|
162
|
-
};
|
163
|
-
}();
|
152
|
+
}))).apply(this, arguments);
|
153
|
+
};
|
164
154
|
|
165
|
-
var updateTopo = (0, _react.useCallback)(
|
166
|
-
|
167
|
-
var changed, isAdd, _data$result
|
155
|
+
var updateTopo = (0, _react.useCallback)(function (_x2) {
|
156
|
+
return (_ref4 = _ref4 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(data) {
|
157
|
+
var changed, isAdd, _data$result$2, oldId, id, linkData;
|
168
158
|
|
169
159
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
170
|
-
while (1) {
|
171
|
-
|
172
|
-
|
173
|
-
changed = data.changed, isAdd = data.isAddMode;
|
174
|
-
|
175
|
-
if (!(changed === false)) {
|
176
|
-
_context3.next = 3;
|
177
|
-
break;
|
178
|
-
}
|
160
|
+
while (1) switch (_context3.prev = _context3.next) {
|
161
|
+
case 0:
|
162
|
+
changed = data.changed, isAdd = data.isAddMode;
|
179
163
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
_context3.next = 8;
|
185
|
-
break;
|
186
|
-
}
|
164
|
+
if (!(changed === false)) {
|
165
|
+
_context3.next = 3;
|
166
|
+
break;
|
167
|
+
}
|
187
168
|
|
188
|
-
|
189
|
-
return refreshLink();
|
169
|
+
return _context3.abrupt("return");
|
190
170
|
|
191
|
-
|
192
|
-
|
171
|
+
case 3:
|
172
|
+
if (!isAdd) {
|
173
|
+
_context3.next = 8;
|
193
174
|
break;
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
175
|
+
}
|
176
|
+
|
177
|
+
_context3.next = 6;
|
178
|
+
return refreshLink();
|
179
|
+
|
180
|
+
case 6:
|
181
|
+
_context3.next = 13;
|
182
|
+
break;
|
183
|
+
|
184
|
+
case 8:
|
185
|
+
_data$result$2 = data.result[0], oldId = _data$result$2.oldId, id = _data$result$2.id;
|
186
|
+
_context3.next = 11;
|
187
|
+
return getLink(id);
|
188
|
+
|
189
|
+
case 11:
|
190
|
+
linkData = _context3.sent;
|
191
|
+
topo.view.topoClient.emitEvent('topo_link_update', {
|
192
|
+
id: oldId,
|
193
|
+
link: linkData
|
194
|
+
});
|
195
|
+
|
196
|
+
case 13:
|
197
|
+
case "end":
|
198
|
+
return _context3.stop();
|
211
199
|
}
|
212
200
|
}, _callee3);
|
213
|
-
}));
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
};
|
218
|
-
}(), []);
|
219
|
-
var handleSaved = (0, _react.useCallback)( /*#__PURE__*/function () {
|
220
|
-
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(data) {
|
201
|
+
}))).apply(this, arguments);
|
202
|
+
}, []);
|
203
|
+
var handleSaved = (0, _react.useCallback)(function (_x3) {
|
204
|
+
return (_ref5 = _ref5 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(data) {
|
221
205
|
var errorItems;
|
222
206
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
223
|
-
while (1) {
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
return _context4.stop();
|
244
|
-
}
|
207
|
+
while (1) switch (_context4.prev = _context4.next) {
|
208
|
+
case 0:
|
209
|
+
errorItems = data.errorItems;
|
210
|
+
|
211
|
+
if (errorItems.length) {
|
212
|
+
_context4.next = 7;
|
213
|
+
break;
|
214
|
+
}
|
215
|
+
|
216
|
+
setFalse();
|
217
|
+
setUpdateTopoState(true);
|
218
|
+
_context4.next = 6;
|
219
|
+
return updateTopo(data);
|
220
|
+
|
221
|
+
case 6:
|
222
|
+
setUpdateTopoState(false);
|
223
|
+
|
224
|
+
case 7:
|
225
|
+
case "end":
|
226
|
+
return _context4.stop();
|
245
227
|
}
|
246
228
|
}, _callee4);
|
247
|
-
}));
|
248
|
-
|
249
|
-
return function (_x3) {
|
250
|
-
return _ref5.apply(this, arguments);
|
251
|
-
};
|
252
|
-
}(), []);
|
229
|
+
}))).apply(this, arguments);
|
230
|
+
}, []);
|
253
231
|
return /*#__PURE__*/_react["default"].createElement(_drawer["default"], {
|
254
232
|
closeMode: ['close', 'esc'],
|
255
233
|
visible: visible,
|
@@ -66,6 +66,8 @@ var Title = function Title(_ref) {
|
|
66
66
|
|
67
67
|
|
68
68
|
var LinkSetting = function LinkSetting(_ref2) {
|
69
|
+
var _ref3;
|
70
|
+
|
69
71
|
var link = _ref2.link,
|
70
72
|
topoElements = _ref2.topoElements,
|
71
73
|
topo = _ref2.topo,
|
@@ -134,62 +136,56 @@ var LinkSetting = function LinkSetting(_ref2) {
|
|
134
136
|
return validatorErrors;
|
135
137
|
};
|
136
138
|
|
137
|
-
var onSave =
|
138
|
-
|
139
|
-
var values, _values
|
139
|
+
var onSave = function onSave() {
|
140
|
+
return (_ref3 = _ref3 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
141
|
+
var values, _values$2, src, dst;
|
140
142
|
|
141
143
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
142
|
-
while (1) {
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
return _context.stop();
|
184
|
-
}
|
144
|
+
while (1) switch (_context.prev = _context.next) {
|
145
|
+
case 0:
|
146
|
+
if (!(0, _utils.isAvailableArray)(getValidatorErrors())) {
|
147
|
+
_context.next = 2;
|
148
|
+
break;
|
149
|
+
}
|
150
|
+
|
151
|
+
return _context.abrupt("return");
|
152
|
+
|
153
|
+
case 2:
|
154
|
+
values = list.map(function (i, index) {
|
155
|
+
return refs[index].field.getValues();
|
156
|
+
});
|
157
|
+
|
158
|
+
if (isAddMode) {
|
159
|
+
_context.next = 8;
|
160
|
+
break;
|
161
|
+
}
|
162
|
+
|
163
|
+
_values$2 = values[0], src = _values$2.src, dst = _values$2.dst;
|
164
|
+
|
165
|
+
if (!(src.sub === link.interfaceSource && dst.sub === link.interfaceTarget)) {
|
166
|
+
_context.next = 8;
|
167
|
+
break;
|
168
|
+
}
|
169
|
+
|
170
|
+
saveCb({
|
171
|
+
changed: false
|
172
|
+
});
|
173
|
+
return _context.abrupt("return");
|
174
|
+
|
175
|
+
case 8:
|
176
|
+
_context.next = 10;
|
177
|
+
return execSave({
|
178
|
+
link: link,
|
179
|
+
values: values
|
180
|
+
});
|
181
|
+
|
182
|
+
case 10:
|
183
|
+
case "end":
|
184
|
+
return _context.stop();
|
185
185
|
}
|
186
186
|
}, _callee);
|
187
|
-
}));
|
188
|
-
|
189
|
-
return function onSave() {
|
190
|
-
return _ref3.apply(this, arguments);
|
191
|
-
};
|
192
|
-
}();
|
187
|
+
}))).apply(this, arguments);
|
188
|
+
};
|
193
189
|
|
194
190
|
var formProp = {
|
195
191
|
link: link,
|
@@ -17,6 +17,8 @@ var _linkUtils = require("../core/models/utils/linkUtils");
|
|
17
17
|
|
18
18
|
var _resourcePermissionUtil = require("./utils/resourcePermissionUtil");
|
19
19
|
|
20
|
+
var _addLinkData, _buildData, _getTopoData;
|
21
|
+
|
20
22
|
// import "./utils/__tests__/resourcePermissionUtil.test";
|
21
23
|
// 过滤掉无两端节点数据的链路
|
22
24
|
function filterLinkNoSourceTarget(data) {
|
@@ -75,113 +77,92 @@ function isNetworkLink(link) {
|
|
75
77
|
}
|
76
78
|
|
77
79
|
function addLinkData(_x) {
|
78
|
-
return _addLinkData
|
79
|
-
} // FIXME 业务拓扑不需要链路相关逻辑
|
80
|
-
|
81
|
-
|
82
|
-
function _addLinkData() {
|
83
|
-
_addLinkData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
|
80
|
+
return (_addLinkData = _addLinkData || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
|
84
81
|
var links, nodes, prevNetworkLinks, networkLinks, otherLinks;
|
85
82
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
86
|
-
while (1) {
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
return _context.stop();
|
111
|
-
}
|
83
|
+
while (1) switch (_context.prev = _context.next) {
|
84
|
+
case 0:
|
85
|
+
links = data.links || [];
|
86
|
+
nodes = data.nodes || []; // 如果是网络链路,补充详情信息
|
87
|
+
|
88
|
+
prevNetworkLinks = links.filter(function (link) {
|
89
|
+
return isNetworkLink(link);
|
90
|
+
});
|
91
|
+
_context.next = 5;
|
92
|
+
return (0, _linkUtils.getLinksDetail)(prevNetworkLinks, nodes);
|
93
|
+
|
94
|
+
case 5:
|
95
|
+
networkLinks = _context.sent;
|
96
|
+
otherLinks = links.filter(function (link) {
|
97
|
+
return !isNetworkLink(link);
|
98
|
+
});
|
99
|
+
return _context.abrupt("return", (0, _extends2["default"])({}, data, {
|
100
|
+
links: [].concat(networkLinks, otherLinks),
|
101
|
+
linkGroups: []
|
102
|
+
}));
|
103
|
+
|
104
|
+
case 8:
|
105
|
+
case "end":
|
106
|
+
return _context.stop();
|
112
107
|
}
|
113
108
|
}, _callee);
|
114
|
-
}));
|
115
|
-
|
116
|
-
}
|
109
|
+
}))).apply(this, arguments);
|
110
|
+
} // FIXME 业务拓扑不需要链路相关逻辑
|
117
111
|
|
118
|
-
function buildData(_x2) {
|
119
|
-
return _buildData.apply(this, arguments);
|
120
|
-
}
|
121
112
|
|
122
|
-
function
|
123
|
-
_buildData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(oldData) {
|
113
|
+
function buildData(_x2) {
|
114
|
+
return (_buildData = _buildData || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(oldData) {
|
124
115
|
var data;
|
125
116
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
126
|
-
while (1) {
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
return _context2.stop();
|
139
|
-
}
|
117
|
+
while (1) switch (_context2.prev = _context2.next) {
|
118
|
+
case 0:
|
119
|
+
data = oldData;
|
120
|
+
data = fixNodeGroupId(data);
|
121
|
+
data = filterLinkNoSourceTarget(data); // data = await addLinkData(data)
|
122
|
+
|
123
|
+
data = (0, _resourcePermissionUtil.addTopoDataResourcePermission)(data);
|
124
|
+
return _context2.abrupt("return", data);
|
125
|
+
|
126
|
+
case 5:
|
127
|
+
case "end":
|
128
|
+
return _context2.stop();
|
140
129
|
}
|
141
130
|
}, _callee2);
|
142
|
-
}));
|
143
|
-
return _buildData.apply(this, arguments);
|
131
|
+
}))).apply(this, arguments);
|
144
132
|
}
|
145
133
|
|
146
134
|
function getTopoData(_x3, _x4) {
|
147
|
-
return _getTopoData.
|
148
|
-
}
|
149
|
-
|
150
|
-
function _getTopoData() {
|
151
|
-
_getTopoData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id, topoService) {
|
135
|
+
return (_getTopoData = _getTopoData || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id, topoService) {
|
152
136
|
var data;
|
153
137
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
154
|
-
while (1) {
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
return _context3.stop();
|
182
|
-
}
|
138
|
+
while (1) switch (_context3.prev = _context3.next) {
|
139
|
+
case 0:
|
140
|
+
_context3.next = 2;
|
141
|
+
return topoService.getTopoData(id);
|
142
|
+
|
143
|
+
case 2:
|
144
|
+
data = _context3.sent;
|
145
|
+
|
146
|
+
if (data) {
|
147
|
+
_context3.next = 5;
|
148
|
+
break;
|
149
|
+
}
|
150
|
+
|
151
|
+
return _context3.abrupt("return", data);
|
152
|
+
|
153
|
+
case 5:
|
154
|
+
data = fixAlarmConfig(data);
|
155
|
+
_context3.next = 8;
|
156
|
+
return buildData(data);
|
157
|
+
|
158
|
+
case 8:
|
159
|
+
data = _context3.sent;
|
160
|
+
return _context3.abrupt("return", data);
|
161
|
+
|
162
|
+
case 10:
|
163
|
+
case "end":
|
164
|
+
return _context3.stop();
|
183
165
|
}
|
184
166
|
}, _callee3);
|
185
|
-
}));
|
186
|
-
return _getTopoData.apply(this, arguments);
|
167
|
+
}))).apply(this, arguments);
|
187
168
|
}
|