@riil-frontend/component-topology 10.0.57 → 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 (227) 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/useCanvasTheme.js +1 -1
  34. package/es/core/hooks/usePolling.js +110 -122
  35. package/es/core/hooks/useResourceConfig.js +76 -100
  36. package/es/core/hooks/useTopoEdit.js +539 -638
  37. package/es/core/models/Alarm.js +311 -394
  38. package/es/core/models/AttributeMetricDisplay.js +115 -143
  39. package/es/core/models/PluginManager.js +4 -3
  40. package/es/core/models/SelectionModel.js +4 -5
  41. package/es/core/models/TopoApp.js +287 -454
  42. package/es/core/models/TopoGraphView.js +28 -41
  43. package/es/core/models/cache/CiCache.js +34 -39
  44. package/es/core/models/cache/CiTypeCache.js +70 -84
  45. package/es/core/models/cache/DictCache.js +36 -42
  46. package/es/core/models/graph/Background.js +21 -26
  47. package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
  48. package/es/core/models/tagstips/ElementTagTipConfig.js +34 -40
  49. package/es/core/models/topoData.js +73 -77
  50. package/es/core/models/utils/linkUtils.js +46 -51
  51. package/es/core/services/alarm.js +14 -16
  52. package/es/core/services/background.js +59 -67
  53. package/es/core/services/cmdb/metric.js +14 -18
  54. package/es/core/services/cmdb.js +23 -27
  55. package/es/core/services/index.js +48 -68
  56. package/es/core/services/overview.js +131 -151
  57. package/es/core/services/topo/basic.js +11 -13
  58. package/es/core/services/topo/tagtip.js +15 -19
  59. package/es/core/store/models/ciModel.js +58 -62
  60. package/es/core/store/models/customIcon.js +126 -145
  61. package/es/core/store/models/displayConfig.js +15 -19
  62. package/es/core/store/models/selection.js +4 -6
  63. package/es/core/store/models/topoAlarm.js +162 -145
  64. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  65. package/es/core/store/models/topoBizMod.js +28 -32
  66. package/es/core/store/models/topoConfig.js +217 -233
  67. package/es/core/store/models/topoGraphView.js +4 -6
  68. package/es/core/store/models/topoMod.js +379 -401
  69. package/es/core/utils/imageUtil.js +23 -27
  70. package/es/core/utils/saveSerialize.js +14 -18
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  79. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
  80. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
  81. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  82. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
  83. package/es/networkTopo/components/Link/hook.js +85 -96
  84. package/es/networkTopo/components/Link/index copy.js +104 -126
  85. package/es/networkTopo/components/Link/index.js +104 -126
  86. package/es/networkTopo/components/Link/setting.js +48 -52
  87. package/es/networkTopo/getTopoData.js +73 -92
  88. package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
  89. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  90. package/es/networkTopo/models/TopoCenter.js +28 -46
  91. package/es/networkTopo/services/alert.js +18 -22
  92. package/es/networkTopo/services/authorization.js +45 -55
  93. package/es/networkTopo/services/cmdb.js +548 -696
  94. package/es/networkTopo/services/funcAuth.js +22 -24
  95. package/es/networkTopo/services/link.js +107 -117
  96. package/es/networkTopo/services/mdc.js +33 -48
  97. package/es/networkTopo/services/metric.js +38 -47
  98. package/es/networkTopo/services/model.js +616 -809
  99. package/es/networkTopo/services/risk.js +9 -11
  100. package/es/networkTopo/services/topo/auth.js +27 -33
  101. package/es/networkTopo/services/topo/basic.js +274 -314
  102. package/es/networkTopo/services/topo/blacklist.js +20 -24
  103. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  104. package/es/networkTopo/services/topo/icon.js +49 -59
  105. package/es/networkTopo/services/topo/networkLink.js +32 -36
  106. package/es/networkTopo/services/topo/relation.js +9 -11
  107. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  108. package/es/networkTopo/store/functionAuth.js +31 -37
  109. package/es/networkTopo/store/linkDynamicStyle.js +102 -108
  110. package/es/networkTopo/store/linkDynamicStyleConfig.js +42 -44
  111. package/es/networkTopo/store/linkManager.js +4 -6
  112. package/es/networkTopo/store/topoCenter.js +142 -152
  113. package/es/networkTopo/store/topoLinkMod.js +4 -6
  114. package/es/networkTopo/store/topoTreeMod.js +170 -182
  115. package/es/networkTopo/utils/exportData.js +57 -61
  116. package/lib/components/IndexSettingDrawer/index.js +6 -5
  117. package/lib/components/MultiResourceDrawer/index.js +22 -26
  118. package/lib/components/ResourceList/ResourceSelect.js +54 -58
  119. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
  120. package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  121. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
  122. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +82 -104
  123. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  124. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -4
  125. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  126. package/lib/core/editor/components/BackgroundView/index.js +148 -177
  127. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
  128. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  129. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
  130. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
  131. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  132. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  133. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  134. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
  135. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
  136. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  137. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
  138. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
  139. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  140. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  141. package/lib/core/editor/store/background.js +8 -10
  142. package/lib/core/editor/store/topoEdit.js +4 -6
  143. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  144. package/lib/core/hooks/useCanvasTheme.js +1 -1
  145. package/lib/core/hooks/usePolling.js +108 -120
  146. package/lib/core/hooks/useResourceConfig.js +76 -100
  147. package/lib/core/hooks/useTopoEdit.js +530 -629
  148. package/lib/core/models/Alarm.js +308 -391
  149. package/lib/core/models/AttributeMetricDisplay.js +118 -146
  150. package/lib/core/models/PluginManager.js +4 -3
  151. package/lib/core/models/SelectionModel.js +4 -5
  152. package/lib/core/models/TopoApp.js +287 -454
  153. package/lib/core/models/TopoGraphView.js +28 -41
  154. package/lib/core/models/cache/CiCache.js +39 -44
  155. package/lib/core/models/cache/CiTypeCache.js +71 -85
  156. package/lib/core/models/cache/DictCache.js +39 -45
  157. package/lib/core/models/graph/Background.js +22 -27
  158. package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
  159. package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -40
  160. package/lib/core/models/topoData.js +73 -78
  161. package/lib/core/models/utils/linkUtils.js +45 -51
  162. package/lib/core/services/alarm.js +18 -20
  163. package/lib/core/services/background.js +70 -78
  164. package/lib/core/services/cmdb/metric.js +14 -19
  165. package/lib/core/services/cmdb.js +24 -29
  166. package/lib/core/services/index.js +53 -72
  167. package/lib/core/services/overview.js +131 -151
  168. package/lib/core/services/topo/basic.js +13 -15
  169. package/lib/core/services/topo/tagtip.js +16 -21
  170. package/lib/core/store/models/ciModel.js +66 -70
  171. package/lib/core/store/models/customIcon.js +126 -145
  172. package/lib/core/store/models/displayConfig.js +15 -19
  173. package/lib/core/store/models/selection.js +4 -6
  174. package/lib/core/store/models/topoAlarm.js +163 -145
  175. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  176. package/lib/core/store/models/topoBizMod.js +34 -38
  177. package/lib/core/store/models/topoConfig.js +224 -240
  178. package/lib/core/store/models/topoGraphView.js +4 -6
  179. package/lib/core/store/models/topoMod.js +381 -403
  180. package/lib/core/utils/imageUtil.js +26 -31
  181. package/lib/core/utils/saveSerialize.js +13 -18
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
  185. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
  186. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
  187. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
  188. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  189. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  190. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
  191. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
  192. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  193. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
  194. package/lib/networkTopo/components/Link/hook.js +86 -98
  195. package/lib/networkTopo/components/Link/index copy.js +105 -127
  196. package/lib/networkTopo/components/Link/index.js +105 -127
  197. package/lib/networkTopo/components/Link/setting.js +48 -52
  198. package/lib/networkTopo/getTopoData.js +73 -92
  199. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
  200. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  201. package/lib/networkTopo/models/TopoCenter.js +28 -46
  202. package/lib/networkTopo/services/alert.js +18 -22
  203. package/lib/networkTopo/services/authorization.js +55 -65
  204. package/lib/networkTopo/services/cmdb.js +551 -700
  205. package/lib/networkTopo/services/funcAuth.js +24 -26
  206. package/lib/networkTopo/services/link.js +108 -118
  207. package/lib/networkTopo/services/mdc.js +35 -51
  208. package/lib/networkTopo/services/metric.js +37 -47
  209. package/lib/networkTopo/services/model.js +615 -809
  210. package/lib/networkTopo/services/risk.js +11 -13
  211. package/lib/networkTopo/services/topo/auth.js +27 -33
  212. package/lib/networkTopo/services/topo/basic.js +277 -317
  213. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  214. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  215. package/lib/networkTopo/services/topo/icon.js +59 -69
  216. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  217. package/lib/networkTopo/services/topo/relation.js +11 -13
  218. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  219. package/lib/networkTopo/store/functionAuth.js +31 -37
  220. package/lib/networkTopo/store/linkDynamicStyle.js +103 -109
  221. package/lib/networkTopo/store/linkDynamicStyleConfig.js +42 -44
  222. package/lib/networkTopo/store/linkManager.js +4 -6
  223. package/lib/networkTopo/store/topoCenter.js +142 -152
  224. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  225. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  226. package/lib/networkTopo/utils/exportData.js +63 -68
  227. package/package.json +3 -3
