@riil-frontend/component-topology 11.0.38 → 11.0.39

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 +2 -4
  4. package/build/index.js +34 -49
  5. package/es/components/MultiResourceDrawer/index.js +18 -16
  6. package/es/components/ResourceList/ResourceSelect.js +50 -48
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +26 -24
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +20 -18
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +25 -23
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
  11. package/es/core/components/titlebar/widgets/TitleWidget.js +3 -5
  12. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
  13. package/es/core/editor/components/BackgroundView/index.js +129 -119
  14. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -20
  15. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
  16. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +17 -15
  17. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +9 -7
  18. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
  19. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
  20. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
  21. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +13 -11
  22. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +23 -21
  23. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
  24. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -10
  25. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +27 -21
  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 +10 -8
  29. package/es/core/editor/store/topoEdit.js +6 -4
  30. package/es/core/editor/utils/edgeTypeStyleUtil.js +4 -2
  31. package/es/core/hooks/usePolling.js +121 -117
  32. package/es/core/hooks/useResourceConfig.js +66 -58
  33. package/es/core/hooks/useTopoEdit.js +507 -477
  34. package/es/core/models/Alarm.js +298 -281
  35. package/es/core/models/AttributeMetricDisplay.js +107 -101
  36. package/es/core/models/PluginManager.js +3 -4
  37. package/es/core/models/SelectionModel.js +5 -4
  38. package/es/core/models/TopoApp.js +240 -205
  39. package/es/core/models/TopoGraphView.js +21 -18
  40. package/es/core/models/cache/CiCache.js +27 -28
  41. package/es/core/models/cache/CiTypeCache.js +41 -37
  42. package/es/core/models/cache/DictCache.js +35 -33
  43. package/es/core/models/graph/Background.js +17 -15
  44. package/es/core/models/plugins/resourceWebControllUrl.js +82 -76
  45. package/es/core/models/tagstips/ElementTagTipConfig.js +38 -34
  46. package/es/core/models/topoData.js +70 -68
  47. package/es/core/models/utils/linkUtils.js +43 -41
  48. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  49. package/es/core/services/alarm.js +16 -14
  50. package/es/core/services/background.js +67 -59
  51. package/es/core/services/cmdb/metric.js +11 -9
  52. package/es/core/services/cmdb.js +20 -18
  53. package/es/core/services/index.js +45 -39
  54. package/es/core/services/overview.js +151 -131
  55. package/es/core/services/topo/basic.js +41 -37
  56. package/es/core/services/topo/tagtip.js +12 -10
  57. package/es/core/store/models/ciModel.js +62 -58
  58. package/es/core/store/models/customIcon.js +134 -120
  59. package/es/core/store/models/displayConfig.js +19 -15
  60. package/es/core/store/models/selection.js +6 -4
  61. package/es/core/store/models/topoAlarm.js +145 -162
  62. package/es/core/store/models/topoBaseInfoOverview.js +6 -4
  63. package/es/core/store/models/topoBizMod.js +11 -9
  64. package/es/core/store/models/topoConfig.js +231 -215
  65. package/es/core/store/models/topoGraphView.js +6 -4
  66. package/es/core/store/models/topoMod.js +395 -373
  67. package/es/core/utils/edgeUtil.js +2 -1
  68. package/es/core/utils/imageUtil.js +20 -18
  69. package/es/core/utils/saveSerialize.js +11 -9
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +357 -343
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +205 -189
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +111 -109
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +37 -33
  79. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
  80. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
  81. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +19 -17
  82. package/es/networkTopo/components/Link/hook.js +77 -73
  83. package/es/networkTopo/components/Link/index.js +94 -86
  84. package/es/networkTopo/components/Link/setting.js +44 -42
  85. package/es/networkTopo/getTopoData.js +69 -63
  86. package/es/networkTopo/hooks/viewer/useRelateTopo.js +32 -30
  87. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  88. package/es/networkTopo/models/TopoCenter.js +22 -18
  89. package/es/networkTopo/services/alert.js +22 -18
  90. package/es/networkTopo/services/authorization.js +55 -45
  91. package/es/networkTopo/services/cmdb.js +470 -422
  92. package/es/networkTopo/services/funcAuth.js +24 -22
  93. package/es/networkTopo/services/link.js +117 -107
  94. package/es/networkTopo/services/mdc.js +24 -18
  95. package/es/networkTopo/services/metric.js +27 -23
  96. package/es/networkTopo/services/model.js +509 -445
  97. package/es/networkTopo/services/risk.js +11 -9
  98. package/es/networkTopo/services/topo/auth.js +33 -27
  99. package/es/networkTopo/services/topo/basic.js +289 -251
  100. package/es/networkTopo/services/topo/blacklist.js +24 -20
  101. package/es/networkTopo/services/topo/ciInfo.js +31 -27
  102. package/es/networkTopo/services/topo/icon.js +59 -49
  103. package/es/networkTopo/services/topo/networkLink.js +36 -32
  104. package/es/networkTopo/services/topo/relation.js +11 -9
  105. package/es/networkTopo/services/topo/resourceWebUrl.js +42 -36
  106. package/es/networkTopo/store/functionAuth.js +37 -31
  107. package/es/networkTopo/store/topoCenter.js +152 -142
  108. package/es/networkTopo/store/topoLinkMod.js +6 -4
  109. package/es/networkTopo/store/topoTreeMod.js +182 -170
  110. package/es/networkTopo/utils/exportData.js +54 -52
  111. package/lib/components/MultiResourceDrawer/index.js +18 -16
  112. package/lib/components/ResourceList/ResourceSelect.js +50 -48
  113. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +29 -27
  114. package/lib/components/SingleResourceDrawer/SelectDrawer.js +20 -18
  115. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +32 -30
  116. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
  117. package/lib/core/components/titlebar/widgets/TitleWidget.js +3 -5
  118. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
  119. package/lib/core/editor/components/BackgroundView/index.js +128 -118
  120. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +24 -22
  121. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
  122. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +21 -19
  123. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +10 -8
  124. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
  125. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
  126. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
  127. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +14 -12
  128. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +28 -26
  129. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
  130. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +14 -12
  131. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +31 -25
  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 +10 -8
  135. package/lib/core/editor/store/topoEdit.js +6 -4
  136. package/lib/core/editor/utils/edgeTypeStyleUtil.js +4 -2
  137. package/lib/core/hooks/usePolling.js +120 -116
  138. package/lib/core/hooks/useResourceConfig.js +66 -58
  139. package/lib/core/hooks/useTopoEdit.js +499 -469
  140. package/lib/core/models/Alarm.js +292 -275
  141. package/lib/core/models/AttributeMetricDisplay.js +110 -104
  142. package/lib/core/models/PluginManager.js +3 -4
  143. package/lib/core/models/SelectionModel.js +5 -4
  144. package/lib/core/models/TopoApp.js +240 -205
  145. package/lib/core/models/TopoGraphView.js +21 -18
  146. package/lib/core/models/cache/CiCache.js +32 -33
  147. package/lib/core/models/cache/CiTypeCache.js +42 -38
  148. package/lib/core/models/cache/DictCache.js +35 -33
  149. package/lib/core/models/graph/Background.js +18 -16
  150. package/lib/core/models/plugins/resourceWebControllUrl.js +80 -74
  151. package/lib/core/models/tagstips/ElementTagTipConfig.js +38 -34
  152. package/lib/core/models/topoData.js +71 -69
  153. package/lib/core/models/utils/linkUtils.js +43 -41
  154. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  155. package/lib/core/services/alarm.js +20 -18
  156. package/lib/core/services/background.js +78 -70
  157. package/lib/core/services/cmdb/metric.js +12 -10
  158. package/lib/core/services/cmdb.js +22 -20
  159. package/lib/core/services/index.js +51 -45
  160. package/lib/core/services/overview.js +151 -131
  161. package/lib/core/services/topo/basic.js +41 -37
  162. package/lib/core/services/topo/tagtip.js +14 -12
  163. package/lib/core/store/models/ciModel.js +70 -66
  164. package/lib/core/store/models/customIcon.js +134 -120
  165. package/lib/core/store/models/displayConfig.js +19 -15
  166. package/lib/core/store/models/selection.js +6 -4
  167. package/lib/core/store/models/topoAlarm.js +145 -163
  168. package/lib/core/store/models/topoBaseInfoOverview.js +6 -4
  169. package/lib/core/store/models/topoBizMod.js +11 -9
  170. package/lib/core/store/models/topoConfig.js +238 -222
  171. package/lib/core/store/models/topoGraphView.js +6 -4
  172. package/lib/core/store/models/topoMod.js +397 -375
  173. package/lib/core/utils/edgeUtil.js +2 -1
  174. package/lib/core/utils/imageUtil.js +24 -22
  175. package/lib/core/utils/saveSerialize.js +11 -9
  176. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
  177. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
  178. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +358 -344
  179. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +206 -190
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +111 -109
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -29
  185. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
  186. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
  187. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +20 -18
  188. package/lib/networkTopo/components/Link/hook.js +77 -73
  189. package/lib/networkTopo/components/Link/index.js +95 -87
  190. package/lib/networkTopo/components/Link/setting.js +44 -42
  191. package/lib/networkTopo/getTopoData.js +69 -63
  192. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +33 -31
  193. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  194. package/lib/networkTopo/models/TopoCenter.js +22 -18
  195. package/lib/networkTopo/services/alert.js +22 -18
  196. package/lib/networkTopo/services/authorization.js +65 -55
  197. package/lib/networkTopo/services/cmdb.js +470 -422
  198. package/lib/networkTopo/services/funcAuth.js +26 -24
  199. package/lib/networkTopo/services/link.js +118 -108
  200. package/lib/networkTopo/services/mdc.js +27 -21
  201. package/lib/networkTopo/services/metric.js +31 -27
  202. package/lib/networkTopo/services/model.js +509 -445
  203. package/lib/networkTopo/services/risk.js +13 -11
  204. package/lib/networkTopo/services/topo/auth.js +33 -27
  205. package/lib/networkTopo/services/topo/basic.js +290 -252
  206. package/lib/networkTopo/services/topo/blacklist.js +24 -20
  207. package/lib/networkTopo/services/topo/ciInfo.js +38 -34
  208. package/lib/networkTopo/services/topo/icon.js +69 -59
  209. package/lib/networkTopo/services/topo/networkLink.js +36 -32
  210. package/lib/networkTopo/services/topo/relation.js +13 -11
  211. package/lib/networkTopo/services/topo/resourceWebUrl.js +50 -44
  212. package/lib/networkTopo/store/functionAuth.js +37 -31
  213. package/lib/networkTopo/store/topoCenter.js +152 -142
  214. package/lib/networkTopo/store/topoLinkMod.js +6 -4
  215. package/lib/networkTopo/store/topoTreeMod.js +178 -166
  216. package/lib/networkTopo/utils/exportData.js +61 -59
  217. package/lib/utils/htElementDataUtil.js +2 -4
  218. package/package.json +2 -2
