@riil-frontend/component-topology 11.0.30 → 11.0.31

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 (217) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +2 -4
  4. package/build/index.js +34 -49
  5. package/es/components/MultiResourceDrawer/index.js +18 -16
  6. package/es/components/ResourceList/ResourceSelect.js +50 -48
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +26 -24
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +20 -18
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +25 -23
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
  11. package/es/core/components/titlebar/widgets/TitleWidget.js +3 -5
  12. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
  13. package/es/core/editor/components/BackgroundView/index.js +129 -119
  14. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -20
  15. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
  16. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +17 -15
  17. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +9 -7
  18. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
  19. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
  20. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
  21. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
  22. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +13 -11
  23. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +23 -21
  24. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
  25. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -10
  26. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +27 -21
  27. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  28. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  29. package/es/core/editor/store/background.js +10 -8
  30. package/es/core/editor/store/topoEdit.js +6 -4
  31. package/es/core/editor/utils/edgeTypeStyleUtil.js +4 -2
  32. package/es/core/hooks/usePolling.js +121 -117
  33. package/es/core/hooks/useResourceConfig.js +66 -58
  34. package/es/core/hooks/useTopoEdit.js +511 -476
  35. package/es/core/models/Alarm.js +298 -281
  36. package/es/core/models/AttributeMetricDisplay.js +107 -101
  37. package/es/core/models/PluginManager.js +3 -4
  38. package/es/core/models/SelectionModel.js +5 -4
  39. package/es/core/models/TopoApp.js +240 -205
  40. package/es/core/models/TopoGraphView.js +21 -18
  41. package/es/core/models/cache/CiCache.js +27 -28
  42. package/es/core/models/cache/CiTypeCache.js +41 -37
  43. package/es/core/models/cache/DictCache.js +35 -33
  44. package/es/core/models/graph/Background.js +17 -15
  45. package/es/core/models/plugins/resourceWebControllUrl.js +82 -76
  46. package/es/core/models/tagstips/ElementTagTipConfig.js +38 -34
  47. package/es/core/models/topoData.js +70 -68
  48. package/es/core/models/utils/linkUtils.js +43 -41
  49. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  50. package/es/core/services/alarm.js +16 -14
  51. package/es/core/services/background.js +67 -59
  52. package/es/core/services/cmdb/metric.js +11 -9
  53. package/es/core/services/cmdb.js +20 -18
  54. package/es/core/services/index.js +45 -39
  55. package/es/core/services/overview.js +151 -131
  56. package/es/core/services/topo/basic.js +13 -11
  57. package/es/core/services/topo/tagtip.js +12 -10
  58. package/es/core/store/models/ciModel.js +62 -58
  59. package/es/core/store/models/customIcon.js +134 -120
  60. package/es/core/store/models/displayConfig.js +19 -15
  61. package/es/core/store/models/selection.js +6 -4
  62. package/es/core/store/models/topoAlarm.js +145 -162
  63. package/es/core/store/models/topoBaseInfoOverview.js +6 -4
  64. package/es/core/store/models/topoBizMod.js +32 -28
  65. package/es/core/store/models/topoConfig.js +231 -215
  66. package/es/core/store/models/topoGraphView.js +6 -4
  67. package/es/core/store/models/topoMod.js +395 -373
  68. package/es/core/utils/imageUtil.js +20 -18
  69. package/es/core/utils/saveSerialize.js +11 -9
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +357 -343
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +205 -189
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -107
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +37 -33
  79. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
  80. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
  81. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +19 -17
  82. package/es/networkTopo/components/Link/hook.js +77 -73
  83. package/es/networkTopo/components/Link/index.js +94 -86
  84. package/es/networkTopo/components/Link/setting.js +44 -42
  85. package/es/networkTopo/getTopoData.js +69 -63
  86. package/es/networkTopo/hooks/viewer/useRelateTopo.js +32 -30
  87. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  88. package/es/networkTopo/models/TopoCenter.js +22 -18
  89. package/es/networkTopo/services/alert.js +22 -18
  90. package/es/networkTopo/services/authorization.js +55 -45
  91. package/es/networkTopo/services/cmdb.js +470 -422
  92. package/es/networkTopo/services/funcAuth.js +24 -22
  93. package/es/networkTopo/services/link.js +117 -107
  94. package/es/networkTopo/services/mdc.js +24 -18
  95. package/es/networkTopo/services/metric.js +27 -23
  96. package/es/networkTopo/services/model.js +509 -445
  97. package/es/networkTopo/services/risk.js +11 -9
  98. package/es/networkTopo/services/topo/auth.js +33 -27
  99. package/es/networkTopo/services/topo/basic.js +314 -274
  100. package/es/networkTopo/services/topo/blacklist.js +24 -20
  101. package/es/networkTopo/services/topo/ciInfo.js +31 -27
  102. package/es/networkTopo/services/topo/icon.js +59 -49
  103. package/es/networkTopo/services/topo/networkLink.js +36 -32
  104. package/es/networkTopo/services/topo/relation.js +11 -9
  105. package/es/networkTopo/services/topo/resourceWebUrl.js +42 -36
  106. package/es/networkTopo/store/functionAuth.js +37 -31
  107. package/es/networkTopo/store/topoCenter.js +152 -142
  108. package/es/networkTopo/store/topoLinkMod.js +6 -4
  109. package/es/networkTopo/store/topoTreeMod.js +182 -170
  110. package/es/networkTopo/utils/exportData.js +54 -52
  111. package/lib/components/MultiResourceDrawer/index.js +18 -16
  112. package/lib/components/ResourceList/ResourceSelect.js +50 -48
  113. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +29 -27
  114. package/lib/components/SingleResourceDrawer/SelectDrawer.js +20 -18
  115. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +32 -30
  116. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
  117. package/lib/core/components/titlebar/widgets/TitleWidget.js +3 -5
  118. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
  119. package/lib/core/editor/components/BackgroundView/index.js +128 -118
  120. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +24 -22
  121. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
  122. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +21 -19
  123. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +10 -8
  124. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
  125. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
  126. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
  127. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
  128. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +14 -12
  129. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +28 -26
  130. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
  131. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +14 -12
  132. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +31 -25
  133. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  134. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  135. package/lib/core/editor/store/background.js +10 -8
  136. package/lib/core/editor/store/topoEdit.js +6 -4
  137. package/lib/core/editor/utils/edgeTypeStyleUtil.js +4 -2
  138. package/lib/core/hooks/usePolling.js +120 -116
  139. package/lib/core/hooks/useResourceConfig.js +66 -58
  140. package/lib/core/hooks/useTopoEdit.js +503 -468
  141. package/lib/core/models/Alarm.js +292 -275
  142. package/lib/core/models/AttributeMetricDisplay.js +110 -104
  143. package/lib/core/models/PluginManager.js +3 -4
  144. package/lib/core/models/SelectionModel.js +5 -4
  145. package/lib/core/models/TopoApp.js +240 -205
  146. package/lib/core/models/TopoGraphView.js +21 -18
  147. package/lib/core/models/cache/CiCache.js +32 -33
  148. package/lib/core/models/cache/CiTypeCache.js +42 -38
  149. package/lib/core/models/cache/DictCache.js +35 -33
  150. package/lib/core/models/graph/Background.js +18 -16
  151. package/lib/core/models/plugins/resourceWebControllUrl.js +80 -74
  152. package/lib/core/models/tagstips/ElementTagTipConfig.js +38 -34
  153. package/lib/core/models/topoData.js +71 -69
  154. package/lib/core/models/utils/linkUtils.js +43 -41
  155. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  156. package/lib/core/services/alarm.js +20 -18
  157. package/lib/core/services/background.js +78 -70
  158. package/lib/core/services/cmdb/metric.js +12 -10
  159. package/lib/core/services/cmdb.js +22 -20
  160. package/lib/core/services/index.js +51 -45
  161. package/lib/core/services/overview.js +151 -131
  162. package/lib/core/services/topo/basic.js +15 -13
  163. package/lib/core/services/topo/tagtip.js +14 -12
  164. package/lib/core/store/models/ciModel.js +70 -66
  165. package/lib/core/store/models/customIcon.js +134 -120
  166. package/lib/core/store/models/displayConfig.js +19 -15
  167. package/lib/core/store/models/selection.js +6 -4
  168. package/lib/core/store/models/topoAlarm.js +145 -163
  169. package/lib/core/store/models/topoBaseInfoOverview.js +6 -4
  170. package/lib/core/store/models/topoBizMod.js +38 -34
  171. package/lib/core/store/models/topoConfig.js +238 -222
  172. package/lib/core/store/models/topoGraphView.js +6 -4
  173. package/lib/core/store/models/topoMod.js +397 -375
  174. package/lib/core/utils/imageUtil.js +24 -22
  175. package/lib/core/utils/saveSerialize.js +11 -9
  176. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
  177. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
  178. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +358 -344
  179. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +206 -190
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -107
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -29
  185. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
  186. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
  187. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +20 -18
  188. package/lib/networkTopo/components/Link/hook.js +77 -73
  189. package/lib/networkTopo/components/Link/index.js +95 -87
  190. package/lib/networkTopo/components/Link/setting.js +44 -42
  191. package/lib/networkTopo/getTopoData.js +69 -63
  192. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +33 -31
  193. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  194. package/lib/networkTopo/models/TopoCenter.js +22 -18
  195. package/lib/networkTopo/services/alert.js +22 -18
  196. package/lib/networkTopo/services/authorization.js +65 -55
  197. package/lib/networkTopo/services/cmdb.js +470 -422
  198. package/lib/networkTopo/services/funcAuth.js +26 -24
  199. package/lib/networkTopo/services/link.js +118 -108
  200. package/lib/networkTopo/services/mdc.js +27 -21
  201. package/lib/networkTopo/services/metric.js +31 -27
  202. package/lib/networkTopo/services/model.js +509 -445
  203. package/lib/networkTopo/services/risk.js +13 -11
  204. package/lib/networkTopo/services/topo/auth.js +33 -27
  205. package/lib/networkTopo/services/topo/basic.js +317 -277
  206. package/lib/networkTopo/services/topo/blacklist.js +24 -20
  207. package/lib/networkTopo/services/topo/ciInfo.js +38 -34
  208. package/lib/networkTopo/services/topo/icon.js +69 -59
  209. package/lib/networkTopo/services/topo/networkLink.js +36 -32
  210. package/lib/networkTopo/services/topo/relation.js +13 -11
  211. package/lib/networkTopo/services/topo/resourceWebUrl.js +50 -44
  212. package/lib/networkTopo/store/functionAuth.js +37 -31
  213. package/lib/networkTopo/store/topoCenter.js +152 -142
  214. package/lib/networkTopo/store/topoLinkMod.js +6 -4
  215. package/lib/networkTopo/store/topoTreeMod.js +178 -166
  216. package/lib/networkTopo/utils/exportData.js +61 -59
  217. package/package.json +3 -3