@@ -174,69 +174,67 @@ export default function (topoApp) {
174
174
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
175
175
  var data, isViewGroup, parseGroup, viewGroup, resources, groups;
176
176
  return _regeneratorRuntime.wrap(function _callee$(_context) {
177
- while (1) {
178
- switch (_context.prev = _context.next) {
179
- case 0:
180
- _context.next = 2;
181
- return topoApp.serverApi.getConditions(topoApp.id);
182
-
183
- case 2:
184
- data = _context.sent;
177
+ while (1) switch (_context.prev = _context.next) {
178
+ case 0:
179
+ _context.next = 2;
180
+ return topoApp.serverApi.getConditions(topoApp.id);
181
+
182
+ case 2:
183
+ data = _context.sent;
184
+
185
+ if (isAvailableArray(data)) {
186
+ _context.next = 5;
187
+ break;
188
+ }
189
+
190
+ return _context.abrupt("return");
191
+
192
+ case 5:
193
+ isViewGroup = function isViewGroup(item) {
194
+ var _item$topoGroup;
195
+
196
+ return ((_item$topoGroup = item.topoGroup) === null || _item$topoGroup === void 0 ? void 0 : _item$topoGroup.parentId) === TOPO_PARENT_ID;
197
+ };
198
+
199
+ parseGroup = function parseGroup(item) {
200
+ var _item$topoGroup2 = item.topoGroup,
201
+ topoGroup = _item$topoGroup2 === void 0 ? {} : _item$topoGroup2,
202
+ condition = item.condition;
203
+ var id = topoGroup.id,
204
+ name = topoGroup.name,
205
+ layout = topoGroup.layout,
206
+ order = topoGroup.order,
207
+ parentId = topoGroup.parentId,
208
+ styles = topoGroup.styles;
209
+ var groupStyles = styles && JSON.parse(styles) || {};
210
+ return {
211
+ id: id,
212
+ name: name,
213
+ layout: layout,
214
+ order: order,
215
+ parentId: parentId,
216
+ expanded: groupStyles.expanded || false,
217
+ resources: conditionToRes(condition)
218
+ };
219
+ }; // 视图
185
220
 
186
- if (isAvailableArray(data)) {
187
- _context.next = 5;
188
- break;
189
- }
190
221
 
191
- return _context.abrupt("return");
222
+ viewGroup = data.filter(isViewGroup).map(parseGroup)[0];
223
+ resources = viewGroup ? viewGroup.resources : {}; // 容器
192
224
 
193
- case 5:
194
- isViewGroup = function isViewGroup(item) {
195
- var _item$topoGroup;
225
+ groups = data.filter(function (item) {
226
+ return !isViewGroup(item);
227
+ }).map(parseGroup);
196
228
 
197
- return ((_item$topoGroup = item.topoGroup) === null || _item$topoGroup === void 0 ? void 0 : _item$topoGroup.parentId) === TOPO_PARENT_ID;
198
- };
229
+ _this.update({
230
+ viewGroup: viewGroup,
231
+ resources: resources,
232
+ groups: groups
233
+ });
199
234
 
200
- parseGroup = function parseGroup(item) {
201
- var _item$topoGroup2 = item.topoGroup,
202
- topoGroup = _item$topoGroup2 === void 0 ? {} : _item$topoGroup2,
203
- condition = item.condition;
204
- var id = topoGroup.id,
205
- name = topoGroup.name,
206
- layout = topoGroup.layout,
207
- order = topoGroup.order,
208
- parentId = topoGroup.parentId,
209
- styles = topoGroup.styles;
210
- var groupStyles = styles && JSON.parse(styles) || {};
211
- return {
212
- id: id,
213
- name: name,
214
- layout: layout,
215
- order: order,
216
- parentId: parentId,
217
- expanded: groupStyles.expanded || false,
218
- resources: conditionToRes(condition)
219
- };
220
- }; // 视图
221
-
222
-
223
- viewGroup = data.filter(isViewGroup).map(parseGroup)[0];
224
- resources = viewGroup ? viewGroup.resources : {}; // 容器
225
-
226
- groups = data.filter(function (item) {
227
- return !isViewGroup(item);
228
- }).map(parseGroup);
229
-
230
- _this.update({
231
- viewGroup: viewGroup,
232
- resources: resources,
233
- groups: groups
234
- });
235
-
236
- case 11:
237
- case "end":
238
- return _context.stop();
239
- }
235
+ case 11:
236
+ case "end":
237
+ return _context.stop();
240
238
  }
241
239
  }, _callee);
242
240
  }))();
