@riil-frontend/component-topology 11.0.34 → 11.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +4 -2
  4. package/build/index.js +49 -34
  5. package/es/components/MultiResourceDrawer/index.js +16 -18
  6. package/es/components/ResourceList/ResourceSelect.js +48 -50
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +24 -26
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +18 -20
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +23 -25
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
  11. package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
  12. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
  13. package/es/core/editor/components/BackgroundView/index.js +119 -129
  14. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +20 -22
  15. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
  16. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +15 -17
  17. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +7 -9
  18. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
  19. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
  20. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
  21. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +11 -13
  22. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +21 -23
  23. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
  24. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +10 -12
  25. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +21 -27
  26. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  27. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  28. package/es/core/editor/store/background.js +8 -10
  29. package/es/core/editor/store/topoEdit.js +4 -6
  30. package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  31. package/es/core/hooks/usePolling.js +117 -121
  32. package/es/core/hooks/useResourceConfig.js +58 -66
  33. package/es/core/hooks/useTopoEdit.js +473 -503
  34. package/es/core/models/Alarm.js +281 -298
  35. package/es/core/models/AttributeMetricDisplay.js +101 -107
  36. package/es/core/models/PluginManager.js +4 -3
  37. package/es/core/models/SelectionModel.js +4 -5
  38. package/es/core/models/TopoApp.js +205 -240
  39. package/es/core/models/TopoGraphView.js +18 -21
  40. package/es/core/models/cache/CiCache.js +28 -27
  41. package/es/core/models/cache/CiTypeCache.js +37 -41
  42. package/es/core/models/cache/DictCache.js +33 -35
  43. package/es/core/models/graph/Background.js +15 -17
  44. package/es/core/models/plugins/resourceWebControllUrl.js +76 -82
  45. package/es/core/models/tagstips/ElementTagTipConfig.js +34 -38
  46. package/es/core/models/topoData.js +68 -70
  47. package/es/core/models/utils/linkUtils.js +41 -43
  48. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  49. package/es/core/services/alarm.js +14 -16
  50. package/es/core/services/background.js +59 -67
  51. package/es/core/services/cmdb/metric.js +9 -11
  52. package/es/core/services/cmdb.js +18 -20
  53. package/es/core/services/index.js +39 -45
  54. package/es/core/services/overview.js +131 -151
  55. package/es/core/services/topo/basic.js +37 -41
  56. package/es/core/services/topo/tagtip.js +10 -12
  57. package/es/core/store/models/ciModel.js +58 -62
  58. package/es/core/store/models/customIcon.js +120 -134
  59. package/es/core/store/models/displayConfig.js +15 -19
  60. package/es/core/store/models/selection.js +4 -6
  61. package/es/core/store/models/topoAlarm.js +162 -145
  62. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  63. package/es/core/store/models/topoBizMod.js +9 -11
  64. package/es/core/store/models/topoConfig.js +215 -231
  65. package/es/core/store/models/topoGraphView.js +4 -6
  66. package/es/core/store/models/topoMod.js +373 -395
  67. package/es/core/utils/edgeUtil.js +2 -1
  68. package/es/core/utils/imageUtil.js +18 -20
  69. package/es/core/utils/saveSerialize.js +9 -11
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +343 -357
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +189 -205
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -37
  79. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
  80. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
  81. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +17 -19
  82. package/es/networkTopo/components/Link/hook.js +73 -77
  83. package/es/networkTopo/components/Link/index.js +86 -94
  84. package/es/networkTopo/components/Link/setting.js +42 -44
  85. package/es/networkTopo/getTopoData.js +63 -69
  86. package/es/networkTopo/hooks/viewer/useRelateTopo.js +30 -32
  87. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  88. package/es/networkTopo/models/TopoCenter.js +18 -22
  89. package/es/networkTopo/services/alert.js +18 -22
  90. package/es/networkTopo/services/authorization.js +45 -55
  91. package/es/networkTopo/services/cmdb.js +422 -470
  92. package/es/networkTopo/services/funcAuth.js +22 -24
  93. package/es/networkTopo/services/link.js +107 -117
  94. package/es/networkTopo/services/mdc.js +18 -24
  95. package/es/networkTopo/services/metric.js +23 -27
  96. package/es/networkTopo/services/model.js +445 -509
  97. package/es/networkTopo/services/risk.js +9 -11
  98. package/es/networkTopo/services/topo/auth.js +27 -33
  99. package/es/networkTopo/services/topo/basic.js +251 -289
  100. package/es/networkTopo/services/topo/blacklist.js +20 -24
  101. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  102. package/es/networkTopo/services/topo/icon.js +49 -59
  103. package/es/networkTopo/services/topo/networkLink.js +32 -36
  104. package/es/networkTopo/services/topo/relation.js +9 -11
  105. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  106. package/es/networkTopo/store/functionAuth.js +31 -37
  107. package/es/networkTopo/store/topoCenter.js +142 -152
  108. package/es/networkTopo/store/topoLinkMod.js +4 -6
  109. package/es/networkTopo/store/topoTreeMod.js +170 -182
  110. package/es/networkTopo/utils/exportData.js +52 -54
  111. package/lib/components/MultiResourceDrawer/index.js +16 -18
  112. package/lib/components/ResourceList/ResourceSelect.js +48 -50
  113. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +27 -29
  114. package/lib/components/SingleResourceDrawer/SelectDrawer.js +18 -20
  115. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +30 -32
  116. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +78 -84
  117. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
  118. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  119. package/lib/core/editor/components/BackgroundView/index.js +118 -128
  120. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -24
  121. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  122. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +19 -21
  123. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -10
  124. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +37 -41
  125. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +50 -54
  126. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +50 -54
  127. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +12 -14
  128. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +26 -28
  129. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +15 -17
  130. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -14
  131. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +25 -31
  132. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  133. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  134. package/lib/core/editor/store/background.js +8 -10
  135. package/lib/core/editor/store/topoEdit.js +4 -6
  136. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  137. package/lib/core/hooks/usePolling.js +116 -120
  138. package/lib/core/hooks/useResourceConfig.js +58 -66
  139. package/lib/core/hooks/useTopoEdit.js +465 -495
  140. package/lib/core/models/Alarm.js +275 -292
  141. package/lib/core/models/AttributeMetricDisplay.js +104 -110
  142. package/lib/core/models/PluginManager.js +4 -3
  143. package/lib/core/models/SelectionModel.js +4 -5
  144. package/lib/core/models/TopoApp.js +205 -240
  145. package/lib/core/models/TopoGraphView.js +18 -21
  146. package/lib/core/models/cache/CiCache.js +33 -32
  147. package/lib/core/models/cache/CiTypeCache.js +38 -42
  148. package/lib/core/models/cache/DictCache.js +33 -35
  149. package/lib/core/models/graph/Background.js +16 -18
  150. package/lib/core/models/plugins/resourceWebControllUrl.js +74 -80
  151. package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -38
  152. package/lib/core/models/topoData.js +69 -71
  153. package/lib/core/models/utils/linkUtils.js +41 -43
  154. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  155. package/lib/core/services/alarm.js +18 -20
  156. package/lib/core/services/background.js +70 -78
  157. package/lib/core/services/cmdb/metric.js +10 -12
  158. package/lib/core/services/cmdb.js +20 -22
  159. package/lib/core/services/index.js +45 -51
  160. package/lib/core/services/overview.js +131 -151
  161. package/lib/core/services/topo/basic.js +37 -41
  162. package/lib/core/services/topo/tagtip.js +12 -14
  163. package/lib/core/store/models/ciModel.js +66 -70
  164. package/lib/core/store/models/customIcon.js +120 -134
  165. package/lib/core/store/models/displayConfig.js +15 -19
  166. package/lib/core/store/models/selection.js +4 -6
  167. package/lib/core/store/models/topoAlarm.js +163 -145
  168. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  169. package/lib/core/store/models/topoBizMod.js +9 -11
  170. package/lib/core/store/models/topoConfig.js +222 -238
  171. package/lib/core/store/models/topoGraphView.js +4 -6
  172. package/lib/core/store/models/topoMod.js +375 -397
  173. package/lib/core/utils/edgeUtil.js +2 -1
  174. package/lib/core/utils/imageUtil.js +22 -24
  175. package/lib/core/utils/saveSerialize.js +9 -11
  176. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +56 -58
  177. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +15 -17
  178. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +344 -358
  179. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +86 -92
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +39 -41
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +190 -206
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +107 -109
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +57 -59
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +29 -33
  185. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +25 -29
  186. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +32 -36
  187. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +18 -20
  188. package/lib/networkTopo/components/Link/hook.js +73 -77
  189. package/lib/networkTopo/components/Link/index.js +87 -95
  190. package/lib/networkTopo/components/Link/setting.js +42 -44
  191. package/lib/networkTopo/getTopoData.js +63 -69
  192. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +31 -33
  193. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  194. package/lib/networkTopo/models/TopoCenter.js +18 -22
  195. package/lib/networkTopo/services/alert.js +18 -22
  196. package/lib/networkTopo/services/authorization.js +55 -65
  197. package/lib/networkTopo/services/cmdb.js +422 -470
  198. package/lib/networkTopo/services/funcAuth.js +24 -26
  199. package/lib/networkTopo/services/link.js +108 -118
  200. package/lib/networkTopo/services/mdc.js +21 -27
  201. package/lib/networkTopo/services/metric.js +27 -31
  202. package/lib/networkTopo/services/model.js +445 -509
  203. package/lib/networkTopo/services/risk.js +11 -13
  204. package/lib/networkTopo/services/topo/auth.js +27 -33
  205. package/lib/networkTopo/services/topo/basic.js +252 -290
  206. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  207. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  208. package/lib/networkTopo/services/topo/icon.js +59 -69
  209. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  210. package/lib/networkTopo/services/topo/relation.js +11 -13
  211. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  212. package/lib/networkTopo/store/functionAuth.js +31 -37
  213. package/lib/networkTopo/store/topoCenter.js +142 -152
  214. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  215. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  216. package/lib/networkTopo/utils/exportData.js +59 -61
  217. package/lib/utils/htElementDataUtil.js +4 -2
  218. package/package.json +4 -3