@@ -14,17 +14,19 @@ 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) 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();
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
+ }
28
30
  }
29
31
  }, _callee);
30
32
  }))();
@@ -39,30 +41,32 @@ export default {
39
41
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
40
42
  var components;
41
43
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
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();
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
+ }
66
70
  }
67
71
  }, _callee2);
68
72
  }))();
@@ -75,17 +79,19 @@ export default {
75
79
  handleAlarm: function handleAlarm(params) {
76
80
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
77
81
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
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();
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
+ }
89
95
  }
90
96
  }, _callee3);
91
97
  }))();
@@ -97,17 +103,19 @@ export default {
97
103
  getUserId: function getUserId() {
98
104
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
99
105
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
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();
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
+ }
111
119
  }
112
120
  }, _callee4);
113
121
  }))();
@@ -119,17 +127,19 @@ export default {
119
127
  getOverviewConfig: function getOverviewConfig(topoId, templateCode) {
120
128
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
121
129
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
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();
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
+ }
133
143
  }
134
144
  }, _callee5);
135
145
  }))();
@@ -141,17 +151,19 @@ export default {
141
151
  saveOverviewConfig: function saveOverviewConfig(topoId, templateCode, data) {
142
152
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
143
153
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
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();
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
+ }
155
167
  }
156
168
  }, _callee6);