@@ -248,37 +246,35 @@ export default function (topoApp) {
248
246
  var editState, resources, _editState$groups, groups, _editState$exportLink, exportLinkIdList, _editState$ipNodes, ipNodes, query, data;
249
247
 
250
248
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
251
- while (1) {
252
- switch (_context2.prev = _context2.next) {
253
- case 0:
254
- editState = rootState.topoConfig;
255
- 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);
256
-
257
- query = {
258
- id: rootState.topoMod.topoId,
249
+ while (1) switch (_context2.prev = _context2.next) {
250
+ case 0:
251
+ editState = rootState.topoConfig;
252
+ 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);
253
+
254
+ query = {
255
+ id: rootState.topoMod.topoId,
256
+ resources: resources,
257
+ groups: groups,
258
+ exportLinkIdList: exportLinkIdList,
259
+ ipNodes: ipNodes
260
+ };
261
+ _context2.next = 5;
262
+ return _this2.getTopoByConditions(query);
263
+
264
+ case 5:
265
+ data = _context2.sent;
266
+ rlog.debug("按配置查询拓扑数据", {
267
+ config: {
259
268
  resources: resources,
260
- groups: groups,
261
- exportLinkIdList: exportLinkIdList,
262
- ipNodes: ipNodes
263
- };
264
- _context2.next = 5;
265
- return _this2.getTopoByConditions(query);
266
-
267
- case 5:
268
- data = _context2.sent;
269
- rlog.debug("按配置查询拓扑数据", {
270
- config: {
271
- resources: resources,
272
- groups: groups
273
- },
274
- data: data
275
- });
276
- return _context2.abrupt("return", data);
277
-
278
- case 8:
279
- case "end":
280
- return _context2.stop();
281
- }
269
+ groups: groups
270
+ },
271
+ data: data
272
+ });
273
+ return _context2.abrupt("return", data);
274
+
275
+ case 8:
276
+ case "end":
277
+ return _context2.stop();
282
278
  }
