@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
@@ -135,17 +135,19 @@ var _default = (0, _extends2["default"])({
135
135
  getTopoTree: function getTopoTree(params) {
136
136
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
137
137
  return _regenerator["default"].wrap(function _callee$(_context) {
138
- while (1) switch (_context.prev = _context.next) {
139
- case 0:
140
- _context.next = 2;
141
- return _componentTopologyUtils.request.get(API_ROOT + "/menu");
142
-
143
- case 2:
144
- return _context.abrupt("return", _context.sent);
145
-
146
- case 3:
147
- case "end":
148
- return _context.stop();
138
+ while (1) {
139
+ switch (_context.prev = _context.next) {
140
+ case 0:
141
+ _context.next = 2;
142
+ return _componentTopologyUtils.request.get(API_ROOT + "/menu");
143
+
144
+ case 2:
145
+ return _context.abrupt("return", _context.sent);
146
+
147
+ case 3:
148
+ case "end":
149
+ return _context.stop();
150
+ }
149
151
  }
150
152
  }, _callee);
151
153
  }))();
@@ -154,17 +156,19 @@ var _default = (0, _extends2["default"])({
154
156
  getTopoTreeByLoginUser: function getTopoTreeByLoginUser(params) {
155
157
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
156
158
  return _regenerator["default"].wrap(function _callee2$(_context2) {
157
- while (1) switch (_context2.prev = _context2.next) {
158
- case 0:
159
- _context2.next = 2;
160
- return _componentTopologyUtils.request.get('/topo/v1/api/menuByLoginUser');
161
-
162
- case 2:
163
- return _context2.abrupt("return", _context2.sent);
164
-
165
- case 3:
166
- case "end":
167
- return _context2.stop();
159
+ while (1) {
160
+ switch (_context2.prev = _context2.next) {
161
+ case 0:
162
+ _context2.next = 2;
163
+ return _componentTopologyUtils.request.get('/topo/v1/api/menuByLoginUser');
164
+
165
+ case 2:
166
+ return _context2.abrupt("return", _context2.sent);
167
+
168
+ case 3:
169
+ case "end":
170
+ return _context2.stop();
171
+ }
168
172
  }
169
173
  }, _callee2);
170
174
  }))();
@@ -180,17 +184,19 @@ var _default = (0, _extends2["default"])({
180
184
  addNewTopo: function addNewTopo(params) {
181
185
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
182
186
  return _regenerator["default"].wrap(function _callee3$(_context3) {
183
- while (1) switch (_context3.prev = _context3.next) {
184
- case 0:
185
- _context3.next = 2;
186
- return _componentTopologyUtils.request.post(API_ROOT + "/menu", params);
187
-
188
- case 2:
189
- return _context3.abrupt("return", _context3.sent);
190
-
191
- case 3:
192
- case "end":
193
- return _context3.stop();
187
+ while (1) {
188
+ switch (_context3.prev = _context3.next) {
189
+ case 0:
190
+ _context3.next = 2;
191
+ return _componentTopologyUtils.request.post(API_ROOT + "/menu", params);
192
+
193
+ case 2:
194
+ return _context3.abrupt("return", _context3.sent);
195
+
196
+ case 3:
197
+ case "end":
198
+ return _context3.stop();
199
+ }
194
200
  }
195
201
  }, _callee3);
196
202
  }))();
@@ -203,17 +209,19 @@ var _default = (0, _extends2["default"])({
203
209
  editTopo: function editTopo(params) {
204
210
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
205
211
  return _regenerator["default"].wrap(function _callee4$(_context4) {
206
- while (1) switch (_context4.prev = _context4.next) {
207
- case 0:
208
- _context4.next = 2;
209
- return _componentTopologyUtils.request.put(API_ROOT + "/menu", params);
210
-
211
- case 2:
212
- return _context4.abrupt("return", _context4.sent);
213
-
214
- case 3:
215
- case "end":
216
- return _context4.stop();
212
+ while (1) {
213
+ switch (_context4.prev = _context4.next) {
214
+ case 0:
215
+ _context4.next = 2;
216
+ return _componentTopologyUtils.request.put(API_ROOT + "/menu", params);
217
+
218
+ case 2:
219
+ return _context4.abrupt("return", _context4.sent);
220
+
221
+ case 3:
222
+ case "end":
223
+ return _context4.stop();
224
+ }
217
225
  }
218
226
  }, _callee4);
219
227
  }))();
@@ -228,17 +236,19 @@ var _default = (0, _extends2["default"])({
228
236
  copyTopo: function copyTopo(params) {
229
237
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
230
238
  return _regenerator["default"].wrap(function _callee5$(_context5) {
231
- while (1) switch (_context5.prev = _context5.next) {
232
- case 0:
233
- _context5.next = 2;
234
- return _componentTopologyUtils.request.post(API_ROOT + "/menu/copy", params);
235
-
236
- case 2:
237
- return _context5.abrupt("return", _context5.sent);
238
-
239
- case 3:
240
- case "end":
241
- return _context5.stop();
239
+ while (1) {
240
+ switch (_context5.prev = _context5.next) {
241
+ case 0:
242
+ _context5.next = 2;
243
+ return _componentTopologyUtils.request.post(API_ROOT + "/menu/copy", params);
244
+
245
+ case 2:
246
+ return _context5.abrupt("return", _context5.sent);
247
+
248
+ case 3:
249
+ case "end":
250
+ return _context5.stop();
251
+ }
242
252
  }
243
253
  }, _callee5);
244
254
  }))();
@@ -252,17 +262,19 @@ var _default = (0, _extends2["default"])({
252
262
  deleteTopoonTree: function deleteTopoonTree(id) {
253
263
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
254
264
  return _regenerator["default"].wrap(function _callee6$(_context6) {
255
- while (1) switch (_context6.prev = _context6.next) {
256
- case 0:
257
- _context6.next = 2;
258
- return _componentTopologyUtils.request["delete"](API_ROOT + "/menu/" + id);
259
-
260
- case 2:
261
- return _context6.abrupt("return", _context6.sent);
262
-
263
- case 3:
264
- case "end":
265
- return _context6.stop();
265
+ while (1) {
266
+ switch (_context6.prev = _context6.next) {
267
+ case 0:
268
+ _context6.next = 2;
269
+ return _componentTopologyUtils.request["delete"](API_ROOT + "/menu/" + id);
270
+
271
+ case 2:
272
+ return _context6.abrupt("return", _context6.sent);
273
+
274
+ case 3:
275
+ case "end":
276
+ return _context6.stop();
277
+ }
266
278
  }
267
279
  }, _callee6);
268
280
  }))();
@@ -276,13 +288,15 @@ var _default = (0, _extends2["default"])({
276
288
  setDefTopo: function setDefTopo(id) {
277
289
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
278
290
  return _regenerator["default"].wrap(function _callee7$(_context7) {
279
- while (1) switch (_context7.prev = _context7.next) {
280
- case 0:
281
- return _context7.abrupt("return", _componentTopologyUtils.request.put(API_ROOT + "/menu/default/" + id));
282
-
283
- case 1:
284
- case "end":
285
- return _context7.stop();
291
+ while (1) {
292
+ switch (_context7.prev = _context7.next) {
293
+ case 0:
294
+ return _context7.abrupt("return", _componentTopologyUtils.request.put(API_ROOT + "/menu/default/" + id));
295
+
296
+ case 1:
297
+ case "end":
298
+ return _context7.stop();
299
+ }
286
300
  }
287
301
  }, _callee7);
288
302
  }))();
@@ -301,17 +315,19 @@ var _default = (0, _extends2["default"])({
301
315
  moveTopoOnTree: function moveTopoOnTree(params) {
302
316
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
303
317
  return _regenerator["default"].wrap(function _callee8$(_context8) {
304
- while (1) switch (_context8.prev = _context8.next) {
305
- case 0:
306
- _context8.next = 2;
307
- return _componentTopologyUtils.request.put(API_ROOT + "/menu/move/", params);
308
-
309
- case 2:
310
- return _context8.abrupt("return", _context8.sent);
311
-
312
- case 3:
313
- case "end":
314
- return _context8.stop();
318
+ while (1) {
319
+ switch (_context8.prev = _context8.next) {
320
+ case 0:
321
+ _context8.next = 2;
322
+ return _componentTopologyUtils.request.put(API_ROOT + "/menu/move/", params);
323
+
324
+ case 2:
325
+ return _context8.abrupt("return", _context8.sent);
326
+
327
+ case 3:
328
+ case "end":
329
+ return _context8.stop();
330
+ }
315
331
  }
316
332
  }, _callee8);
317
333
  }))();
@@ -327,24 +343,26 @@ var _default = (0, _extends2["default"])({
327
343
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
328
344
  var id, template, layout, backgroundId;
329
345
  return _regenerator["default"].wrap(function _callee9$(_context9) {
330
- while (1) switch (_context9.prev = _context9.next) {
331
- case 0:
332
- id = _ref.id, template = _ref.template, layout = _ref.layout, backgroundId = _ref.backgroundId;
333
- _context9.next = 3;
334
- return _componentTopologyUtils.request.put(API_ROOT + "/menu", {
335
- id: id,
336
- showType: template,
337
- layout: layout,
338
- backgroundId: backgroundId || -1,
339
- type: 1
340
- });
341
-
342
- case 3:
343
- return _context9.abrupt("return", _context9.sent);
344
-
345
- case 4:
346
- case "end":
347
- return _context9.stop();
346
+ while (1) {
347
+ switch (_context9.prev = _context9.next) {
348
+ case 0:
349
+ id = _ref.id, template = _ref.template, layout = _ref.layout, backgroundId = _ref.backgroundId;
350
+ _context9.next = 3;
351
+ return _componentTopologyUtils.request.put(API_ROOT + "/menu", {
352
+ id: id,
353
+ showType: template,
354
+ layout: layout,
355
+ backgroundId: backgroundId || -1,
356
+ type: 1
357
+ });
358
+
359
+ case 3:
360
+ return _context9.abrupt("return", _context9.sent);
361
+
362
+ case 4:
363
+ case "end":
364
+ return _context9.stop();
365
+ }
348
366
  }
349
367
  }, _callee9);
350
368
  }))();
@@ -359,17 +377,19 @@ var _default = (0, _extends2["default"])({
359
377
  getResourceList: function getResourceList(conditions, query) {
360
378
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
361
379
  return _regenerator["default"].wrap(function _callee10$(_context10) {
362
- while (1) switch (_context10.prev = _context10.next) {
363
- case 0:
364
- _context10.next = 2;
365
- return _componentTopologyUtils.request.post(API_ROOT + "/resource", prepareResourceParams(conditions, query));
366
-
367
- case 2:
368
- return _context10.abrupt("return", _context10.sent);
369
-
370
- case 3:
371
- case "end":
372
- return _context10.stop();
380
+ while (1) {
381
+ switch (_context10.prev = _context10.next) {
382
+ case 0:
383
+ _context10.next = 2;
384
+ return _componentTopologyUtils.request.post(API_ROOT + "/resource", prepareResourceParams(conditions, query));
385
+
386
+ case 2:
387
+ return _context10.abrupt("return", _context10.sent);
388
+
389
+ case 3:
390
+ case "end":
391
+ return _context10.stop();
392
+ }
373
393
  }
374
394
  }, _callee10);
375
395
  }))();
@@ -383,17 +403,19 @@ var _default = (0, _extends2["default"])({
383
403
  getConditions: function getConditions(id) {
384
404
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {
385
405
  return _regenerator["default"].wrap(function _callee11$(_context11) {
386
- while (1) switch (_context11.prev = _context11.next) {
387
- case 0:
388
- _context11.next = 2;
389
- return _componentTopologyUtils.request.get(API_ROOT + "/resource/" + id);
390
-
391
- case 2:
392
- return _context11.abrupt("return", _context11.sent);
393
-
394
- case 3:
395
- case "end":
396
- return _context11.stop();
406
+ while (1) {
407
+ switch (_context11.prev = _context11.next) {
408
+ case 0:
409
+ _context11.next = 2;
410
+ return _componentTopologyUtils.request.get(API_ROOT + "/resource/" + id);
411
+
412
+ case 2:
413
+ return _context11.abrupt("return", _context11.sent);
414
+
415
+ case 3:
416
+ case "end":
417
+ return _context11.stop();
418
+ }
397
419
  }
398
420
  }, _callee11);
399
421
  }))();
@@ -410,25 +432,27 @@ var _default = (0, _extends2["default"])({
410
432
 
411
433
  var result;
412
434
  return _regenerator["default"].wrap(function _callee12$(_context12) {
413
- while (1) switch (_context12.prev = _context12.next) {
414
- case 0:
415
- _context12.next = 2;
416
- return _componentTopologyUtils.request.get(API_ROOT + "/structure/both/" + id);
417
-
418
- case 2:
419
- result = _context12.sent;
420
- return _context12.abrupt("return", (0, _exitLinkUtil.processExitLink)((0, _extends2["default"])({}, result, {
421
- nodes: (_result$nodes = result.nodes) !== null && _result$nodes !== void 0 ? _result$nodes : [],
422
- links: ((_result$links = result.links) !== null && _result$links !== void 0 ? _result$links : []).map(function (item) {
423
- return (0, _extends2["default"])({}, item, {
424
- ciType: 'network_link'
425
- });
426
- })
427
- })));
428
-
429
- case 4:
430
- case "end":
431
- return _context12.stop();
435
+ while (1) {
436
+ switch (_context12.prev = _context12.next) {
437
+ case 0:
438
+ _context12.next = 2;
439
+ return _componentTopologyUtils.request.get(API_ROOT + "/structure/both/" + id);
440
+
441
+ case 2:
442
+ result = _context12.sent;
443
+ return _context12.abrupt("return", (0, _exitLinkUtil.processExitLink)((0, _extends2["default"])({}, result, {
444
+ nodes: (_result$nodes = result.nodes) !== null && _result$nodes !== void 0 ? _result$nodes : [],
445
+ links: ((_result$links = result.links) !== null && _result$links !== void 0 ? _result$links : []).map(function (item) {
446
+ return (0, _extends2["default"])({}, item, {
447
+ ciType: 'network_link'
448
+ });
449
+ })
450
+ })));
451
+
452
+ case 4:
453
+ case "end":
454
+ return _context12.stop();
455
+ }
432
456
  }
433
457
  }, _callee12);
434
458
  }))();
@@ -447,36 +471,38 @@ var _default = (0, _extends2["default"])({
447
471
 
448
472
  var data, obj, result;
449
473
  return _regenerator["default"].wrap(function _callee13$(_context13) {
450
- while (1) switch (_context13.prev = _context13.next) {
451
- case 0:
452
- data = isAvailableArray(groups) ? groups : [];
453
-
454
- if (resources) {
455
- data.push({
456
- parentId: TOPO_PARENT_ID,
457
- order: 100,
458
- resources: resources
459
- });
460
- }
461
-
462
- obj = prepareGroupParams(data);
463
- _context13.next = 5;
464
- return _componentTopologyUtils.request.post(API_ROOT + "/structure/byCondition/" + id, (0, _extends2["default"])({}, obj));
465
-
466
- case 5:
467
- result = _context13.sent;
468
- return _context13.abrupt("return", (0, _exitLinkUtil.processByConditionResult)((0, _extends2["default"])({}, result, {
469
- nodes: (_result$nodes2 = result.nodes) !== null && _result$nodes2 !== void 0 ? _result$nodes2 : [],
470
- links: ((_result$links2 = result.links) !== null && _result$links2 !== void 0 ? _result$links2 : []).map(function (item) {
471
- return (0, _extends2["default"])({}, item, {
472
- ciType: 'network_link'
474
+ while (1) {
475
+ switch (_context13.prev = _context13.next) {
476
+ case 0:
477
+ data = isAvailableArray(groups) ? groups : [];
478
+
479
+ if (resources) {
480
+ data.push({
481
+ parentId: TOPO_PARENT_ID,
482
+ order: 100,
483
+ resources: resources
473
484
  });
474
- })
475
- }), obj.groups));
476
-
477
- case 7:
478
- case "end":
479
- return _context13.stop();
485
+ }
486
+
487
+ obj = prepareGroupParams(data);
488
+ _context13.next = 5;
489
+ return _componentTopologyUtils.request.post(API_ROOT + "/structure/byCondition/" + id, (0, _extends2["default"])({}, obj));
490
+
491
+ case 5:
492
+ result = _context13.sent;
493
+ return _context13.abrupt("return", (0, _exitLinkUtil.processByConditionResult)((0, _extends2["default"])({}, result, {
494
+ nodes: (_result$nodes2 = result.nodes) !== null && _result$nodes2 !== void 0 ? _result$nodes2 : [],
495
+ links: ((_result$links2 = result.links) !== null && _result$links2 !== void 0 ? _result$links2 : []).map(function (item) {
496
+ return (0, _extends2["default"])({}, item, {
497
+ ciType: 'network_link'
498
+ });
499
+ })
500
+ }), obj.groups));
501
+
502
+ case 7:
503
+ case "end":
504
+ return _context13.stop();
505
+ }
480
506
  }
481
507
  }, _callee13);
482
508
  }))();
@@ -493,30 +519,32 @@ var _default = (0, _extends2["default"])({
493
519
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14() {
494
520
  var groups, resources, exportLinkIdList, otherConfig, newGroups, obj;
495
521
  return _regenerator["default"].wrap(function _callee14$(_context14) {
496
- while (1) switch (_context14.prev = _context14.next) {
497
- case 0:
498
- groups = config.groups, resources = config.resources, exportLinkIdList = config.exportLinkIdList, otherConfig = (0, _objectWithoutPropertiesLoose2["default"])(config, _excluded);
499
- newGroups = isAvailableArray(groups) ? groups : [];
500
-
501
- if (resources) {
502
- // 新建拓扑时
503
- newGroups.push({
504
- parentId: TOPO_PARENT_ID,
505
- order: 100,
506
- resources: resources
507
- });
508
- }
522
+ while (1) {
523
+ switch (_context14.prev = _context14.next) {
524
+ case 0:
525
+ groups = config.groups, resources = config.resources, exportLinkIdList = config.exportLinkIdList, otherConfig = (0, _objectWithoutPropertiesLoose2["default"])(config, _excluded);
526
+ newGroups = isAvailableArray(groups) ? groups : [];
527
+
528
+ if (resources) {
529
+ // 新建拓扑时
530
+ newGroups.push({
531
+ parentId: TOPO_PARENT_ID,
532
+ order: 100,
533
+ resources: resources
534
+ });
535
+ }
509
536
 
510
- obj = prepareGroupParams(newGroups);
511
- _context14.next = 6;
512
- return _componentTopologyUtils.request.post(API_ROOT + "/resource/" + id, (0, _extends2["default"])({}, otherConfig, obj));
537
+ obj = prepareGroupParams(newGroups);
538
+ _context14.next = 6;
539
+ return _componentTopologyUtils.request.post(API_ROOT + "/resource/" + id, (0, _extends2["default"])({}, otherConfig, obj));
513
540
 
514
- case 6:
515
- return _context14.abrupt("return", _context14.sent);
541
+ case 6:
542
+ return _context14.abrupt("return", _context14.sent);
516
543
 
517
- case 7:
518
- case "end":
519
- return _context14.stop();
544
+ case 7:
545
+ case "end":
546
+ return _context14.stop();
547
+ }
520
548
  }
521
549
  }, _callee14);
522
550
  }))();
@@ -531,19 +559,21 @@ var _default = (0, _extends2["default"])({
531
559
  saveSerializeData: function saveSerializeData(id, data) {
532
560
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15() {
533
561
  return _regenerator["default"].wrap(function _callee15$(_context15) {
534
- while (1) switch (_context15.prev = _context15.next) {
535
- case 0:
536
- _context15.next = 2;
537
- return _componentTopologyUtils.request.post(API_ROOT + "/structure/" + id, {
538
- data: data
539
- });
540
-
541
- case 2:
542
- return _context15.abrupt("return", _context15.sent);
543
-
544
- case 3:
545
- case "end":
546
- return _context15.stop();
562
+ while (1) {
563
+ switch (_context15.prev = _context15.next) {
564
+ case 0:
565
+ _context15.next = 2;
566
+ return _componentTopologyUtils.request.post(API_ROOT + "/structure/" + id, {
567
+ data: data
568
+ });
569
+
570
+ case 2:
571
+ return _context15.abrupt("return", _context15.sent);
572
+
573
+ case 3:
574
+ case "end":
575
+ return _context15.stop();
576
+ }
547
577
  }
548
578
  }, _callee15);
549
579
  }))();
@@ -559,19 +589,21 @@ var _default = (0, _extends2["default"])({
559
589
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16() {
560
590
  var parm;
561
591
  return _regenerator["default"].wrap(function _callee16$(_context16) {
562
- while (1) switch (_context16.prev = _context16.next) {
563
- case 0:
564
- _rlog["default"].debug('saveTopoSettings', settings);
565
-
566
- parm = {
567
- id: id,
568
- globalConfig: settings
569
- };
570
- return _context16.abrupt("return", _componentTopologyUtils.request.post(API_ROOT + "/config", parm));
571
-
572
- case 3:
573
- case "end":
574
- return _context16.stop();
592
+ while (1) {
593
+ switch (_context16.prev = _context16.next) {
594
+ case 0:
595
+ _rlog["default"].debug('saveTopoSettings', settings);
596
+
597
+ parm = {
598
+ id: id,
599
+ globalConfig: settings
600
+ };
601
+ return _context16.abrupt("return", _componentTopologyUtils.request.post(API_ROOT + "/config", parm));
602
+
603
+ case 3:
604
+ case "end":
605
+ return _context16.stop();
606
+ }
575
607
  }
576
608
  }, _callee16);
577
609
  }))();
@@ -584,17 +616,19 @@ var _default = (0, _extends2["default"])({
584
616
  openTopoAlarm: function openTopoAlarm(id) {
585
617
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17() {
586
618
  return _regenerator["default"].wrap(function _callee17$(_context17) {
587
- while (1) switch (_context17.prev = _context17.next) {
588
- case 0:
589
- _context17.next = 2;
590
- return _componentTopologyUtils.request.post(API_ROOT + "/alarm?topoId=" + id);
591
-
592
- case 2:
593
- return _context17.abrupt("return", _context17.sent);
594
-
595
- case 3:
596
- case "end":
597
- return _context17.stop();
619
+ while (1) {
620
+ switch (_context17.prev = _context17.next) {
621
+ case 0:
622
+ _context17.next = 2;
623
+ return _componentTopologyUtils.request.post(API_ROOT + "/alarm?topoId=" + id);
624
+
625
+ case 2:
626
+ return _context17.abrupt("return", _context17.sent);
627
+
628
+ case 3:
629
+ case "end":
630
+ return _context17.stop();
631
+ }
598
632
  }
599
633
  }, _callee17);
600
634
  }))();
@@ -607,17 +641,19 @@ var _default = (0, _extends2["default"])({
607
641
  closeTopoAlarm: function closeTopoAlarm(id, secretKey) {
608
642
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18() {
609
643
  return _regenerator["default"].wrap(function _callee18$(_context18) {
610
- while (1) switch (_context18.prev = _context18.next) {
611
- case 0:
612
- _context18.next = 2;
613
- return _componentTopologyUtils.request["delete"](API_ROOT + "/alarm?topoId=" + id + "&secretKey=" + secretKey);
614
-
615
- case 2:
616
- return _context18.abrupt("return", _context18.sent);
617
-
618
- case 3:
619
- case "end":
620
- return _context18.stop();
644
+ while (1) {
645
+ switch (_context18.prev = _context18.next) {
646
+ case 0:
647
+ _context18.next = 2;
648
+ return _componentTopologyUtils.request["delete"](API_ROOT + "/alarm?topoId=" + id + "&secretKey=" + secretKey);
649
+
650
+ case 2:
651
+ return _context18.abrupt("return", _context18.sent);
652
+
653
+ case 3:
654
+ case "end":
655
+ return _context18.stop();
656
+ }
621
657
  }
622
658
  }, _callee18);
623
659
  }))();
@@ -633,31 +669,33 @@ var _default = (0, _extends2["default"])({
633
669
 
634
670
  var param;
635
671
  return _regenerator["default"].wrap(function _callee19$(_context19) {
636
- while (1) switch (_context19.prev = _context19.next) {
637
- case 0:
638
- if (!(((_params$ids = params.ids) === null || _params$ids === void 0 ? void 0 : _params$ids.length) > 0)) {
639
- _context19.next = 6;
640
- break;
641
- }
642
-
643
- param = {
644
- condition: "id('" + params.ids.join("','") + "')",
645
- sort: 'index DESC',
646
- currentPage: 1,
647
- pageSize: params.ids.length > 10 ? params.ids.length : 10
648
- };
649
-
650
- _rlog["default"].debug('getAttributesByIds', param);
651
-
652
- _context19.next = 5;
653
- return (0, _cmdb.commonQuery)(param);
654
-
655
- case 5:
656
- return _context19.abrupt("return", _context19.sent);
657
-
658
- case 6:
659
- case "end":
660
- return _context19.stop();
672
+ while (1) {
673
+ switch (_context19.prev = _context19.next) {
674
+ case 0:
675
+ if (!(((_params$ids = params.ids) === null || _params$ids === void 0 ? void 0 : _params$ids.length) > 0)) {
676
+ _context19.next = 6;
677
+ break;
678
+ }
679
+
680
+ param = {
681
+ condition: "id('" + params.ids.join("','") + "')",
682
+ sort: 'index DESC',
683
+ currentPage: 1,
684
+ pageSize: params.ids.length > 10 ? params.ids.length : 10
685
+ };
686
+
687
+ _rlog["default"].debug('getAttributesByIds', param);
688
+
689
+ _context19.next = 5;
690
+ return (0, _cmdb.commonQuery)(param);
691
+
692
+ case 5:
693
+ return _context19.abrupt("return", _context19.sent);
694
+
695
+ case 6:
696
+ case "end":
697
+ return _context19.stop();
698
+ }
661
699
  }
662
700
  }, _callee19);
663
701
  }))();
@@ -713,17 +751,19 @@ var _default = (0, _extends2["default"])({
713
751
  getBatchCiPolling: function getBatchCiPolling(params) {
714
752
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee20() {
715
753
  return _regenerator["default"].wrap(function _callee20$(_context20) {
716
- while (1) switch (_context20.prev = _context20.next) {
717
- case 0:
718
- _context20.next = 2;
719
- return _componentTopologyUtils.request.post(_constants.TOPO_API_ROOT + "/attributes/polling", params);
720
-
721
- case 2:
722
- return _context20.abrupt("return", _context20.sent);
723
-
724
- case 3:
725
- case "end":
726
- return _context20.stop();
754
+ while (1) {
755
+ switch (_context20.prev = _context20.next) {
756
+ case 0:
757
+ _context20.next = 2;
758
+ return _componentTopologyUtils.request.post(_constants.TOPO_API_ROOT + "/attributes/polling", params);
759
+
760
+ case 2:
761
+ return _context20.abrupt("return", _context20.sent);
762
+
763
+ case 3:
764
+ case "end":
765
+ return _context20.stop();
766
+ }
727
767
  }
728
768
  }, _callee20);
729
769
  }))();