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