@riil-frontend/component-topology 11.0.34 → 11.0.36

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