@@ -14,19 +14,17 @@ export default {
14
14
  getRiskByIds: function getRiskByIds(params) {
15
15
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
16
16
  return _regeneratorRuntime.wrap(function _callee$(_context) {
17
- while (1) {
18
- switch (_context.prev = _context.next) {
19
- case 0:
20
- _context.next = 2;
21
- return request.post('/health/v1/api/management/getRiskList', params);
22
-
23
- case 2:
24
- return _context.abrupt("return", _context.sent);
25
-
26
- case 3:
27
- case "end":
28
- return _context.stop();
29
- }
17
+ while (1) switch (_context.prev = _context.next) {
18
+ case 0:
19
+ _context.next = 2;
20
+ return request.post('/health/v1/api/management/getRiskList', params);
21
+
22
+ case 2:
23
+ return _context.abrupt("return", _context.sent);
24
+
25
+ case 3:
26
+ case "end":
27
+ return _context.stop();
30
28
  }
31
29
  }, _callee);
32
30
  }))();
@@ -41,32 +39,30 @@ export default {
41
39
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
42
40
  var components;
43
41
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
44
- while (1) {
45
- switch (_context2.prev = _context2.next) {
46
- case 0:
47
- components = ciComponentsMap[id];
48
-
49
- if (components) {
50
- _context2.next = 6;
51
- break;
52
- }
53
-
54
- _context2.next = 4;
55
- return request.post('/mdc/v1/api/cmdb/queryAllComponentsByCiId', {
56
- id: id
57
- });
58
-
59
- case 4:
60
- components = _context2.sent;
61
- ciComponentsMap[id] = components;
62
-
63
- case 6:
64
- return _context2.abrupt("return", components);
65
-
66
- case 7:
67
- case "end":
68
- return _context2.stop();
69
- }
42
+ while (1) switch (_context2.prev = _context2.next) {
43
+ case 0:
44
+ components = ciComponentsMap[id];
45
+
46
+ if (components) {
47
+ _context2.next = 6;
48
+ break;
49
+ }
50
+
51
+ _context2.next = 4;
52
+ return request.post('/mdc/v1/api/cmdb/queryAllComponentsByCiId', {
53
+ id: id
54
+ });
55
+
56
+ case 4:
57
+ components = _context2.sent;
58
+ ciComponentsMap[id] = components;
59
+
60
+ case 6:
61
+ return _context2.abrupt("return", components);
62
+
63
+ case 7:
64
+ case "end":
65
+ return _context2.stop();
70
66
  }
71
67
  }, _callee2);