157
169
  }))();
@@ -163,17 +175,19 @@ export default {
163
175
  getResMetricList: function getResMetricList(data) {
164
176
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
165
177
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
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();
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
+ }
177
191
  }
178
192
  }, _callee7);
179
193
  }))();
@@ -185,25 +199,27 @@ export default {
185
199
  getDeviceTypeList: function getDeviceTypeList() {
186
200
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
187
201
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
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();
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
+ }
207
223
  }
208
224
  }, _callee8);
209
225
  }))();
@@ -215,17 +231,19 @@ export default {
215
231
  getMetricList: function getMetricList(data) {
216
232
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
217
233
  return _regeneratorRuntime.wrap(function _callee9$(_context9) {
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();
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
+ }
229
247
  }
230
248
  }, _callee9);
231
249
  }))();
@@ -237,17 +255,19 @@ export default {
237
255
  commonQueryCiData: function commonQueryCiData(params) {
238
256
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
239
257
  return _regeneratorRuntime.wrap(function _callee10$(_context10) {
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();
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
+ }
251
271
  }
252
272
  }, _callee10);
253
273
  }))();
@@ -108,30 +108,32 @@ 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) 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();
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
+ }
135
137
  }
136
138
  }, _callee);
137
139
  }))();
@@ -146,19 +148,21 @@ export default {
146
148
  saveSerializeData: function saveSerializeData(id, data) {
147
149
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
148
150
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
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();
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
+ }
162
166
  }