283
279
  }, _callee2);
284
280
  }))();
@@ -289,20 +285,18 @@ export default function (topoApp) {
289
285
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
290
286
  var data;
291
287
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
292
- while (1) {
293
- switch (_context3.prev = _context3.next) {
294
- case 0:
295
- _context3.next = 2;
296
- return _this3.fetchDataByConfig();
297
-
298
- case 2:
299
- data = _context3.sent;
300
- return _context3.abrupt("return", data.topoDataTrans);
301
-
302
- case 4:
303
- case "end":
304
- return _context3.stop();
305
- }
288
+ while (1) switch (_context3.prev = _context3.next) {
289
+ case 0:
290
+ _context3.next = 2;
291
+ return _this3.fetchDataByConfig();
292
+
293
+ case 2:
294
+ data = _context3.sent;
295
+ return _context3.abrupt("return", data.topoDataTrans);
296
+
297
+ case 4:
298
+ case "end":
299
+ return _context3.stop();
306
300
  }
307
301
  }, _callee3);
308
302
  }))();
@@ -314,64 +308,62 @@ export default function (topoApp) {
314
308
  var topoId, resources, groups, exportLinkIdList, ipNodes, viewConditions, groupInfo, data, _yield$Promise$all, dataWithLinkDetail, _combTopoData, topoData, resAndMetrics, topoDataTrans;
315
309
 
316
310
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
317
- while (1) {
318
- switch (_context4.prev = _context4.next) {
319
- case 0:
320
- rlog.debug("getTopoByConditions--------", params);
321
- topoId = params.id, resources = params.resources, groups = params.groups, exportLinkIdList = params.exportLinkIdList, ipNodes = params.ipNodes;
322
- viewConditions = resToConditions(resources);
323
- groupInfo = isAvailableArray(groups) && groups.map(function (group) {
324
- return _extends({}, group, {
325
- layout: getLayoutId(group.layout),
326
- resources: resToConditions(group.resources)
327
- });
311
+ while (1) switch (_context4.prev = _context4.next) {
312
+ case 0:
313
+ rlog.debug("getTopoByConditions--------", params);
314
+ topoId = params.id, resources = params.resources, groups = params.groups, exportLinkIdList = params.exportLinkIdList, ipNodes = params.ipNodes;
315
+ viewConditions = resToConditions(resources);
316
+ groupInfo = isAvailableArray(groups) && groups.map(function (group) {
317
+ return _extends({}, group, {
318
+ layout: getLayoutId(group.layout),
319
+ resources: resToConditions(group.resources)
328
320
  });
329
- rlog.debug("getTopoByConditions--------", viewConditions, groupInfo);
330
- _context4.next = 7;
331
- return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo, exportLinkIdList, ipNodes);
332
-
333
- case 7:
334
- data = _context4.sent;
335
- rlog.debug("getTopoByConditions--------data", data);
336
- _context4.next = 11;
337
- return buildTopoData(data);
338
-
339
- case 11:
340
- data = _context4.sent;
341
- _context4.next = 14;
342
- return Promise.all([addLinkData(data), topoApp.ciTyeCache.getCiTypeMap(getCiTypes(data)), dispatch.customIcon.loadCustomIcons()]);
343
-
344
- case 14:
345
- _yield$Promise$all = _context4.sent;
346
- dataWithLinkDetail = _yield$Promise$all[0];
347
- _combTopoData = combTopoData({
348
- engine: topoApp,
349
- data: data,
350
- linkTo: null,
351
- globalConfig: state.topoMod.globalConfig
352
- }), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics;
353
- dispatch.topoMod.update({
354
- data: dataWithLinkDetail
355
- });
356
- topoDataTrans = transformTopoElements(topoData);
357
-
358
- _this4.update({
359
- topoData: topoData,
360
- elements: topoDataTrans
361
- });
362
-
363
- dispatch.topoBizMod.combBatchCiInfo(resAndMetrics); // 返回查询后的数据,便于外部获取到数据后像HT通知更新
364
-
365
- return _context4.abrupt("return", {
366
- topoData: topoData,
367
- elements: JSON.parse(JSON.stringify(topoDataTrans)),
368
- topoDataTrans: topoDataTrans
369
- });
370
-
371
- case 22:
372
- case "end":
373
- return _context4.stop();
374
- }
321
+ });
322
+ rlog.debug("getTopoByConditions--------", viewConditions, groupInfo);
323
+ _context4.next = 7;
324
+ return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo, exportLinkIdList, ipNodes);
325
+
326
+ case 7:
327
+ data = _context4.sent;
328
+ rlog.debug("getTopoByConditions--------data", data);
329
+ _context4.next = 11;
330
+ return buildTopoData(data);
331
+
332
+ case 11:
333
+ data = _context4.sent;
334
+ _context4.next = 14;
335
+ return Promise.all([addLinkData(data), topoApp.ciTyeCache.getCiTypeMap(getCiTypes(data)), dispatch.customIcon.loadCustomIcons()]);
336
+
337
+ case 14:
338
+ _yield$Promise$all = _context4.sent;
339
+ dataWithLinkDetail = _yield$Promise$all[0];
340
+ _combTopoData = combTopoData({
341
+ engine: topoApp,
342
+ data: data,
343
+ linkTo: null,
344
+ globalConfig: state.topoMod.globalConfig
345
+ }), topoData = _combTopoData.topoData, resAndMetrics = _combTopoData.resAndMetrics;
346
+ dispatch.topoMod.update({
347
+ data: dataWithLinkDetail
348
+ });
349
+ topoDataTrans = transformTopoElements(topoData);
350
+
351
+ _this4.update({
352
+ topoData: topoData,
353
+ elements: topoDataTrans
354
+ });
355
+
356
+ dispatch.topoBizMod.combBatchCiInfo(resAndMetrics); // 返回查询后的数据,便于外部获取到数据后像HT通知更新
357
+
358
+ return _context4.abrupt("return", {
359
+ topoData: topoData,
360
+ elements: JSON.parse(JSON.stringify(topoDataTrans)),
361
+ topoDataTrans: topoDataTrans
362
+ });
363
+
364
+ case 22:
365
+ case "end":
366
+ return _context4.stop();
375
367
  }
376
368
  }, _callee4);
