@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
@@ -115,64 +115,62 @@ function _updateLink() {
|
|
115
115
|
_updateLink = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(oldLink, params) {
|
116
116
|
var result, src, dst, srcRelation, dstRelation, srcIsCurrentRelation, dstIsCurrentRelation, onlyChangeOneEnd, createResult;
|
117
117
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
118
|
-
while (1) {
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
if (!onlyChangeOneEnd) {
|
141
|
-
_context.next = 14;
|
142
|
-
break;
|
143
|
-
}
|
144
|
-
|
118
|
+
while (1) switch (_context.prev = _context.next) {
|
119
|
+
case 0:
|
120
|
+
result = {
|
121
|
+
oldId: oldLink.id
|
122
|
+
};
|
123
|
+
src = params.src, dst = params.dst; // 如果只修改一端,则先删除再新建
|
124
|
+
|
125
|
+
_context.next = 4;
|
126
|
+
return cmdbService.queryRelationByEndpoint(src.sub);
|
127
|
+
|
128
|
+
case 4:
|
129
|
+
srcRelation = _context.sent;
|
130
|
+
_context.next = 7;
|
131
|
+
return cmdbService.queryRelationByEndpoint(dst.sub);
|
132
|
+
|
133
|
+
case 7:
|
134
|
+
dstRelation = _context.sent;
|
135
|
+
srcIsCurrentRelation = srcRelation && srcRelation.id === oldLink.id && !dstRelation;
|
136
|
+
dstIsCurrentRelation = dstRelation && dstRelation.id === oldLink.id && !srcRelation;
|
137
|
+
onlyChangeOneEnd = srcIsCurrentRelation || dstIsCurrentRelation;
|
138
|
+
|
139
|
+
if (!onlyChangeOneEnd) {
|
145
140
|
_context.next = 14;
|
146
|
-
|
141
|
+
break;
|
142
|
+
}
|
147
143
|
|
148
|
-
|
149
|
-
|
150
|
-
return cmdbService.batchCreateRelation([buildCreateLinkParams(params, 0)]);
|
144
|
+
_context.next = 14;
|
145
|
+
return cmdbService.forceDeleteRelation(oldLink.id);
|
151
146
|
|
152
|
-
|
153
|
-
|
154
|
-
|
147
|
+
case 14:
|
148
|
+
_context.next = 16;
|
149
|
+
return cmdbService.batchCreateRelation([buildCreateLinkParams(params, 0)]);
|
155
150
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
}
|
151
|
+
case 16:
|
152
|
+
createResult = _context.sent;
|
153
|
+
Object.assign(result, createResult[0]);
|
160
154
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
155
|
+
if (!(result.status === 0)) {
|
156
|
+
_context.next = 22;
|
157
|
+
break;
|
158
|
+
}
|
165
159
|
|
160
|
+
if (onlyChangeOneEnd) {
|
166
161
|
_context.next = 22;
|
167
|
-
|
162
|
+
break;
|
163
|
+
}
|
164
|
+
|
165
|
+
_context.next = 22;
|
166
|
+
return cmdbService.forceDeleteRelation(oldLink.id);
|
168
167
|
|
169
|
-
|
170
|
-
|
168
|
+
case 22:
|
169
|
+
return _context.abrupt("return", result);
|
171
170
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
}
|
171
|
+
case 23:
|
172
|
+
case "end":
|
173
|
+
return _context.stop();
|
176
174
|
}
|
177
175
|
}, _callee);
|
178
176
|
}));
|
@@ -195,34 +193,32 @@ function _saveLink() {
|
|
195
193
|
var link, values, params, result, _params;
|
196
194
|
|
197
195
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
198
|
-
while (1) {
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
return _context2.stop();
|
225
|
-
}
|
196
|
+
while (1) switch (_context2.prev = _context2.next) {
|
197
|
+
case 0:
|
198
|
+
link = _ref2.link, values = _ref2.values;
|
199
|
+
|
200
|
+
if (!link) {
|
201
|
+
_context2.next = 9;
|
202
|
+
break;
|
203
|
+
}
|
204
|
+
|
205
|
+
params = values[0];
|
206
|
+
_context2.next = 5;
|
207
|
+
return updateLink(link, params);
|
208
|
+
|
209
|
+
case 5:
|
210
|
+
result = _context2.sent;
|
211
|
+
return _context2.abrupt("return", [result]);
|
212
|
+
|
213
|
+
case 9:
|
214
|
+
_params = values.map(function (item, index) {
|
215
|
+
return buildCreateLinkParams(item, index);
|
216
|
+
});
|
217
|
+
return _context2.abrupt("return", cmdbService.batchCreateRelation(_params));
|
218
|
+
|
219
|
+
case 11:
|
220
|
+
case "end":
|
221
|
+
return _context2.stop();
|
226
222
|
}
|
227
223
|
}, _callee2);
|
228
224
|
}));
|
@@ -105,25 +105,23 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
105
105
|
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
106
106
|
var data;
|
107
107
|
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
|
-
}
|
108
|
+
while (1) switch (_context.prev = _context.next) {
|
109
|
+
case 0:
|
110
|
+
_rlog["default"].debug('useTopoEdit.refreshLink');
|
111
|
+
|
112
|
+
_context.next = 3;
|
113
|
+
return editDispatchers.fetchData();
|
114
|
+
|
115
|
+
case 3:
|
116
|
+
data = _context.sent;
|
117
|
+
topo.view.topoClient.emitEvent(_componentTopologyGraph.TopoEvent.EVENT_DATA_RESULT, {
|
118
|
+
type: _componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO,
|
119
|
+
data: data
|
120
|
+
});
|
121
|
+
|
122
|
+
case 5:
|
123
|
+
case "end":
|
124
|
+
return _context.stop();
|
127
125
|
}
|
128
126
|
}, _callee);
|
129
127
|
}));
|
@@ -137,22 +135,20 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
137
135
|
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
|
138
136
|
var data;
|
139
137
|
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
|
-
}
|
138
|
+
while (1) switch (_context2.prev = _context2.next) {
|
139
|
+
case 0:
|
140
|
+
_context2.next = 2;
|
141
|
+
return editDispatchers.fetchData();
|
142
|
+
|
143
|
+
case 2:
|
144
|
+
data = _context2.sent;
|
145
|
+
return _context2.abrupt("return", data.filter(function (item) {
|
146
|
+
return item.id === id;
|
147
|
+
})[0]);
|
148
|
+
|
149
|
+
case 4:
|
150
|
+
case "end":
|
151
|
+
return _context2.stop();
|
156
152
|
}
|
157
153
|
}, _callee2);
|
158
154
|
}));
|
@@ -164,50 +160,48 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
164
160
|
|
165
161
|
var updateTopo = (0, _react.useCallback)( /*#__PURE__*/function () {
|
166
162
|
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(data) {
|
167
|
-
var changed, isAdd, _data$result
|
163
|
+
var changed, isAdd, _data$result$2, oldId, id, linkData;
|
168
164
|
|
169
165
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
170
|
-
while (1) {
|
171
|
-
|
172
|
-
|
173
|
-
changed = data.changed, isAdd = data.isAddMode;
|
166
|
+
while (1) switch (_context3.prev = _context3.next) {
|
167
|
+
case 0:
|
168
|
+
changed = data.changed, isAdd = data.isAddMode;
|
174
169
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
return _context3.abrupt("return");
|
181
|
-
|
182
|
-
case 3:
|
183
|
-
if (!isAdd) {
|
184
|
-
_context3.next = 8;
|
185
|
-
break;
|
186
|
-
}
|
170
|
+
if (!(changed === false)) {
|
171
|
+
_context3.next = 3;
|
172
|
+
break;
|
173
|
+
}
|
187
174
|
|
188
|
-
|
189
|
-
return refreshLink();
|
175
|
+
return _context3.abrupt("return");
|
190
176
|
|
191
|
-
|
192
|
-
|
177
|
+
case 3:
|
178
|
+
if (!isAdd) {
|
179
|
+
_context3.next = 8;
|
193
180
|
break;
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
181
|
+
}
|
182
|
+
|
183
|
+
_context3.next = 6;
|
184
|
+
return refreshLink();
|
185
|
+
|
186
|
+
case 6:
|
187
|
+
_context3.next = 13;
|
188
|
+
break;
|
189
|
+
|
190
|
+
case 8:
|
191
|
+
_data$result$2 = data.result[0], oldId = _data$result$2.oldId, id = _data$result$2.id;
|
192
|
+
_context3.next = 11;
|
193
|
+
return getLink(id);
|
194
|
+
|
195
|
+
case 11:
|
196
|
+
linkData = _context3.sent;
|
197
|
+
topo.view.topoClient.emitEvent('topo_link_update', {
|
198
|
+
id: oldId,
|
199
|
+
link: linkData
|
200
|
+
});
|
201
|
+
|
202
|
+
case 13:
|
203
|
+
case "end":
|
204
|
+
return _context3.stop();
|
211
205
|
}
|
212
206
|
}, _callee3);
|
213
207
|
}));
|
@@ -220,28 +214,26 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
220
214
|
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(data) {
|
221
215
|
var errorItems;
|
222
216
|
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
|
-
}
|
217
|
+
while (1) switch (_context4.prev = _context4.next) {
|
218
|
+
case 0:
|
219
|
+
errorItems = data.errorItems;
|
220
|
+
|
221
|
+
if (errorItems.length) {
|
222
|
+
_context4.next = 7;
|
223
|
+
break;
|
224
|
+
}
|
225
|
+
|
226
|
+
setFalse();
|
227
|
+
setUpdateTopoState(true);
|
228
|
+
_context4.next = 6;
|
229
|
+
return updateTopo(data);
|
230
|
+
|
231
|
+
case 6:
|
232
|
+
setUpdateTopoState(false);
|
233
|
+
|
234
|
+
case 7:
|
235
|
+
case "end":
|
236
|
+
return _context4.stop();
|
245
237
|
}
|
246
238
|
}, _callee4);
|
247
239
|
}));
|
@@ -136,52 +136,50 @@ var LinkSetting = function LinkSetting(_ref2) {
|
|
136
136
|
|
137
137
|
var onSave = /*#__PURE__*/function () {
|
138
138
|
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
139
|
-
var values, _values
|
139
|
+
var values, _values$2, src, dst;
|
140
140
|
|
141
141
|
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
|
-
}
|
142
|
+
while (1) switch (_context.prev = _context.next) {
|
143
|
+
case 0:
|
144
|
+
if (!(0, _utils.isAvailableArray)(getValidatorErrors())) {
|
145
|
+
_context.next = 2;
|
146
|
+
break;
|
147
|
+
}
|
148
|
+
|
149
|
+
return _context.abrupt("return");
|
150
|
+
|
151
|
+
case 2:
|
152
|
+
values = list.map(function (i, index) {
|
153
|
+
return refs[index].field.getValues();
|
154
|
+
});
|
155
|
+
|
156
|
+
if (isAddMode) {
|
157
|
+
_context.next = 8;
|
158
|
+
break;
|
159
|
+
}
|
160
|
+
|
161
|
+
_values$2 = values[0], src = _values$2.src, dst = _values$2.dst;
|
162
|
+
|
163
|
+
if (!(src.sub === link.interfaceSource && dst.sub === link.interfaceTarget)) {
|
164
|
+
_context.next = 8;
|
165
|
+
break;
|
166
|
+
}
|
167
|
+
|
168
|
+
saveCb({
|
169
|
+
changed: false
|
170
|
+
});
|
171
|
+
return _context.abrupt("return");
|
172
|
+
|
173
|
+
case 8:
|
174
|
+
_context.next = 10;
|
175
|
+
return execSave({
|
176
|
+
link: link,
|
177
|
+
values: values
|
178
|
+
});
|
179
|
+
|
180
|
+
case 10:
|
181
|
+
case "end":
|
182
|
+
return _context.stop();
|
185
183
|
}
|
186
184
|
}, _callee);
|
187
185
|
}));
|
@@ -83,32 +83,30 @@ function _addLinkData() {
|
|
83
83
|
_addLinkData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
|
84
84
|
var links, nodes, prevNetworkLinks, networkLinks, otherLinks;
|
85
85
|
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
|
-
}
|
86
|
+
while (1) switch (_context.prev = _context.next) {
|
87
|
+
case 0:
|
88
|
+
links = data.links || [];
|
89
|
+
nodes = data.nodes || []; // 如果是网络链路,补充详情信息
|
90
|
+
|
91
|
+
prevNetworkLinks = links.filter(function (link) {
|
92
|
+
return isNetworkLink(link);
|
93
|
+
});
|
94
|
+
_context.next = 5;
|
95
|
+
return (0, _linkUtils.getLinksDetail)(prevNetworkLinks, nodes);
|
96
|
+
|
97
|
+
case 5:
|
98
|
+
networkLinks = _context.sent;
|
99
|
+
otherLinks = links.filter(function (link) {
|
100
|
+
return !isNetworkLink(link);
|
101
|
+
});
|
102
|
+
return _context.abrupt("return", (0, _extends2["default"])({}, data, {
|
103
|
+
links: [].concat(networkLinks, otherLinks),
|
104
|
+
linkGroups: []
|
105
|
+
}));
|
106
|
+
|
107
|
+
case 8:
|
108
|
+
case "end":
|
109
|
+
return _context.stop();
|
112
110
|
}
|
113
111
|
}, _callee);
|
114
112
|
}));
|
@@ -123,20 +121,18 @@ function _buildData() {
|
|
123
121
|
_buildData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(oldData) {
|
124
122
|
var data;
|
125
123
|
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
|
-
}
|
124
|
+
while (1) switch (_context2.prev = _context2.next) {
|
125
|
+
case 0:
|
126
|
+
data = oldData;
|
127
|
+
data = fixNodeGroupId(data);
|
128
|
+
data = filterLinkNoSourceTarget(data); // data = await addLinkData(data)
|
129
|
+
|
130
|
+
data = (0, _resourcePermissionUtil.addTopoDataResourcePermission)(data);
|
131
|
+
return _context2.abrupt("return", data);
|
132
|
+
|
133
|
+
case 5:
|
134
|
+
case "end":
|
135
|
+
return _context2.stop();
|
140
136
|
}
|
141
137
|
}, _callee2);
|
142
138
|
}));
|
@@ -151,35 +147,33 @@ function _getTopoData() {
|
|
151
147
|
_getTopoData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id, topoService) {
|
152
148
|
var data;
|
153
149
|
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
|
-
}
|
150
|
+
while (1) switch (_context3.prev = _context3.next) {
|
151
|
+
case 0:
|
152
|
+
_context3.next = 2;
|
153
|
+
return topoService.getTopoData(id);
|
154
|
+
|
155
|
+
case 2:
|
156
|
+
data = _context3.sent;
|
157
|
+
|
158
|
+
if (data) {
|
159
|
+
_context3.next = 5;
|
160
|
+
break;
|
161
|
+
}
|
162
|
+
|
163
|
+
return _context3.abrupt("return", data);
|
164
|
+
|
165
|
+
case 5:
|
166
|
+
data = fixAlarmConfig(data);
|
167
|
+
_context3.next = 8;
|
168
|
+
return buildData(data);
|
169
|
+
|
170
|
+
case 8:
|
171
|
+
data = _context3.sent;
|
172
|
+
return _context3.abrupt("return", data);
|
173
|
+
|
174
|
+
case 10:
|
175
|
+
case "end":
|
176
|
+
return _context3.stop();
|
183
177
|
}
|
184
178
|
}, _callee3);
|
185
179
|
}));
|