72
68
  }))();
@@ -79,19 +75,17 @@ export default {
79
75
  handleAlarm: function handleAlarm(params) {
80
76
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
81
77
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
82
- while (1) {
83
- switch (_context3.prev = _context3.next) {
84
- case 0:
85
- _context3.next = 2;
86
- return request.post('/alert/v1/api/alert/handleAlerts', params);
87
-
88
- case 2:
89
- return _context3.abrupt("return", _context3.sent);
90
-
91
- case 3:
92
- case "end":
93
- return _context3.stop();
94
- }
78
+ while (1) switch (_context3.prev = _context3.next) {
79
+ case 0:
80
+ _context3.next = 2;
81
+ return request.post('/alert/v1/api/alert/handleAlerts', params);
82
+
83
+ case 2:
84
+ return _context3.abrupt("return", _context3.sent);
85
+
86
+ case 3:
87
+ case "end":
88
+ return _context3.stop();
95
89
  }
96
90
  }, _callee3);
97
91
  }))();
@@ -103,19 +97,17 @@ export default {
103
97
  getUserId: function getUserId() {
104
98
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
105
99
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
106
- while (1) {
107
- switch (_context4.prev = _context4.next) {
108
- case 0:
109
- _context4.next = 2;
110
- return request.post('/auth-ui/v1/api/user/token/checkToken');
111
-
112
- case 2:
113
- return _context4.abrupt("return", _context4.sent);
114
-
115
- case 3:
116
- case "end":
117
- return _context4.stop();
118
- }
100
+ while (1) switch (_context4.prev = _context4.next) {
101
+ case 0:
102
+ _context4.next = 2;
103
+ return request.post('/auth-ui/v1/api/user/token/checkToken');
104
+
105
+ case 2:
106
+ return _context4.abrupt("return", _context4.sent);
107
+
108
+ case 3:
109
+ case "end":
110
+ return _context4.stop();
119
111
  }
120
112
  }, _callee4);
121
113
  }))();