@@ -191,67 +191,69 @@ 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) 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
- }; // 视图
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;
237
202
 
203
+ if ((0, _utils.isAvailableArray)(data)) {
204
+ _context.next = 5;
205
+ break;
206
+ }
238
207
 
239
- viewGroup = data.filter(isViewGroup).map(parseGroup)[0];
240
- resources = viewGroup ? viewGroup.resources : {}; // 容器
208
+ return _context.abrupt("return");
241
209
 
242
- groups = data.filter(function (item) {
243
- return !isViewGroup(item);
244
- }).map(parseGroup);
210
+ case 5:
211
+ isViewGroup = function isViewGroup(item) {
212
+ var _item$topoGroup;
213
+
214
+ return ((_item$topoGroup = item.topoGroup) === null || _item$topoGroup === void 0 ? void 0 : _item$topoGroup.parentId) === _topo.TOPO_PARENT_ID;
215
+ };
245
216
 
246
- _this.update({
247
- viewGroup: viewGroup,
248
- resources: resources,
249
- groups: groups
250
- });
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
+ });
251
252
 
252
- case 11:
253
- case "end":
254
- return _context.stop();
253
+ case 11:
254
+ case "end":
255
+ return _context.stop();
256
+ }
255
257
  }
256
258
  }, _callee);
