@riil-frontend/component-topology 11.0.34 → 11.0.35

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