@@ -127,19 +119,17 @@ export default {
127
119
  getOverviewConfig: function getOverviewConfig(topoId, templateCode) {
128
120
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
129
121
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
130
- while (1) {
131
- switch (_context5.prev = _context5.next) {
132
- case 0:
133
- _context5.next = 2;
134
- return request.get("/topo/v1/api/config/overview/" + topoId + "/" + templateCode);
135
-
136
- case 2:
137
- return _context5.abrupt("return", _context5.sent);
138
-
139
- case 3:
140
- case "end":
141
- return _context5.stop();
142
- }
122
+ while (1) switch (_context5.prev = _context5.next) {
123
+ case 0:
124
+ _context5.next = 2;
125
+ return request.get("/topo/v1/api/config/overview/" + topoId + "/" + templateCode);
126
+
127
+ case 2:
128
+ return _context5.abrupt("return", _context5.sent);
129
+
130
+ case 3:
131
+ case "end":
132
+ return _context5.stop();
143
133
  }
144
134
  }, _callee5);
145
135
  }))();
@@ -151,19 +141,17 @@ export default {
151
141
  saveOverviewConfig: function saveOverviewConfig(topoId, templateCode, data) {
152
142
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
153
143
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
154
- while (1) {
155
- switch (_context6.prev = _context6.next) {
156
- case 0:
157
- _context6.next = 2;
158
- return request.post("/topo/v1/api/config/overview/" + topoId + "/" + templateCode, data);
159
-
160
- case 2:
161
- return _context6.abrupt("return", _context6.sent);
162
-
163
- case 3:
164
- case "end":
165
- return _context6.stop();
166
- }
144
+ while (1) switch (_context6.prev = _context6.next) {
145
+ case 0:
146
+ _context6.next = 2;
147
+ return request.post("/topo/v1/api/config/overview/" + topoId + "/" + templateCode, data);
148
+
149
+ case 2:
150
+ return _context6.abrupt("return", _context6.sent);
151
+
152
+ case 3:
153
+ case "end":
154
+ return _context6.stop();
167
155
  }
168
156
  }, _callee6);
169
157
  }))();
