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