@riil-frontend/component-topology 10.0.58 → 10.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +4 -2
  4. package/build/index.js +52 -45
  5. package/es/components/IndexSettingDrawer/index.js +6 -5
  6. package/es/components/MultiResourceDrawer/index.js +22 -26
  7. package/es/components/ResourceList/ResourceSelect.js +55 -58
  8. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
  9. package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  10. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
  11. package/es/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +78 -100
  12. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  13. package/es/core/components/titlebar/widgets/TitleWidget.js +5 -4
  14. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
  15. package/es/core/editor/components/BackgroundView/index.js +149 -178
  16. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
  17. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
  18. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
  19. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
  20. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  21. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  22. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  23. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
  24. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
  25. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  26. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
  27. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
  28. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  29. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  30. package/es/core/editor/store/background.js +8 -10
  31. package/es/core/editor/store/topoEdit.js +4 -6
  32. package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  33. package/es/core/hooks/usePolling.js +110 -122
  34. package/es/core/hooks/useResourceConfig.js +76 -100
  35. package/es/core/hooks/useTopoEdit.js +539 -638
  36. package/es/core/models/Alarm.js +311 -394
  37. package/es/core/models/AttributeMetricDisplay.js +115 -143
  38. package/es/core/models/PluginManager.js +4 -3
  39. package/es/core/models/SelectionModel.js +4 -5
  40. package/es/core/models/TopoApp.js +287 -454
  41. package/es/core/models/TopoGraphView.js +28 -41
  42. package/es/core/models/cache/CiCache.js +34 -39
  43. package/es/core/models/cache/CiTypeCache.js +70 -84
  44. package/es/core/models/cache/DictCache.js +36 -42
  45. package/es/core/models/graph/Background.js +21 -26
  46. package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
  47. package/es/core/models/tagstips/ElementTagTipConfig.js +34 -40
  48. package/es/core/models/topoData.js +73 -77
  49. package/es/core/models/utils/linkUtils.js +46 -51
  50. package/es/core/services/alarm.js +14 -16
  51. package/es/core/services/background.js +59 -67
  52. package/es/core/services/cmdb/metric.js +14 -18
  53. package/es/core/services/cmdb.js +23 -27
  54. package/es/core/services/index.js +48 -68
  55. package/es/core/services/overview.js +131 -151
  56. package/es/core/services/topo/basic.js +11 -13
  57. package/es/core/services/topo/tagtip.js +15 -19
  58. package/es/core/store/models/ciModel.js +58 -62
  59. package/es/core/store/models/customIcon.js +126 -145
  60. package/es/core/store/models/displayConfig.js +15 -19
  61. package/es/core/store/models/selection.js +4 -6
  62. package/es/core/store/models/topoAlarm.js +162 -145
  63. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  64. package/es/core/store/models/topoBizMod.js +28 -32
  65. package/es/core/store/models/topoConfig.js +217 -233
  66. package/es/core/store/models/topoGraphView.js +4 -6
  67. package/es/core/store/models/topoMod.js +379 -401
  68. package/es/core/utils/imageUtil.js +23 -27
  69. package/es/core/utils/saveSerialize.js +14 -18
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
  79. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
  80. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  81. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
  82. package/es/networkTopo/components/Link/hook.js +85 -96
  83. package/es/networkTopo/components/Link/index copy.js +104 -126
  84. package/es/networkTopo/components/Link/index.js +104 -126
  85. package/es/networkTopo/components/Link/setting.js +48 -52
  86. package/es/networkTopo/getTopoData.js +73 -92
  87. package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
  88. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  89. package/es/networkTopo/models/TopoCenter.js +28 -46
  90. package/es/networkTopo/services/alert.js +18 -22
  91. package/es/networkTopo/services/authorization.js +45 -55
  92. package/es/networkTopo/services/cmdb.js +548 -696
  93. package/es/networkTopo/services/funcAuth.js +22 -24
  94. package/es/networkTopo/services/link.js +107 -117
  95. package/es/networkTopo/services/mdc.js +33 -48
  96. package/es/networkTopo/services/metric.js +38 -47
  97. package/es/networkTopo/services/model.js +616 -809
  98. package/es/networkTopo/services/risk.js +9 -11
  99. package/es/networkTopo/services/topo/auth.js +27 -33
  100. package/es/networkTopo/services/topo/basic.js +274 -314
  101. package/es/networkTopo/services/topo/blacklist.js +20 -24
  102. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  103. package/es/networkTopo/services/topo/icon.js +49 -59
  104. package/es/networkTopo/services/topo/networkLink.js +32 -36
  105. package/es/networkTopo/services/topo/relation.js +9 -11
  106. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  107. package/es/networkTopo/store/functionAuth.js +31 -37
  108. package/es/networkTopo/store/linkDynamicStyle.js +102 -108
  109. package/es/networkTopo/store/linkDynamicStyleConfig.js +42 -44
  110. package/es/networkTopo/store/linkManager.js +4 -6
  111. package/es/networkTopo/store/topoCenter.js +142 -152
  112. package/es/networkTopo/store/topoLinkMod.js +4 -6
  113. package/es/networkTopo/store/topoTreeMod.js +170 -182
  114. package/es/networkTopo/utils/exportData.js +57 -61
  115. package/lib/components/IndexSettingDrawer/index.js +6 -5
  116. package/lib/components/MultiResourceDrawer/index.js +22 -26
  117. package/lib/components/ResourceList/ResourceSelect.js +54 -58
  118. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
  119. package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  120. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
  121. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +82 -104
  122. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  123. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -4
  124. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  125. package/lib/core/editor/components/BackgroundView/index.js +148 -177
  126. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
  127. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  128. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
  129. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
  130. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  131. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  132. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  133. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
  134. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
  135. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  136. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
  137. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
  138. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  139. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  140. package/lib/core/editor/store/background.js +8 -10
  141. package/lib/core/editor/store/topoEdit.js +4 -6
  142. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  143. package/lib/core/hooks/usePolling.js +108 -120
  144. package/lib/core/hooks/useResourceConfig.js +76 -100
  145. package/lib/core/hooks/useTopoEdit.js +530 -629
  146. package/lib/core/models/Alarm.js +308 -391
  147. package/lib/core/models/AttributeMetricDisplay.js +118 -146
  148. package/lib/core/models/PluginManager.js +4 -3
  149. package/lib/core/models/SelectionModel.js +4 -5
  150. package/lib/core/models/TopoApp.js +287 -454
  151. package/lib/core/models/TopoGraphView.js +28 -41
  152. package/lib/core/models/cache/CiCache.js +39 -44
  153. package/lib/core/models/cache/CiTypeCache.js +71 -85
  154. package/lib/core/models/cache/DictCache.js +39 -45
  155. package/lib/core/models/graph/Background.js +22 -27
  156. package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
  157. package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -40
  158. package/lib/core/models/topoData.js +73 -78
  159. package/lib/core/models/utils/linkUtils.js +45 -51
  160. package/lib/core/services/alarm.js +18 -20
  161. package/lib/core/services/background.js +70 -78
  162. package/lib/core/services/cmdb/metric.js +14 -19
  163. package/lib/core/services/cmdb.js +24 -29
  164. package/lib/core/services/index.js +53 -72
  165. package/lib/core/services/overview.js +131 -151
  166. package/lib/core/services/topo/basic.js +13 -15
  167. package/lib/core/services/topo/tagtip.js +16 -21
  168. package/lib/core/store/models/ciModel.js +66 -70
  169. package/lib/core/store/models/customIcon.js +126 -145
  170. package/lib/core/store/models/displayConfig.js +15 -19
  171. package/lib/core/store/models/selection.js +4 -6
  172. package/lib/core/store/models/topoAlarm.js +163 -145
  173. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  174. package/lib/core/store/models/topoBizMod.js +34 -38
  175. package/lib/core/store/models/topoConfig.js +224 -240
  176. package/lib/core/store/models/topoGraphView.js +4 -6
  177. package/lib/core/store/models/topoMod.js +381 -403
  178. package/lib/core/utils/imageUtil.js +26 -31
  179. package/lib/core/utils/saveSerialize.js +13 -18
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
  185. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
  186. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  187. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  188. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
  189. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
  190. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  191. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
  192. package/lib/networkTopo/components/Link/hook.js +86 -98
  193. package/lib/networkTopo/components/Link/index copy.js +105 -127
  194. package/lib/networkTopo/components/Link/index.js +105 -127
  195. package/lib/networkTopo/components/Link/setting.js +48 -52
  196. package/lib/networkTopo/getTopoData.js +73 -92
  197. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
  198. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  199. package/lib/networkTopo/models/TopoCenter.js +28 -46
  200. package/lib/networkTopo/services/alert.js +18 -22
  201. package/lib/networkTopo/services/authorization.js +55 -65
  202. package/lib/networkTopo/services/cmdb.js +551 -700
  203. package/lib/networkTopo/services/funcAuth.js +24 -26
  204. package/lib/networkTopo/services/link.js +108 -118
  205. package/lib/networkTopo/services/mdc.js +35 -51
  206. package/lib/networkTopo/services/metric.js +37 -47
  207. package/lib/networkTopo/services/model.js +615 -809
  208. package/lib/networkTopo/services/risk.js +11 -13
  209. package/lib/networkTopo/services/topo/auth.js +27 -33
  210. package/lib/networkTopo/services/topo/basic.js +277 -317
  211. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  212. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  213. package/lib/networkTopo/services/topo/icon.js +59 -69
  214. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  215. package/lib/networkTopo/services/topo/relation.js +11 -13
  216. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  217. package/lib/networkTopo/store/functionAuth.js +31 -37
  218. package/lib/networkTopo/store/linkDynamicStyle.js +103 -109
  219. package/lib/networkTopo/store/linkDynamicStyleConfig.js +42 -44
  220. package/lib/networkTopo/store/linkManager.js +4 -6
  221. package/lib/networkTopo/store/topoCenter.js +142 -152
  222. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  223. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  224. package/lib/networkTopo/utils/exportData.js +63 -68
  225. package/package.json +3 -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
  }))();
@@ -23,21 +23,19 @@ var _default = {
23
23
  saveSerializeData: function saveSerializeData(id, data) {
24
24
  return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
25
25
  return _regenerator["default"].wrap(function _callee$(_context) {
26
- while (1) {
27
- switch (_context.prev = _context.next) {
28
- case 0:
29
- _context.next = 2;
30
- return _componentTopologyUtils.request.post(_constants.TOPO_API_ROOT + "/structure/" + id, {
31
- data: data
32
- });
33
-
34
- case 2:
35
- return _context.abrupt("return", _context.sent);
36
-
37
- case 3:
38
- case "end":
39
- return _context.stop();
40
- }
26
+ while (1) switch (_context.prev = _context.next) {
27
+ case 0:
28
+ _context.next = 2;
29
+ return _componentTopologyUtils.request.post(_constants.TOPO_API_ROOT + "/structure/" + id, {
30
+ data: data
31
+ });
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
  }))();
@@ -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
  }))();