257
259
  }))();
@@ -263,35 +265,37 @@ function _default(topoApp) {
263
265
  var editState, resources, _editState$groups, groups, _editState$ipNodes, ipNodes, query, data;
264
266
 
265
267
  return _regenerator["default"].wrap(function _callee2$(_context2) {
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: {
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,
284
275
  resources: resources,
285
- groups: groups
286
- },
287
- data: data
288
- });
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
+ });
289
292
 
290
- return _context2.abrupt("return", data);
293
+ return _context2.abrupt("return", data);
291
294
 
292
- case 8:
293
- case "end":
294
- return _context2.stop();
295
+ case 8:
296
+ case "end":
297
+ return _context2.stop();
298
+ }
295
299
  }
296
300
  }, _callee2);
297
301
  }))();
@@ -302,18 +306,20 @@ function _default(topoApp) {
302
306
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
303
307
  var data;
304
308
  return _regenerator["default"].wrap(function _callee3$(_context3) {
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();
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
+ }
317
323
  }
318
324
  }, _callee3);
319
325
  }))();
@@ -325,67 +331,69 @@ function _default(topoApp) {
325
331
  var topoId, resources, groups, exportLinkIdList, ipNodes, viewConditions, groupInfo, data, _yield$Promise$all, dataWithLinkDetail, _combTopoData, topoData, resAndMetrics, topoDataTrans;
326
332
 
327
333
  return _regenerator["default"].wrap(function _callee4$(_context4) {
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)
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
+ });
338
346
  });
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();
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
+ }
389
397
  }