377
369
  }))();
@@ -380,31 +372,29 @@ export default function (topoApp) {
380
372
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
381
373
  var displayConfig, config;
382
374
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
383
- while (1) {
384
- switch (_context5.prev = _context5.next) {
385
- case 0:
386
- displayConfig = topoApp.store.getModelState("displayConfig");
387
- config = {
388
- alarmSwitch: displayConfig.alarmSwitch,
389
- alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
390
- extraConfig: JSON.stringify(_extends({}, displayConfig, {
391
- // 背景图,便于加载拓扑直接显示背景图
392
- background: topoApp.store.getModelState("background").current,
393
- // 增加保存日志,便于排查链路重复问题 2023-4-12 19:27:18
394
- saveHistories: [{
395
- date: new Date().toLocaleString(),
396
- version: topoApp.version
397
- }].concat(displayConfig.saveHistories || [])
398
- }))
399
- };
400
- rlog.debug("saveGlobalConfig", config);
401
- _context5.next = 5;
402
- return topoApp.serverApi.saveTopoSettings(topoApp.id, config);
403
-
404
- case 5:
405
- case "end":
406
- return _context5.stop();
407
- }
375
+ while (1) switch (_context5.prev = _context5.next) {
376
+ case 0:
377
+ displayConfig = topoApp.store.getModelState("displayConfig");
378
+ config = {
379
+ alarmSwitch: displayConfig.alarmSwitch,
380
+ alarmListDefaultOpen: displayConfig.alarmListDefaultOpen,
381
+ extraConfig: JSON.stringify(_extends({}, displayConfig, {
382
+ // 背景图,便于加载拓扑直接显示背景图
383
+ background: topoApp.store.getModelState("background").current,
384
+ // 增加保存日志,便于排查链路重复问题 2023-4-12 19:27:18
385
+ saveHistories: [{
386
+ date: new Date().toLocaleString(),
387
+ version: topoApp.version
388
+ }].concat(displayConfig.saveHistories || [])
389
+ }))
390
+ };
391
+ rlog.debug("saveGlobalConfig", config);
392
+ _context5.next = 5;
393
+ return topoApp.serverApi.saveTopoSettings(topoApp.id, config);
394
+
395
+ case 5:
396
+ case "end":
397
+ return _context5.stop();
408
398
  }
409
399
  }, _callee5);
