@riil-frontend/component-topology 10.0.58 → 10.0.59
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/IndexSettingDrawer/index.js +6 -5
- 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/ResourceDisplay/useElementTagTipConfig.js +78 -100
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -4
- 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/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 +110 -122
- package/es/core/hooks/useResourceConfig.js +76 -100
- package/es/core/hooks/useTopoEdit.js +539 -638
- package/es/core/models/Alarm.js +311 -394
- 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 +287 -454
- package/es/core/models/TopoGraphView.js +28 -41
- package/es/core/models/cache/CiCache.js +34 -39
- package/es/core/models/cache/CiTypeCache.js +70 -84
- 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 +34 -40
- package/es/core/models/topoData.js +73 -77
- package/es/core/models/utils/linkUtils.js +46 -51
- 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 +11 -13
- 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 +28 -32
- package/es/core/store/models/topoConfig.js +217 -233
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +379 -401
- 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 copy.js +104 -126
- 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 +274 -314
- 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/linkDynamicStyle.js +102 -108
- package/es/networkTopo/store/linkDynamicStyleConfig.js +42 -44
- package/es/networkTopo/store/linkManager.js +4 -6
- 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/IndexSettingDrawer/index.js +6 -5
- 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/ResourceDisplay/useElementTagTipConfig.js +82 -104
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -4
- 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/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 +108 -120
- package/lib/core/hooks/useResourceConfig.js +76 -100
- package/lib/core/hooks/useTopoEdit.js +530 -629
- package/lib/core/models/Alarm.js +308 -391
- 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 +287 -454
- package/lib/core/models/TopoGraphView.js +28 -41
- package/lib/core/models/cache/CiCache.js +39 -44
- package/lib/core/models/cache/CiTypeCache.js +71 -85
- 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 +34 -40
- package/lib/core/models/topoData.js +73 -78
- package/lib/core/models/utils/linkUtils.js +45 -51
- 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 +13 -15
- 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 +34 -38
- package/lib/core/store/models/topoConfig.js +224 -240
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +381 -403
- 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 copy.js +105 -127
- 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 +277 -317
- 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/linkDynamicStyle.js +103 -109
- package/lib/networkTopo/store/linkDynamicStyleConfig.js +42 -44
- package/lib/networkTopo/store/linkManager.js +4 -6
- 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 +3 -3
@@ -195,69 +195,67 @@ function _default(topoApp) {
|
|
195
195
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
196
196
|
var data, isViewGroup, parseGroup, viewGroup, resources, groups;
|
197
197
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
198
|
-
while (1) {
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
198
|
+
while (1) switch (_context.prev = _context.next) {
|
199
|
+
case 0:
|
200
|
+
_context.next = 2;
|
201
|
+
return topoApp.serverApi.getConditions(topoApp.id);
|
202
|
+
|
203
|
+
case 2:
|
204
|
+
data = _context.sent;
|
205
|
+
|
206
|
+
if ((0, _utils.isAvailableArray)(data)) {
|
207
|
+
_context.next = 5;
|
208
|
+
break;
|
209
|
+
}
|
210
|
+
|
211
|
+
return _context.abrupt("return");
|
212
|
+
|
213
|
+
case 5:
|
214
|
+
isViewGroup = function isViewGroup(item) {
|
215
|
+
var _item$topoGroup;
|
216
|
+
|
217
|
+
return ((_item$topoGroup = item.topoGroup) === null || _item$topoGroup === void 0 ? void 0 : _item$topoGroup.parentId) === _topo.TOPO_PARENT_ID;
|
218
|
+
};
|
219
|
+
|
220
|
+
parseGroup = function parseGroup(item) {
|
221
|
+
var _item$topoGroup2 = item.topoGroup,
|
222
|
+
topoGroup = _item$topoGroup2 === void 0 ? {} : _item$topoGroup2,
|
223
|
+
condition = item.condition;
|
224
|
+
var id = topoGroup.id,
|
225
|
+
name = topoGroup.name,
|
226
|
+
layout = topoGroup.layout,
|
227
|
+
order = topoGroup.order,
|
228
|
+
parentId = topoGroup.parentId,
|
229
|
+
styles = topoGroup.styles;
|
230
|
+
var groupStyles = styles && JSON.parse(styles) || {};
|
231
|
+
return {
|
232
|
+
id: id,
|
233
|
+
name: name,
|
234
|
+
layout: layout,
|
235
|
+
order: order,
|
236
|
+
parentId: parentId,
|
237
|
+
expanded: groupStyles.expanded || false,
|
238
|
+
resources: conditionToRes(condition)
|
239
|
+
};
|
240
|
+
}; // 视图
|
211
241
|
|
212
|
-
return _context.abrupt("return");
|
213
242
|
|
214
|
-
|
215
|
-
|
216
|
-
var _item$topoGroup;
|
243
|
+
viewGroup = data.filter(isViewGroup).map(parseGroup)[0];
|
244
|
+
resources = viewGroup ? viewGroup.resources : {}; // 容器
|
217
245
|
|
218
|
-
|
219
|
-
|
246
|
+
groups = data.filter(function (item) {
|
247
|
+
return !isViewGroup(item);
|
248
|
+
}).map(parseGroup);
|
220
249
|
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
name = topoGroup.name,
|
227
|
-
layout = topoGroup.layout,
|
228
|
-
order = topoGroup.order,
|
229
|
-
parentId = topoGroup.parentId,
|
230
|
-
styles = topoGroup.styles;
|
231
|
-
var groupStyles = styles && JSON.parse(styles) || {};
|
232
|
-
return {
|
233
|
-
id: id,
|
234
|
-
name: name,
|
235
|
-
layout: layout,
|
236
|
-
order: order,
|
237
|
-
parentId: parentId,
|
238
|
-
expanded: groupStyles.expanded || false,
|
239
|
-
resources: conditionToRes(condition)
|
240
|
-
};
|
241
|
-
}; // 视图
|
242
|
-
|
243
|
-
|
244
|
-
viewGroup = data.filter(isViewGroup).map(parseGroup)[0];
|
245
|
-
resources = viewGroup ? viewGroup.resources : {}; // 容器
|
246
|
-
|
247
|
-
groups = data.filter(function (item) {
|
248
|
-
return !isViewGroup(item);
|
249
|
-
}).map(parseGroup);
|
250
|
-
|
251
|
-
_this.update({
|
252
|
-
viewGroup: viewGroup,
|
253
|
-
resources: resources,
|
254
|
-
groups: groups
|
255
|
-
});
|
250
|
+
_this.update({
|
251
|
+
viewGroup: viewGroup,
|
252
|
+
resources: resources,
|
253
|
+
groups: groups
|
254
|
+
});
|
256
255
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
}
|
256
|
+
case 11:
|
257
|
+
case "end":
|
258
|
+
return _context.stop();
|
261
259
|
}
|
262
260
|
}, _callee);
|
263
261
|
}))();
|
@@ -269,39 +267,37 @@ function _default(topoApp) {
|
|
269
267
|
var editState, resources, _editState$groups, groups, _editState$exportLink, exportLinkIdList, _editState$ipNodes, ipNodes, query, data;
|
270
268
|
|
271
269
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
272
|
-
while (1) {
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
270
|
+
while (1) switch (_context2.prev = _context2.next) {
|
271
|
+
case 0:
|
272
|
+
editState = rootState.topoConfig;
|
273
|
+
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups, _editState$exportLink = editState.exportLinkIdList, exportLinkIdList = _editState$exportLink === void 0 ? [] : _editState$exportLink, _editState$ipNodes = editState.ipNodes, ipNodes = _editState$ipNodes === void 0 ? [] : _editState$ipNodes; // console.log("editState", editState);
|
274
|
+
|
275
|
+
query = {
|
276
|
+
id: rootState.topoMod.topoId,
|
277
|
+
resources: resources,
|
278
|
+
groups: groups,
|
279
|
+
exportLinkIdList: exportLinkIdList,
|
280
|
+
ipNodes: ipNodes
|
281
|
+
};
|
282
|
+
_context2.next = 5;
|
283
|
+
return _this2.getTopoByConditions(query);
|
284
|
+
|
285
|
+
case 5:
|
286
|
+
data = _context2.sent;
|
287
|
+
|
288
|
+
_rlog["default"].debug("按配置查询拓扑数据", {
|
289
|
+
config: {
|
280
290
|
resources: resources,
|
281
|
-
groups: groups
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
_context2.next = 5;
|
286
|
-
return _this2.getTopoByConditions(query);
|
287
|
-
|
288
|
-
case 5:
|
289
|
-
data = _context2.sent;
|
290
|
-
|
291
|
-
_rlog["default"].debug("按配置查询拓扑数据", {
|
292
|
-
config: {
|
293
|
-
resources: resources,
|
294
|
-
groups: groups
|
295
|
-
},
|
296
|
-
data: data
|
297
|
-
});
|
291
|
+
groups: groups
|
292
|
+
},
|
293
|
+
data: data
|
294
|
+
});
|
298
295
|
|
299
|
-
|
296
|
+
return _context2.abrupt("return", data);
|
300
297
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
}
|
298
|
+
case 8:
|
299
|
+
case "end":
|
300
|
+
return _context2.stop();
|
305
301
|
}
|
306
302
|
}, _callee2);
|
307
303
|
}))();
|
@@ -312,20 +308,18 @@ function _default(topoApp) {
|
|
312
308
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
313
309
|
var data;
|
314
310
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
315
|
-
while (1) {
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
return _context3.stop();
|
328
|
-
}
|
311
|
+
while (1) switch (_context3.prev = _context3.next) {
|
312
|
+
case 0:
|
313
|
+
_context3.next = 2;
|
314
|
+
return _this3.fetchDataByConfig();
|
315
|
+
|
316
|
+
case 2:
|
317
|
+
data = _context3.sent;
|
318
|
+
return _context3.abrupt("return", data.topoDataTrans);
|
319
|
+
|
320
|
+
case 4:
|
321
|
+
case "end":
|
322
|
+
return _context3.stop();
|
329
323
|
}
|
330
324
|
}, _callee3);
|
331
325
|
}))();
|
@@ -337,69 +331,67 @@ function _default(topoApp) {
|
|
337
331
|
var topoId, resources, groups, exportLinkIdList, ipNodes, viewConditions, groupInfo, data, _yield$Promise$all, dataWithLinkDetail, _combTopoData, topoData, resAndMetrics, topoDataTrans;
|
338
332
|
|
339
333
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
340
|
-
while (1) {
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
resources: (0, _topoData2.resToConditions)(group.resources)
|
351
|
-
});
|
334
|
+
while (1) switch (_context4.prev = _context4.next) {
|
335
|
+
case 0:
|
336
|
+
_rlog["default"].debug("getTopoByConditions--------", params);
|
337
|
+
|
338
|
+
topoId = params.id, resources = params.resources, groups = params.groups, exportLinkIdList = params.exportLinkIdList, ipNodes = params.ipNodes;
|
339
|
+
viewConditions = (0, _topoData2.resToConditions)(resources);
|
340
|
+
groupInfo = (0, _utils.isAvailableArray)(groups) && groups.map(function (group) {
|
341
|
+
return (0, _extends2["default"])({}, group, {
|
342
|
+
layout: (0, _topoData2.getLayoutId)(group.layout),
|
343
|
+
resources: (0, _topoData2.resToConditions)(group.resources)
|
352
344
|
});
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
345
|
+
});
|
346
|
+
|
347
|
+
_rlog["default"].debug("getTopoByConditions--------", viewConditions, groupInfo);
|
348
|
+
|
349
|
+
_context4.next = 7;
|
350
|
+
return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo, exportLinkIdList, ipNodes);
|
351
|
+
|
352
|
+
case 7:
|
353
|
+
data = _context4.sent;
|
354
|
+
|
355
|
+
_rlog["default"].debug("getTopoByConditions--------data", data);
|
356
|
+
|
357
|
+
_context4.next = 11;
|
358
|
+
return (0, _getTopoData.buildData)(data);
|
359
|
+
|
360
|
+
case 11:
|
361
|
+
data = _context4.sent;
|
362
|
+
_context4.next = 14;
|
363
|
+
return Promise.all([(0, _getTopoData.addLinkData)(data), topoApp.ciTyeCache.getCiTypeMap((0, _topoData.getCiTypes)(data)), dispatch.customIcon.loadCustomIcons()]);
|
364
|
+
|
365
|
+
case 14:
|
366
|
+
_yield$Promise$all = _context4.sent;
|
367
|
+
dataWithLinkDetail = _yield$Promise$all[0];
|
368
|
+
_combTopoData = (0, _topoData.combTopoData)({
|
369
|
+
engine: topoApp,
|
370
|
+
data: data,
|
371
|
+
linkTo: null,
|
372
|
+
globalConfig: state.topoMod.globalConfig
|
373
|
+
}), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics;
|
374
|
+
dispatch.topoMod.update({
|
375
|
+
data: dataWithLinkDetail
|
376
|
+
});
|
377
|
+
topoDataTrans = (0, _utils2.transformTopoElements)(topoData);
|
378
|
+
|
379
|
+
_this4.update({
|
380
|
+
topoData: topoData,
|
381
|
+
elements: topoDataTrans
|
382
|
+
});
|
383
|
+
|
384
|
+
dispatch.topoBizMod.combBatchCiInfo(resAndMetrics); // 返回查询后的数据,便于外部获取到数据后像HT通知更新
|
385
|
+
|
386
|
+
return _context4.abrupt("return", {
|
387
|
+
topoData: topoData,
|
388
|
+
elements: JSON.parse(JSON.stringify(topoDataTrans)),
|
389
|
+
topoDataTrans: topoDataTrans
|
390
|
+
});
|
391
|
+
|
392
|
+
case 22:
|
393
|
+
case "end":
|
394
|
+
return _context4.stop();
|
403
395
|
}
|
404
396
|
}, _callee4);
|
405
397
|
}))();
|
@@ -408,33 +400,31 @@ function _default(topoApp) {
|
|
408
400
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
409
401
|
var displayConfig, config;
|
410
402
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
411
|
-
while (1) {
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
return _context5.stop();
|
437
|
-
}
|
403
|
+
while (1) switch (_context5.prev = _context5.next) {
|
404
|
+
case 0:
|
405
|
+
displayConfig = topoApp.store.getModelState("displayConfig");
|
406
|
+
config = {
|
407
|
+
alarmSwitch: displayConfig.alarmSwitch,
|
408
|
+
alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
|
409
|
+
extraConfig: JSON.stringify((0, _extends2["default"])({}, displayConfig, {
|
410
|
+
// 背景图,便于加载拓扑直接显示背景图
|
411
|
+
background: topoApp.store.getModelState("background").current,
|
412
|
+
// 增加保存日志,便于排查链路重复问题 2023-4-12 19:27:18
|
413
|
+
saveHistories: [{
|
414
|
+
date: new Date().toLocaleString(),
|
415
|
+
version: topoApp.version
|
416
|
+
}].concat(displayConfig.saveHistories || [])
|
417
|
+
}))
|
418
|
+
};
|
419
|
+
|
420
|
+
_rlog["default"].debug("saveGlobalConfig", config);
|
421
|
+
|
422
|
+
_context5.next = 5;
|
423
|
+
return topoApp.serverApi.saveTopoSettings(topoApp.id, config);
|
424
|
+
|
425
|
+
case 5:
|
426
|
+
case "end":
|
427
|
+
return _context5.stop();
|
438
428
|
}
|
439
429
|
}, _callee5);
|
440
430
|
}))();
|
@@ -447,28 +437,26 @@ function _default(topoApp) {
|
|
447
437
|
|
448
438
|
var currentBackground;
|
449
439
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
450
|
-
while (1) {
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
return _context6.stop();
|
471
|
-
}
|
440
|
+
while (1) switch (_context6.prev = _context6.next) {
|
441
|
+
case 0:
|
442
|
+
currentBackground = topoApp.store.getModelState("background").current;
|
443
|
+
_context6.next = 3;
|
444
|
+
return (0, _topoData2.saveTopo)((0, _extends2["default"])({
|
445
|
+
topoService: topoApp.serverApi
|
446
|
+
}, data, {
|
447
|
+
viewGroupId: (_state$topoConfig$vie = state.topoConfig.viewGroup) === null || _state$topoConfig$vie === void 0 ? void 0 : _state$topoConfig$vie.id,
|
448
|
+
template: state.topoMod.type,
|
449
|
+
// 背景图
|
450
|
+
backgroundId: currentBackground ? currentBackground.id : null
|
451
|
+
}));
|
452
|
+
|
453
|
+
case 3:
|
454
|
+
_context6.next = 5;
|
455
|
+
return _this5.saveGlobalConfig();
|
456
|
+
|
457
|
+
case 5:
|
458
|
+
case "end":
|
459
|
+
return _context6.stop();
|
472
460
|
}
|
473
461
|
}, _callee6);
|
474
462
|
}))();
|
@@ -477,17 +465,15 @@ function _default(topoApp) {
|
|
477
465
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
478
466
|
var topoId, ciIdList;
|
479
467
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
480
|
-
while (1) {
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
return _context7.stop();
|
490
|
-
}
|
468
|
+
while (1) switch (_context7.prev = _context7.next) {
|
469
|
+
case 0:
|
470
|
+
topoId = data.id, ciIdList = data.ciIdList;
|
471
|
+
_context7.next = 3;
|
472
|
+
return topoApp.serverApi.addToBlocklist(topoId, ciIdList);
|
473
|
+
|
474
|
+
case 3:
|
475
|
+
case "end":
|
476
|
+
return _context7.stop();
|
491
477
|
}
|
492
478
|
}, _callee7);
|
493
479
|
}))();
|
@@ -502,22 +488,20 @@ function _default(topoApp) {
|
|
502
488
|
|
503
489
|
var ids, ip, result;
|
504
490
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
505
|
-
while (1) {
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
return _context8.stop();
|
520
|
-
}
|
491
|
+
while (1) switch (_context8.prev = _context8.next) {
|
492
|
+
case 0:
|
493
|
+
ids = data.ids, ip = data.ip; // console.log("queryAllLinkByIp", ids, ip);
|
494
|
+
|
495
|
+
_context8.next = 3;
|
496
|
+
return _networkLink["default"].queryLinksByIp(ids, ip);
|
497
|
+
|
498
|
+
case 3:
|
499
|
+
result = _context8.sent;
|
500
|
+
return _context8.abrupt("return", (_result$data = result === null || result === void 0 ? void 0 : result.data) !== null && _result$data !== void 0 ? _result$data : []);
|
501
|
+
|
502
|
+
case 5:
|
503
|
+
case "end":
|
504
|
+
return _context8.stop();
|
521
505
|
}
|
522
506
|
}, _callee8);
|
523
507
|
}))();
|
@@ -34,12 +34,10 @@ var _default = {
|
|
34
34
|
|
35
35
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
36
36
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
37
|
-
while (1) {
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
return _context.stop();
|
42
|
-
}
|
37
|
+
while (1) switch (_context.prev = _context.next) {
|
38
|
+
case 0:
|
39
|
+
case "end":
|
40
|
+
return _context.stop();
|
43
41
|
}
|
44
42
|
}, _callee);
|
45
43
|
}))();
|