@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.
Files changed (225) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +4 -2
  4. package/build/index.js +52 -45
  5. package/es/components/IndexSettingDrawer/index.js +6 -5
  6. package/es/components/MultiResourceDrawer/index.js +22 -26
  7. package/es/components/ResourceList/ResourceSelect.js +55 -58
  8. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
  9. package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  10. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
  11. package/es/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +78 -100
  12. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  13. package/es/core/components/titlebar/widgets/TitleWidget.js +5 -4
  14. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
  15. package/es/core/editor/components/BackgroundView/index.js +149 -178
  16. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
  17. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
  18. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
  19. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
  20. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  21. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  22. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  23. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
  24. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
  25. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  26. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
  27. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
  28. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  29. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  30. package/es/core/editor/store/background.js +8 -10
  31. package/es/core/editor/store/topoEdit.js +4 -6
  32. package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  33. package/es/core/hooks/usePolling.js +110 -122
  34. package/es/core/hooks/useResourceConfig.js +76 -100
  35. package/es/core/hooks/useTopoEdit.js +539 -638
  36. package/es/core/models/Alarm.js +311 -394
  37. package/es/core/models/AttributeMetricDisplay.js +115 -143
  38. package/es/core/models/PluginManager.js +4 -3
  39. package/es/core/models/SelectionModel.js +4 -5
  40. package/es/core/models/TopoApp.js +287 -454
  41. package/es/core/models/TopoGraphView.js +28 -41
  42. package/es/core/models/cache/CiCache.js +34 -39
  43. package/es/core/models/cache/CiTypeCache.js +70 -84
  44. package/es/core/models/cache/DictCache.js +36 -42
  45. package/es/core/models/graph/Background.js +21 -26
  46. package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
  47. package/es/core/models/tagstips/ElementTagTipConfig.js +34 -40
  48. package/es/core/models/topoData.js +73 -77
  49. package/es/core/models/utils/linkUtils.js +46 -51
  50. package/es/core/services/alarm.js +14 -16
  51. package/es/core/services/background.js +59 -67
  52. package/es/core/services/cmdb/metric.js +14 -18
  53. package/es/core/services/cmdb.js +23 -27
  54. package/es/core/services/index.js +48 -68
  55. package/es/core/services/overview.js +131 -151
  56. package/es/core/services/topo/basic.js +11 -13
  57. package/es/core/services/topo/tagtip.js +15 -19
  58. package/es/core/store/models/ciModel.js +58 -62
  59. package/es/core/store/models/customIcon.js +126 -145
  60. package/es/core/store/models/displayConfig.js +15 -19
  61. package/es/core/store/models/selection.js +4 -6
  62. package/es/core/store/models/topoAlarm.js +162 -145
  63. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  64. package/es/core/store/models/topoBizMod.js +28 -32
  65. package/es/core/store/models/topoConfig.js +217 -233
  66. package/es/core/store/models/topoGraphView.js +4 -6
  67. package/es/core/store/models/topoMod.js +379 -401
  68. package/es/core/utils/imageUtil.js +23 -27
  69. package/es/core/utils/saveSerialize.js +14 -18
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
  79. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
  80. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  81. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
  82. package/es/networkTopo/components/Link/hook.js +85 -96
  83. package/es/networkTopo/components/Link/index copy.js +104 -126
  84. package/es/networkTopo/components/Link/index.js +104 -126
  85. package/es/networkTopo/components/Link/setting.js +48 -52
  86. package/es/networkTopo/getTopoData.js +73 -92
  87. package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
  88. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  89. package/es/networkTopo/models/TopoCenter.js +28 -46
  90. package/es/networkTopo/services/alert.js +18 -22
  91. package/es/networkTopo/services/authorization.js +45 -55
  92. package/es/networkTopo/services/cmdb.js +548 -696
  93. package/es/networkTopo/services/funcAuth.js +22 -24
  94. package/es/networkTopo/services/link.js +107 -117
  95. package/es/networkTopo/services/mdc.js +33 -48
  96. package/es/networkTopo/services/metric.js +38 -47
  97. package/es/networkTopo/services/model.js +616 -809
  98. package/es/networkTopo/services/risk.js +9 -11
  99. package/es/networkTopo/services/topo/auth.js +27 -33
  100. package/es/networkTopo/services/topo/basic.js +274 -314
  101. package/es/networkTopo/services/topo/blacklist.js +20 -24
  102. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  103. package/es/networkTopo/services/topo/icon.js +49 -59
  104. package/es/networkTopo/services/topo/networkLink.js +32 -36
  105. package/es/networkTopo/services/topo/relation.js +9 -11
  106. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  107. package/es/networkTopo/store/functionAuth.js +31 -37
  108. package/es/networkTopo/store/linkDynamicStyle.js +102 -108
  109. package/es/networkTopo/store/linkDynamicStyleConfig.js +42 -44
  110. package/es/networkTopo/store/linkManager.js +4 -6
  111. package/es/networkTopo/store/topoCenter.js +142 -152
  112. package/es/networkTopo/store/topoLinkMod.js +4 -6
  113. package/es/networkTopo/store/topoTreeMod.js +170 -182
  114. package/es/networkTopo/utils/exportData.js +57 -61
  115. package/lib/components/IndexSettingDrawer/index.js +6 -5
  116. package/lib/components/MultiResourceDrawer/index.js +22 -26
  117. package/lib/components/ResourceList/ResourceSelect.js +54 -58
  118. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
  119. package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  120. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
  121. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +82 -104
  122. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  123. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -4
  124. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  125. package/lib/core/editor/components/BackgroundView/index.js +148 -177
  126. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
  127. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  128. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
  129. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
  130. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  131. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  132. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  133. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
  134. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
  135. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  136. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
  137. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
  138. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  139. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  140. package/lib/core/editor/store/background.js +8 -10
  141. package/lib/core/editor/store/topoEdit.js +4 -6
  142. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  143. package/lib/core/hooks/usePolling.js +108 -120
  144. package/lib/core/hooks/useResourceConfig.js +76 -100
  145. package/lib/core/hooks/useTopoEdit.js +530 -629
  146. package/lib/core/models/Alarm.js +308 -391
  147. package/lib/core/models/AttributeMetricDisplay.js +118 -146
  148. package/lib/core/models/PluginManager.js +4 -3
  149. package/lib/core/models/SelectionModel.js +4 -5
  150. package/lib/core/models/TopoApp.js +287 -454
  151. package/lib/core/models/TopoGraphView.js +28 -41
  152. package/lib/core/models/cache/CiCache.js +39 -44
  153. package/lib/core/models/cache/CiTypeCache.js +71 -85
  154. package/lib/core/models/cache/DictCache.js +39 -45
  155. package/lib/core/models/graph/Background.js +22 -27
  156. package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
  157. package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -40
  158. package/lib/core/models/topoData.js +73 -78
  159. package/lib/core/models/utils/linkUtils.js +45 -51
  160. package/lib/core/services/alarm.js +18 -20
  161. package/lib/core/services/background.js +70 -78
  162. package/lib/core/services/cmdb/metric.js +14 -19
  163. package/lib/core/services/cmdb.js +24 -29
  164. package/lib/core/services/index.js +53 -72
  165. package/lib/core/services/overview.js +131 -151
  166. package/lib/core/services/topo/basic.js +13 -15
  167. package/lib/core/services/topo/tagtip.js +16 -21
  168. package/lib/core/store/models/ciModel.js +66 -70
  169. package/lib/core/store/models/customIcon.js +126 -145
  170. package/lib/core/store/models/displayConfig.js +15 -19
  171. package/lib/core/store/models/selection.js +4 -6
  172. package/lib/core/store/models/topoAlarm.js +163 -145
  173. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  174. package/lib/core/store/models/topoBizMod.js +34 -38
  175. package/lib/core/store/models/topoConfig.js +224 -240
  176. package/lib/core/store/models/topoGraphView.js +4 -6
  177. package/lib/core/store/models/topoMod.js +381 -403
  178. package/lib/core/utils/imageUtil.js +26 -31
  179. package/lib/core/utils/saveSerialize.js +13 -18
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
  185. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
  186. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  187. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  188. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
  189. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
  190. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  191. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
  192. package/lib/networkTopo/components/Link/hook.js +86 -98
  193. package/lib/networkTopo/components/Link/index copy.js +105 -127
  194. package/lib/networkTopo/components/Link/index.js +105 -127
  195. package/lib/networkTopo/components/Link/setting.js +48 -52
  196. package/lib/networkTopo/getTopoData.js +73 -92
  197. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
  198. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  199. package/lib/networkTopo/models/TopoCenter.js +28 -46
  200. package/lib/networkTopo/services/alert.js +18 -22
  201. package/lib/networkTopo/services/authorization.js +55 -65
  202. package/lib/networkTopo/services/cmdb.js +551 -700
  203. package/lib/networkTopo/services/funcAuth.js +24 -26
  204. package/lib/networkTopo/services/link.js +108 -118
  205. package/lib/networkTopo/services/mdc.js +35 -51
  206. package/lib/networkTopo/services/metric.js +37 -47
  207. package/lib/networkTopo/services/model.js +615 -809
  208. package/lib/networkTopo/services/risk.js +11 -13
  209. package/lib/networkTopo/services/topo/auth.js +27 -33
  210. package/lib/networkTopo/services/topo/basic.js +277 -317
  211. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  212. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  213. package/lib/networkTopo/services/topo/icon.js +59 -69
  214. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  215. package/lib/networkTopo/services/topo/relation.js +11 -13
  216. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  217. package/lib/networkTopo/store/functionAuth.js +31 -37
  218. package/lib/networkTopo/store/linkDynamicStyle.js +103 -109
  219. package/lib/networkTopo/store/linkDynamicStyleConfig.js +42 -44
  220. package/lib/networkTopo/store/linkManager.js +4 -6
  221. package/lib/networkTopo/store/topoCenter.js +142 -152
  222. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  223. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  224. package/lib/networkTopo/utils/exportData.js +63 -68
  225. 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