@@ -175,19 +163,17 @@ export default {
175
163
  getResMetricList: function getResMetricList(data) {
176
164
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
177
165
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
178
- while (1) {
179
- switch (_context7.prev = _context7.next) {
180
- case 0:
181
- _context7.next = 2;
182
- return request.post("/mdc/v1/api/metric/list", data);
183
-
184
- case 2:
185
- return _context7.abrupt("return", _context7.sent);
186
-
187
- case 3:
188
- case "end":
189
- return _context7.stop();
190
- }
166
+ while (1) switch (_context7.prev = _context7.next) {
167
+ case 0:
168
+ _context7.next = 2;
169
+ return request.post("/mdc/v1/api/metric/list", data);
170
+
171
+ case 2:
172
+ return _context7.abrupt("return", _context7.sent);
173
+
174
+ case 3:
175
+ case "end":
176
+ return _context7.stop();
191
177
  }
192
178
  }, _callee7);
193
179
  }))();
@@ -199,27 +185,25 @@ export default {
199
185
  getDeviceTypeList: function getDeviceTypeList() {
200
186
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
201
187
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
202
- while (1) {
203
- switch (_context8.prev = _context8.next) {
204
- case 0:
205
- if (roomDeviceTypeList) {
206
- _context8.next = 4;
207
- break;
208
- }
209
-
210
- _context8.next = 3;
211
- return request.post("/room/v1/api/device/type/list", {});
212
-
213
- case 3:
214
- roomDeviceTypeList = _context8.sent;
215
-
216
- case 4:
217
- return _context8.abrupt("return", roomDeviceTypeList);
218
-
219
- case 5:
220
- case "end":
221
- return _context8.stop();
222
- }
188
+ while (1) switch (_context8.prev = _context8.next) {
189
+ case 0:
190
+ if (roomDeviceTypeList) {
191
+ _context8.next = 4;
192
+ break;
193
+ }
194
+
195
+ _context8.next = 3;
196
+ return request.post("/room/v1/api/device/type/list", {});
197
+
198
+ case 3:
199
+ roomDeviceTypeList = _context8.sent;
200
+
201
+ case 4:
202
+ return _context8.abrupt("return", roomDeviceTypeList);
203
+
204
+ case 5:
205
+ case "end":
206
+ return _context8.stop();
223
207
  }
224
208
  }, _callee8);
225
209
  }))();
@@ -231,19 +215,17 @@ export default {
231
215
  getMetricList: function getMetricList(data) {
232
216
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
233
217
  return _regeneratorRuntime.wrap(function _callee9$(_context9) {
234
- while (1) {
235
- switch (_context9.prev = _context9.next) {
236
- case 0:
237
- _context9.next = 2;
238
- return request.post("/mdc/v1/api/metric/list", data);
239
-
240
- case 2:
241
- return _context9.abrupt("return", _context9.sent);
242
-
243
- case 3:
244
- case "end":
245
- return _context9.stop();
246
- }
218
+ while (1) switch (_context9.prev = _context9.next) {
219
+ case 0:
220
+ _context9.next = 2;
221
+ return request.post("/mdc/v1/api/metric/list", data);
222
+
223
+ case 2:
224
+ return _context9.abrupt("return", _context9.sent);
225
+
226
+ case 3:
227
+ case "end":
228
+ return _context9.stop();
247
229
  }
248
230
  }, _callee9);
249
231
  }))();
@@ -255,19 +237,17 @@ export default {
255
237
  commonQueryCiData: function commonQueryCiData(params) {
256
238
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
257
239
  return _regeneratorRuntime.wrap(function _callee10$(_context10) {
258
- while (1) {
259
- switch (_context10.prev = _context10.next) {
260
- case 0:
261
- _context10.next = 2;
262
- return request.post("/mdc/v1/api/cmdb/commonQueryCiData", params);
263
-
264
- case 2:
265
- return _context10.abrupt("return", _context10.sent);
266
-
267
- case 3:
268
- case "end":
269
- return _context10.stop();
270
- }
240
+ while (1) switch (_context10.prev = _context10.next) {
241
+ case 0:
242
+ _context10.next = 2;
243
+ return request.post("/mdc/v1/api/cmdb/commonQueryCiData", params);
244
+
245
+ case 2:
246
+ return _context10.abrupt("return", _context10.sent);
247
+
248
+ case 3:
249
+ case "end":
250
+ return _context10.stop();
271
251
  }
272
252
  }, _callee10);
273
253
  }))();