163
167
  }, _callee2);
164
168
  }))();
@@ -9,18 +9,20 @@ 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) switch (_context.prev = _context.next) {
13
- case 0:
14
- _context.next = 2;
15
- return request.post('/topo/v1/api/attributes/metricByTemplateCode', mtCodes);
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);
16
17
 
17
- case 2:
18
- result = _context.sent;
19
- return _context.abrupt("return", result);
18
+ case 2:
19
+ result = _context.sent;
20
+ return _context.abrupt("return", result);
20
21
 
21
- case 4:
22
- case "end":
23
- return _context.stop();
22
+ case 4:
23
+ case "end":
24
+ return _context.stop();
25
+ }
24
26
  }
25
27
  }, _callee);
26
28
  }));
@@ -21,27 +21,29 @@ 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) switch (_context.prev = _context.next) {
25
- case 0:
26
- _context.next = 2;
27
- return queryAllModel();
24
+ while (1) {
25
+ switch (_context.prev = _context.next) {
26
+ case 0:
27
+ _context.next = 2;
28
+ return queryAllModel();
28
29
 
29
- case 2:
30
- modelTree = _context.sent;
31
- dicts = getAllCiTypes(modelTree);
30
+ case 2:
31
+ modelTree = _context.sent;
32
+ dicts = getAllCiTypes(modelTree);
32
33
 
33
- _this.update({
34
- typeDicts: dicts.map(function (item) {
35
- return _extends({}, item, {
36
- label: item.name,
37
- value: item.code
38
- });
39
- })
40
- });
34
+ _this.update({
35
+ typeDicts: dicts.map(function (item) {
36
+ return _extends({}, item, {
37
+ label: item.name,
38
+ value: item.code
39
+ });
40
+ })
41
+ });
41
42
 
42
- case 5:
43
- case "end":
44
- return _context.stop();
43
+ case 5:
44
+ case "end":
45
+ return _context.stop();
46
+ }
45
47
  }
46
48
  }, _callee);
47
49
  }))();
@@ -53,51 +55,53 @@ export default {
53
55
  var attrData, metricsData, code, _attrData$attributes, attributes, _metricsData$metrics, metrics, meta;
54
56
 
55
57
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
56
- while (1) switch (_context2.prev = _context2.next) {
57
- case 0:
58
- _this2.update({
59
- currentCi: {
60
- code: ciCode,
61
- meta: []
62
- }
63
- });
58
+ while (1) {
59
+ switch (_context2.prev = _context2.next) {
60
+ case 0:
61
+ _this2.update({
62
+ currentCi: {
63
+ code: ciCode,
64
+ meta: []
65
+ }
66
+ });
64
67
 
65
- _context2.next = 3;
66
- return getCi(ciCode);
68
+ _context2.next = 3;
69
+ return getCi(ciCode);
67
70
 
68
- case 3:
69
- attrData = _context2.sent;
70
- _context2.next = 6;
71
- return getCiMetric(ciCode);
71
+ case 3:
72
+ attrData = _context2.sent;
73
+ _context2.next = 6;
74
+ return getCiMetric(ciCode);
72
75
 
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
- }));
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
+ }));
90
93
 
91
- _this2.update({
92
- currentCi: {
93
- code: code,
94
- meta: meta
95
- }
96
- });
94
+ _this2.update({
95
+ currentCi: {
96
+ code: code,
97
+ meta: meta
98
+ }
99
+ });
97
100
 
98
- case 11:
99
- case "end":
100
- return _context2.stop();
101
+ case 11:
102
+ case "end":
103
+ return _context2.stop();
104
+ }
101
105
  }
102
106
  }, _callee2);
103
107
  }))();