390
398
  }, _callee4);
391
399
  }))();
@@ -394,31 +402,33 @@ function _default(topoApp) {
394
402
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
395
403
  var displayConfig, config;
396
404
  return _regenerator["default"].wrap(function _callee5$(_context5) {
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();
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
+ }
422
432
  }
423
433
  }, _callee5);
424
434
  }))();
@@ -431,26 +441,28 @@ function _default(topoApp) {
431
441
 
432
442
  var currentBackground;
433
443
  return _regenerator["default"].wrap(function _callee6$(_context6) {
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();
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
+ }
454
466
  }
455
467
  }, _callee6);
456
468
  }))();
@@ -459,15 +471,17 @@ function _default(topoApp) {
459
471
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
460
472
  var topoId, ciIdList;
461
473
  return _regenerator["default"].wrap(function _callee7$(_context7) {
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();
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
+ }
471
485
  }
472
486
  }, _callee7);
473
487
  }))();
@@ -482,20 +496,22 @@ function _default(topoApp) {
482
496
 
483
497
  var ids, ip, result;
484
498
  return _regenerator["default"].wrap(function _callee8$(_context8) {
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();
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
+ }
499
515
  }
500
516
  }, _callee8);
501
517
  }))();
@@ -34,10 +34,12 @@ 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) switch (_context.prev = _context.next) {
38
- case 0:
39
- case "end":
40
- return _context.stop();
37
+ while (1) {
38
+ switch (_context.prev = _context.next) {
39
+ case 0:
40
+ case "end":
41
+ return _context.stop();
42
+ }
41
43
  }
42
44
  }, _callee);
43
45
  }))();