@@ -108,32 +108,30 @@ export default {
108
108
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
109
109
  var data, obj;
110
110
  return _regeneratorRuntime.wrap(function _callee$(_context) {
111
- while (1) {
112
- switch (_context.prev = _context.next) {
113
- case 0:
114
- data = Array.isArray(groups) ? groups : [];
115
-
116
- if (resources) {
117
- data.push({
118
- parentId: TOPO_PARENT_ID,
119
- order: 100,
120
- resources: resources
121
- });
122
- }
123
-
124
- obj = prepareGroupParams(data);
125
- _context.next = 5;
126
- return request.post(API_ROOT + "/structure/byCondition/" + id, _extends({}, obj, {
127
- exportLinkIdList: exportLinkIdList
128
- }));
129
-
130
- case 5:
131
- return _context.abrupt("return", _context.sent);
132
-
133
- case 6:
134
- case "end":
135
- return _context.stop();
136
- }
111
+ while (1) switch (_context.prev = _context.next) {
112
+ case 0:
113
+ data = Array.isArray(groups) ? groups : [];
114
+
115
+ if (resources) {
116
+ data.push({
117
+ parentId: TOPO_PARENT_ID,
118
+ order: 100,
119
+ resources: resources
120
+ });
121
+ }
122
+
123
+ obj = prepareGroupParams(data);
124
+ _context.next = 5;
125
+ return request.post(API_ROOT + "/structure/byCondition/" + id, _extends({}, obj, {
126
+ exportLinkIdList: exportLinkIdList
127
+ }));
128
+
129
+ case 5:
130
+ return _context.abrupt("return", _context.sent);
131
+
132
+ case 6:
133
+ case "end":
134
+ return _context.stop();
137
135
  }
138
136
  }, _callee);
139
137
  }))();
@@ -148,21 +146,19 @@ export default {
148
146
  saveSerializeData: function saveSerializeData(id, data) {
149
147
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
150
148
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
151
- while (1) {
152
- switch (_context2.prev = _context2.next) {
153
- case 0:
154
- _context2.next = 2;
155
- return request.post(TOPO_API_ROOT + "/structure/" + id, {
156
- data: data
157
- });
158
-
159
- case 2:
160
- return _context2.abrupt("return", _context2.sent);
161
-
162
- case 3:
163
- case "end":
164
- return _context2.stop();
165
- }
149
+ while (1) switch (_context2.prev = _context2.next) {
150
+ case 0:
151
+ _context2.next = 2;
152
+ return request.post(TOPO_API_ROOT + "/structure/" + id, {
153
+ data: data
154
+ });
155
+
156
+ case 2:
157
+ return _context2.abrupt("return", _context2.sent);
158
+
159
+ case 3:
160
+ case "end":
161
+ return _context2.stop();
166
162
  }
167
163
  }, _callee2);
168
164
  }))();
@@ -9,20 +9,18 @@ function _getMetricsByMonitorTemplateCodes() {
9
9
  _getMetricsByMonitorTemplateCodes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(mtCodes) {
10
10
  var result;
11
11
  return _regeneratorRuntime.wrap(function _callee$(_context) {
12
- while (1) {
13
- switch (_context.prev = _context.next) {
14
- case 0:
15
- _context.next = 2;
16
- return request.post('/topo/v1/api/attributes/metricByTemplateCode', mtCodes);
12
+ while (1) switch (_context.prev = _context.next) {
13
+ case 0:
14
+ _context.next = 2;
15
+ return request.post('/topo/v1/api/attributes/metricByTemplateCode', mtCodes);
17
16
 
18
- case 2:
19
- result = _context.sent;
20
- return _context.abrupt("return", result);
17
+ case 2:
18
+ result = _context.sent;
19
+ return _context.abrupt("return", result);
21
20
 
22
- case 4:
23
- case "end":
24
- return _context.stop();
25
- }
21
+ case 4:
22
+ case "end":
23
+ return _context.stop();
26
24
  }
27
25
  }, _callee);
28
26
  }));