410
400
  }))();
@@ -417,28 +407,26 @@ export default function (topoApp) {
417
407
 
418
408
  var currentBackground;
419
409
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
420
- while (1) {
421
- switch (_context6.prev = _context6.next) {
422
- case 0:
423
- currentBackground = topoApp.store.getModelState("background").current;
424
- _context6.next = 3;
425
- return _saveTopo(_extends({
426
- topoService: topoApp.serverApi
427
- }, data, {
428
- viewGroupId: (_state$topoConfig$vie = state.topoConfig.viewGroup) === null || _state$topoConfig$vie === void 0 ? void 0 : _state$topoConfig$vie.id,
429
- template: state.topoMod.type,
430
- // 背景图
431
- backgroundId: currentBackground ? currentBackground.id : null
432
- }));
433
-
434
- case 3:
435
- _context6.next = 5;
436
- return _this5.saveGlobalConfig();
437
-
438
- case 5:
439
- case "end":
440
- return _context6.stop();
441
- }
410
+ while (1) switch (_context6.prev = _context6.next) {
411
+ case 0:
412
+ currentBackground = topoApp.store.getModelState("background").current;
413
+ _context6.next = 3;
414
+ return _saveTopo(_extends({
415
+ topoService: topoApp.serverApi
416
+ }, data, {
417
+ viewGroupId: (_state$topoConfig$vie = state.topoConfig.viewGroup) === null || _state$topoConfig$vie === void 0 ? void 0 : _state$topoConfig$vie.id,
418
+ template: state.topoMod.type,
419
+ // 背景图
420
+ backgroundId: currentBackground ? currentBackground.id : null
421
+ }));
422
+
423
+ case 3:
424
+ _context6.next = 5;
425
+ return _this5.saveGlobalConfig();
426
+
427
+ case 5:
428
+ case "end":
429
+ return _context6.stop();
442
430
  }
443
431
  }, _callee6);