- switch (_context.prev = _context.next) {
200
- case 0:
201
- _context.next = 2;
202
- return topoApp.serverApi.getConditions(topoApp.id);
203
-
204
- case 2:
205
- data = _context.sent;
206
-
207
- if ((0, _utils.isAvailableArray)(data)) {
208
- _context.next = 5;
209
- break;
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
- case 5:
215
- isViewGroup = function isViewGroup(item) {
216
- var _item$topoGroup;
243
+ viewGroup = data.filter(isViewGroup).map(parseGroup)[0];
244
+ resources = viewGroup ? viewGroup.resources : {}; // 容器
217
245
 
218
- return ((_item$topoGroup = item.topoGroup) === null || _item$topoGroup === void 0 ? void 0 : _item$topoGroup.parentId) === _topo.TOPO_PARENT_ID;
219
- };
246
+ groups = data.filter(function (item) {
247
+ return !isViewGroup(item);
248
+ }).map(parseGroup);
220
249
 
221
- parseGroup = function parseGroup(item) {
222
- var _item$topoGroup2 = item.topoGroup,
223
- topoGroup = _item$topoGroup2 === void 0 ? {} : _item$topoGroup2,
224
- condition = item.condition;
225
- var id = topoGroup.id,
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
- case 11:
258
- case "end":
259
- return _context.stop();
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
- switch (_context2.prev = _context2.next) {
274
- case 0:
275
- editState = rootState.topoConfig;
276
- 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);
277
-
278
- query = {
279
- id: rootState.topoMod.topoId,
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
- exportLinkIdList: exportLinkIdList,
283
- ipNodes: ipNodes
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
- return _context2.abrupt("return", data);
296
+ return _context2.abrupt("return", data);
300
297
 
301
- case 8:
302
- case "end":
303
- return _context2.stop();
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
- switch (_context3.prev = _context3.next) {
317
- case 0:
318
- _context3.next = 2;
319
- return _this3.fetchDataByConfig();
320
-
321
- case 2:
322
- data = _context3.sent;
323
- return _context3.abrupt("return", data.topoDataTrans);
324
-
325
- case 4:
326
- case "end":
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
- switch (_context4.prev = _context4.next) {
342
- case 0:
343
- _rlog["default"].debug("getTopoByConditions--------", params);
344
-
345
- topoId = params.id, resources = params.resources, groups = params.groups, exportLinkIdList = params.exportLinkIdList, ipNodes = params.ipNodes;
346
- viewConditions = (0, _topoData2.resToConditions)(resources);
347
- groupInfo = (0, _utils.isAvailableArray)(groups) && groups.map(function (group) {
348
- return (0, _extends2["default"])({}, group, {
349
- layout: (0, _topoData2.getLayoutId)(group.layout),
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
- _rlog["default"].debug("getTopoByConditions--------", viewConditions, groupInfo);
355
-
356
- _context4.next = 7;
357
- return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo, exportLinkIdList, ipNodes);
358
-
359
- case 7:
360
- data = _context4.sent;
361
-
362
- _rlog["default"].debug("getTopoByConditions--------data", data);
363
-
364
- _context4.next = 11;
365
- return (0, _getTopoData.buildData)(data);
366
-
367
- case 11:
368
- data = _context4.sent;
369
- _context4.next = 14;
370
- return Promise.all([(0, _getTopoData.addLinkData)(data), topoApp.ciTyeCache.getCiTypeMap((0, _topoData.getCiTypes)(data)), dispatch.customIcon.loadCustomIcons()]);
371
-
372
- case 14:
373
- _yield$Promise$all = _context4.sent;
374
- dataWithLinkDetail = _yield$Promise$all[0];
375
- _combTopoData = (0, _topoData.combTopoData)({
376
- engine: topoApp,
377
- data: data,
378
- linkTo: null,
379
- globalConfig: state.topoMod.globalConfig
380
- }), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics;
381
- dispatch.topoMod.update({
382
- data: dataWithLinkDetail
383
- });
384
- topoDataTrans = (0, _utils2.transformTopoElements)(topoData);
385
-
386
- _this4.update({
387
- topoData: topoData,
388
- elements: topoDataTrans
389
- });
390
-
391
- dispatch.topoBizMod.combBatchCiInfo(resAndMetrics); // 返回查询后的数据,便于外部获取到数据后像HT通知更新
392
-
393
- return _context4.abrupt("return", {
394
- topoData: topoData,
395
- elements: JSON.parse(JSON.stringify(topoDataTrans)),
396
- topoDataTrans: topoDataTrans
397
- });
398
-
399
- case 22:
400
- case "end":
401
- return _context4.stop();
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
- switch (_context5.prev = _context5.next) {
413
- case 0:
414
- displayConfig = topoApp.store.getModelState("displayConfig");
415
- config = {
416
- alarmSwitch: displayConfig.alarmSwitch,
417
- alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
418
- extraConfig: JSON.stringify((0, _extends2["default"])({}, displayConfig, {
419
- // 背景图,便于加载拓扑直接显示背景图
420
- background: topoApp.store.getModelState("background").current,
421
- // 增加保存日志,便于排查链路重复问题 2023-4-12 19:27:18
422
- saveHistories: [{
423
- date: new Date().toLocaleString(),
424
- version: topoApp.version
425
- }].concat(displayConfig.saveHistories || [])
426
- }))
427
- };
428
-
429
- _rlog["default"].debug("saveGlobalConfig", config);
430
-
431
- _context5.next = 5;
432
- return topoApp.serverApi.saveTopoSettings(topoApp.id, config);
433
-
434
- case 5:
435
- case "end":
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
- switch (_context6.prev = _context6.next) {
452
- case 0:
453
- currentBackground = topoApp.store.getModelState("background").current;
454
- _context6.next = 3;
455
- return (0, _topoData2.saveTopo)((0, _extends2["default"])({
456
- topoService: topoApp.serverApi
457
- }, data, {
458
- viewGroupId: (_state$topoConfig$vie = state.topoConfig.viewGroup) === null || _state$topoConfig$vie === void 0 ? void 0 : _state$topoConfig$vie.id,
459
- template: state.topoMod.type,
460
- // 背景图
461
- backgroundId: currentBackground ? currentBackground.id : null
462
- }));
463
-
464
- case 3:
465
- _context6.next = 5;
466
- return _this5.saveGlobalConfig();
467
-
468
- case 5:
469
- case "end":
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
- switch (_context7.prev = _context7.next) {
482
- case 0:
483
- topoId = data.id, ciIdList = data.ciIdList;
484
- _context7.next = 3;
485
- return topoApp.serverApi.addToBlocklist(topoId, ciIdList);
486
-
487
- case 3:
488
- case "end":
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
- switch (_context8.prev = _context8.next) {
507
- case 0:
508
- ids = data.ids, ip = data.ip; // console.log("queryAllLinkByIp", ids, ip);
509
-
510
- _context8.next = 3;
511
- return _networkLink["default"].queryLinksByIp(ids, ip);
512
-
513
- case 3:
514
- result = _context8.sent;
515
- return _context8.abrupt("return", (_result$data = result === null || result === void 0 ? void 0 : result.data) !== null && _result$data !== void 0 ? _result$data : []);
516
-
517
- case 5:
518
- case "end":
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
- switch (_context.prev = _context.next) {
39
- case 0:
40
- case "end":
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
  }))();