@@ -21,29 +21,27 @@ export default {
21
21
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
22
22
  var modelTree, dicts;
23
23
  return _regeneratorRuntime.wrap(function _callee$(_context) {
24
- while (1) {
25
- switch (_context.prev = _context.next) {
26
- case 0:
27
- _context.next = 2;
28
- return queryAllModel();
24
+ while (1) switch (_context.prev = _context.next) {
25
+ case 0:
26
+ _context.next = 2;
27
+ return queryAllModel();
29
28
 
30
- case 2:
31
- modelTree = _context.sent;
32
- dicts = getAllCiTypes(modelTree);
29
+ case 2:
30
+ modelTree = _context.sent;
31
+ dicts = getAllCiTypes(modelTree);
33
32
 
34
- _this.update({
35
- typeDicts: dicts.map(function (item) {
36
- return _extends({}, item, {
37
- label: item.name,
38
- value: item.code
39
- });
40
- })
41
- });
33
+ _this.update({
34
+ typeDicts: dicts.map(function (item) {
35
+ return _extends({}, item, {
36
+ label: item.name,
37
+ value: item.code
38
+ });
39
+ })
40
+ });
42
41
 
43
- case 5:
44
- case "end":
45
- return _context.stop();
46
- }
42
+ case 5:
43
+ case "end":
44
+ return _context.stop();
47
45
  }
48
46
  }, _callee);
49
47
  }))();
@@ -55,53 +53,51 @@ export default {
55
53
  var attrData, metricsData, code, _attrData$attributes, attributes, _metricsData$metrics, metrics, meta;
56
54
 
57
55
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
58
- while (1) {
59
- switch (_context2.prev = _context2.next) {
60
- case 0:
61
- _this2.update({
62
- currentCi: {
63
- code: ciCode,
64
- meta: []
65
- }
66
- });
56
+ while (1) switch (_context2.prev = _context2.next) {
57
+ case 0:
58
+ _this2.update({
59
+ currentCi: {
60
+ code: ciCode,
61
+ meta: []
62
+ }
63
+ });
67
64
 
68
- _context2.next = 3;
69
- return getCi(ciCode);
65
+ _context2.next = 3;
66
+ return getCi(ciCode);
70
67
 
71
- case 3:
72
- attrData = _context2.sent;
73
- _context2.next = 6;
74
- return getCiMetric(ciCode);
68
+ case 3:
69
+ attrData = _context2.sent;
70
+ _context2.next = 6;
71
+ return getCiMetric(ciCode);
75
72
 
76
- case 6:
77
- metricsData = _context2.sent;
78
- code = attrData.code, _attrData$attributes = attrData.attributes, attributes = _attrData$attributes === void 0 ? [] : _attrData$attributes;
79
- _metricsData$metrics = metricsData.metrics, metrics = _metricsData$metrics === void 0 ? [] : _metricsData$metrics;
80
- meta = attributes.map(function (attr) {
81
- return {
82
- code: attr.code,
83
- name: attr.name,
84
- type: 'attributes'
85
- };
86
- }).concat(metrics.map(function (metric) {
87
- return {
88
- code: metric.code,
89
- name: metric.name,
90
- type: 'metrics'
91
- };
92
- }));
73
+ case 6:
74
+ metricsData = _context2.sent;
75
+ code = attrData.code, _attrData$attributes = attrData.attributes, attributes = _attrData$attributes === void 0 ? [] : _attrData$attributes;
76
+ _metricsData$metrics = metricsData.metrics, metrics = _metricsData$metrics === void 0 ? [] : _metricsData$metrics;
77
+ meta = attributes.map(function (attr) {
78
+ return {
79
+ code: attr.code,
80
+ name: attr.name,
81
+ type: 'attributes'
82
+ };
83
+ }).concat(metrics.map(function (metric) {
84
+ return {
85
+ code: metric.code,
86
+ name: metric.name,
87
+ type: 'metrics'
88
+ };
89
+ }));
93
90
 
94
- _this2.update({
95
- currentCi: {
96
- code: code,
97
- meta: meta
98
- }
99
- });
91
+ _this2.update({
92
+ currentCi: {
93
+ code: code,
94
+ meta: meta
95
+ }
96
+ });
100
97
 
101
- case 11:
102
- case "end":
103
- return _context2.stop();
104
- }
98
+ case 11:
99
+ case "end":
100
+ return _context2.stop();
105
101
  }
106
102
  }, _callee2);
107
103
  }))();