444
432
  }))();
@@ -447,17 +435,15 @@ export default function (topoApp) {
447
435
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
448
436
  var topoId, ciIdList;
449
437
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
450
- while (1) {
451
- switch (_context7.prev = _context7.next) {
452
- case 0:
453
- topoId = data.id, ciIdList = data.ciIdList;
454
- _context7.next = 3;
455
- return topoApp.serverApi.addToBlocklist(topoId, ciIdList);
456
-
457
- case 3:
458
- case "end":
459
- return _context7.stop();
460
- }
438
+ while (1) switch (_context7.prev = _context7.next) {
439
+ case 0:
440
+ topoId = data.id, ciIdList = data.ciIdList;
441
+ _context7.next = 3;
442
+ return topoApp.serverApi.addToBlocklist(topoId, ciIdList);
443
+
444
+ case 3:
445
+ case "end":
446
+ return _context7.stop();
461
447
  }
462
448
  }, _callee7);
463
449
  }))();
@@ -472,22 +458,20 @@ export default function (topoApp) {
472
458
 
473
459
  var ids, ip, result;
474
460
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
475
- while (1) {
476
- switch (_context8.prev = _context8.next) {
477
- case 0:
478
- ids = data.ids, ip = data.ip; // console.log("queryAllLinkByIp", ids, ip);
479
-
480
- _context8.next = 3;
481
- return networkLinkServer.queryLinksByIp(ids, ip);
482
-
483
- case 3:
484
- result = _context8.sent;
485
- return _context8.abrupt("return", (_result$data = result === null || result === void 0 ? void 0 : result.data) !== null && _result$data !== void 0 ? _result$data : []);
486
-
487
- case 5:
488
- case "end":
489
- return _context8.stop();
490
- }
461
+ while (1) switch (_context8.prev = _context8.next) {
462
+ case 0:
463
+ ids = data.ids, ip = data.ip; // console.log("queryAllLinkByIp", ids, ip);
464
+
465
+ _context8.next = 3;
466
+ return networkLinkServer.queryLinksByIp(ids, ip);
467
+
468
+ case 3:
469
+ result = _context8.sent;
470
+ return _context8.abrupt("return", (_result$data = result === null || result === void 0 ? void 0 : result.data) !== null && _result$data !== void 0 ? _result$data : []);
471
+
472
+ case 5:
473
+ case "end":
474
+ return _context8.stop();
491
475
  }
492
476
  }, _callee8);
493
477
  }))();
@@ -23,12 +23,10 @@ export default {
23
23
 
24
24
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
25
25
  return _regeneratorRuntime.wrap(function _callee$(_context) {
26
- while (1) {
27
- switch (_context.prev = _context.next) {
28
- case 0:
29
- case "end":
30
- return _context.stop();
31
- }
26
+ while (1) switch (_context.prev = _context.next) {
27
+ case 0:
28
+ case "end":
29
+ return _context.stop();
32
30
  }
33
31
  }, _callee);
34
32
  }))();