@riil-frontend/component-topology 10.0.57 → 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 (227) 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/useCanvasTheme.js +1 -1
  34. package/es/core/hooks/usePolling.js +110 -122
  35. package/es/core/hooks/useResourceConfig.js +76 -100
  36. package/es/core/hooks/useTopoEdit.js +539 -638
  37. package/es/core/models/Alarm.js +311 -394
  38. package/es/core/models/AttributeMetricDisplay.js +115 -143
  39. package/es/core/models/PluginManager.js +4 -3
  40. package/es/core/models/SelectionModel.js +4 -5
  41. package/es/core/models/TopoApp.js +287 -454
  42. package/es/core/models/TopoGraphView.js +28 -41
  43. package/es/core/models/cache/CiCache.js +34 -39
  44. package/es/core/models/cache/CiTypeCache.js +70 -84
  45. package/es/core/models/cache/DictCache.js +36 -42
  46. package/es/core/models/graph/Background.js +21 -26
  47. package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
  48. package/es/core/models/tagstips/ElementTagTipConfig.js +34 -40
  49. package/es/core/models/topoData.js +73 -77
  50. package/es/core/models/utils/linkUtils.js +46 -51
  51. package/es/core/services/alarm.js +14 -16
  52. package/es/core/services/background.js +59 -67
  53. package/es/core/services/cmdb/metric.js +14 -18
  54. package/es/core/services/cmdb.js +23 -27
  55. package/es/core/services/index.js +48 -68
  56. package/es/core/services/overview.js +131 -151
  57. package/es/core/services/topo/basic.js +11 -13
  58. package/es/core/services/topo/tagtip.js +15 -19
  59. package/es/core/store/models/ciModel.js +58 -62
  60. package/es/core/store/models/customIcon.js +126 -145
  61. package/es/core/store/models/displayConfig.js +15 -19
  62. package/es/core/store/models/selection.js +4 -6
  63. package/es/core/store/models/topoAlarm.js +162 -145
  64. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  65. package/es/core/store/models/topoBizMod.js +28 -32
  66. package/es/core/store/models/topoConfig.js +217 -233
  67. package/es/core/store/models/topoGraphView.js +4 -6
  68. package/es/core/store/models/topoMod.js +379 -401
  69. package/es/core/utils/imageUtil.js +23 -27
  70. package/es/core/utils/saveSerialize.js +14 -18
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  79. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
  80. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
  81. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  82. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
  83. package/es/networkTopo/components/Link/hook.js +85 -96
  84. package/es/networkTopo/components/Link/index copy.js +104 -126
  85. package/es/networkTopo/components/Link/index.js +104 -126
  86. package/es/networkTopo/components/Link/setting.js +48 -52
  87. package/es/networkTopo/getTopoData.js +73 -92
  88. package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
  89. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  90. package/es/networkTopo/models/TopoCenter.js +28 -46
  91. package/es/networkTopo/services/alert.js +18 -22
  92. package/es/networkTopo/services/authorization.js +45 -55
  93. package/es/networkTopo/services/cmdb.js +548 -696
  94. package/es/networkTopo/services/funcAuth.js +22 -24
  95. package/es/networkTopo/services/link.js +107 -117
  96. package/es/networkTopo/services/mdc.js +33 -48
  97. package/es/networkTopo/services/metric.js +38 -47
  98. package/es/networkTopo/services/model.js +616 -809
  99. package/es/networkTopo/services/risk.js +9 -11
  100. package/es/networkTopo/services/topo/auth.js +27 -33
  101. package/es/networkTopo/services/topo/basic.js +274 -314
  102. package/es/networkTopo/services/topo/blacklist.js +20 -24
  103. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  104. package/es/networkTopo/services/topo/icon.js +49 -59
  105. package/es/networkTopo/services/topo/networkLink.js +32 -36
  106. package/es/networkTopo/services/topo/relation.js +9 -11
  107. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  108. package/es/networkTopo/store/functionAuth.js +31 -37
  109. package/es/networkTopo/store/linkDynamicStyle.js +102 -108
  110. package/es/networkTopo/store/linkDynamicStyleConfig.js +42 -44
  111. package/es/networkTopo/store/linkManager.js +4 -6
  112. package/es/networkTopo/store/topoCenter.js +142 -152
  113. package/es/networkTopo/store/topoLinkMod.js +4 -6
  114. package/es/networkTopo/store/topoTreeMod.js +170 -182
  115. package/es/networkTopo/utils/exportData.js +57 -61
  116. package/lib/components/IndexSettingDrawer/index.js +6 -5
  117. package/lib/components/MultiResourceDrawer/index.js +22 -26
  118. package/lib/components/ResourceList/ResourceSelect.js +54 -58
  119. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
  120. package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  121. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
  122. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +82 -104
  123. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  124. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -4
  125. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  126. package/lib/core/editor/components/BackgroundView/index.js +148 -177
  127. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
  128. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  129. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
  130. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
  131. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  132. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  133. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  134. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
  135. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
  136. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  137. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
  138. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
  139. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  140. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  141. package/lib/core/editor/store/background.js +8 -10
  142. package/lib/core/editor/store/topoEdit.js +4 -6
  143. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  144. package/lib/core/hooks/useCanvasTheme.js +1 -1
  145. package/lib/core/hooks/usePolling.js +108 -120
  146. package/lib/core/hooks/useResourceConfig.js +76 -100
  147. package/lib/core/hooks/useTopoEdit.js +530 -629
  148. package/lib/core/models/Alarm.js +308 -391
  149. package/lib/core/models/AttributeMetricDisplay.js +118 -146
  150. package/lib/core/models/PluginManager.js +4 -3
  151. package/lib/core/models/SelectionModel.js +4 -5
  152. package/lib/core/models/TopoApp.js +287 -454
  153. package/lib/core/models/TopoGraphView.js +28 -41
  154. package/lib/core/models/cache/CiCache.js +39 -44
  155. package/lib/core/models/cache/CiTypeCache.js +71 -85
  156. package/lib/core/models/cache/DictCache.js +39 -45
  157. package/lib/core/models/graph/Background.js +22 -27
  158. package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
  159. package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -40
  160. package/lib/core/models/topoData.js +73 -78
  161. package/lib/core/models/utils/linkUtils.js +45 -51
  162. package/lib/core/services/alarm.js +18 -20
  163. package/lib/core/services/background.js +70 -78
  164. package/lib/core/services/cmdb/metric.js +14 -19
  165. package/lib/core/services/cmdb.js +24 -29
  166. package/lib/core/services/index.js +53 -72
  167. package/lib/core/services/overview.js +131 -151
  168. package/lib/core/services/topo/basic.js +13 -15
  169. package/lib/core/services/topo/tagtip.js +16 -21
  170. package/lib/core/store/models/ciModel.js +66 -70
  171. package/lib/core/store/models/customIcon.js +126 -145
  172. package/lib/core/store/models/displayConfig.js +15 -19
  173. package/lib/core/store/models/selection.js +4 -6
  174. package/lib/core/store/models/topoAlarm.js +163 -145
  175. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  176. package/lib/core/store/models/topoBizMod.js +34 -38
  177. package/lib/core/store/models/topoConfig.js +224 -240
  178. package/lib/core/store/models/topoGraphView.js +4 -6
  179. package/lib/core/store/models/topoMod.js +381 -403
  180. package/lib/core/utils/imageUtil.js +26 -31
  181. package/lib/core/utils/saveSerialize.js +13 -18
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
  185. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
  186. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
  187. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
  188. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  189. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  190. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
  191. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
  192. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  193. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
  194. package/lib/networkTopo/components/Link/hook.js +86 -98
  195. package/lib/networkTopo/components/Link/index copy.js +105 -127
  196. package/lib/networkTopo/components/Link/index.js +105 -127
  197. package/lib/networkTopo/components/Link/setting.js +48 -52
  198. package/lib/networkTopo/getTopoData.js +73 -92
  199. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
  200. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  201. package/lib/networkTopo/models/TopoCenter.js +28 -46
  202. package/lib/networkTopo/services/alert.js +18 -22
  203. package/lib/networkTopo/services/authorization.js +55 -65
  204. package/lib/networkTopo/services/cmdb.js +551 -700
  205. package/lib/networkTopo/services/funcAuth.js +24 -26
  206. package/lib/networkTopo/services/link.js +108 -118
  207. package/lib/networkTopo/services/mdc.js +35 -51
  208. package/lib/networkTopo/services/metric.js +37 -47
  209. package/lib/networkTopo/services/model.js +615 -809
  210. package/lib/networkTopo/services/risk.js +11 -13
  211. package/lib/networkTopo/services/topo/auth.js +27 -33
  212. package/lib/networkTopo/services/topo/basic.js +277 -317
  213. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  214. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  215. package/lib/networkTopo/services/topo/icon.js +59 -69
  216. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  217. package/lib/networkTopo/services/topo/relation.js +11 -13
  218. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  219. package/lib/networkTopo/store/functionAuth.js +31 -37
  220. package/lib/networkTopo/store/linkDynamicStyle.js +103 -109
  221. package/lib/networkTopo/store/linkDynamicStyleConfig.js +42 -44
  222. package/lib/networkTopo/store/linkManager.js +4 -6
  223. package/lib/networkTopo/store/topoCenter.js +142 -152
  224. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  225. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  226. package/lib/networkTopo/utils/exportData.js +63 -68
  227. package/package.json +3 -3
@@ -63,7 +63,7 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Sy
63
63
 
64
64
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
65
65
 
66
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
66
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
67
67
 
68
68
  // url 处理,UICBB 的地址需截取前缀
69
69
  function formatUrl(url) {
@@ -83,7 +83,7 @@ function formatUrl(url) {
83
83
 
84
84
 
85
85
  function ResourceOverview(props) {
86
- var _viewerProps$resource, _data$attributes;
86
+ var _viewerProps$resource, _data$attributes, _ref, _getAddressFormat, _alarmRiskOperation, _baseInfoColChange, _getAttribute, _metricColChange;
87
87
 
88
88
  var topo = props.topo,
89
89
  id = props.id,
@@ -193,39 +193,33 @@ function ResourceOverview(props) {
193
193
  isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
194
194
  }
195
195
 
196
- var jump = /*#__PURE__*/function () {
197
- var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(roomLink, id) {
196
+ var jump = function jump(_x, _x2) {
197
+ return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(roomLink, id) {
198
198
  var power;
199
199
  return _regenerator["default"].wrap(function _callee$(_context) {
200
- while (1) {
201
- switch (_context.prev = _context.next) {
202
- case 0:
203
- onClose();
204
- _context.next = 3;
205
- return (0, _services.commonQueryCiData)(id);
206
-
207
- case 3:
208
- power = _context.sent;
209
-
210
- // console.log(power)
211
- if (power.data.length) {
212
- window.open("" + window.location.origin + roomLink);
213
- } else {
214
- _message["default"].error('无访问权限,请联系管理员');
215
- }
200
+ while (1) switch (_context.prev = _context.next) {
201
+ case 0:
202
+ onClose();
203
+ _context.next = 3;
204
+ return (0, _services.commonQueryCiData)(id);
205
+
206
+ case 3:
207
+ power = _context.sent;
208
+
209
+ // console.log(power)
210
+ if (power.data.length) {
211
+ window.open("" + window.location.origin + roomLink);
212
+ } else {
213
+ _message["default"].error('无访问权限,请联系管理员');
214
+ }
216
215
 
217
- case 5:
218
- case "end":
219
- return _context.stop();
220
- }
216
+ case 5:
217
+ case "end":
218
+ return _context.stop();
221
219
  }
222
220
  }, _callee);
223
- }));
224
-
225
- return function jump(_x, _x2) {
226
- return _ref.apply(this, arguments);
227
- };
228
- }(); // 基本信息可选项
221
+ }))).apply(this, arguments);
222
+ }; // 基本信息可选项
229
223
 
230
224
 
231
225
  var baseInfoCol = (0, _react.useMemo)(function () {
@@ -279,90 +273,78 @@ function ResourceOverview(props) {
279
273
  })) || [];
280
274
  }, [id, monitorMetricModels, initFlag]);
281
275
  (0, _react.useEffect)(function () {
276
+ var _getDevice;
277
+
282
278
  // 获取上架设备类型,判断资源是否是上架设备
283
279
  function getDevice() {
284
- return _getDevice.apply(this, arguments);
285
- }
286
-
287
- function _getDevice() {
288
- _getDevice = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
280
+ return (_getDevice = _getDevice || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
289
281
  var list;
290
282
  return _regenerator["default"].wrap(function _callee2$(_context2) {
291
- while (1) {
292
- switch (_context2.prev = _context2.next) {
293
- case 0:
294
- _context2.next = 2;
295
- return _overview["default"].getDeviceTypeList();
296
-
297
- case 2:
298
- list = _context2.sent;
299
- setIsDevice(list.some(function (item) {
300
- return item.code === ciType;
301
- })); // console.log('getDevice', ciType, list);
302
-
303
- case 4:
304
- case "end":
305
- return _context2.stop();
306
- }
283
+ while (1) switch (_context2.prev = _context2.next) {
284
+ case 0:
285
+ _context2.next = 2;
286
+ return _overview["default"].getDeviceTypeList();
287
+
288
+ case 2:
289
+ list = _context2.sent;
290
+ setIsDevice(list.some(function (item) {
291
+ return item.code === ciType;
292
+ })); // console.log('getDevice', ciType, list);
293
+
294
+ case 4:
295
+ case "end":
296
+ return _context2.stop();
307
297
  }
308
298
  }, _callee2);
309
- }));
310
- return _getDevice.apply(this, arguments);
299
+ }))).apply(this, arguments);
311
300
  }
312
301
 
313
302
  getDevice();
314
303
  }, [ciType]); // 获取地址信息:机房 机柜 起始U-结束U
315
304
 
316
305
  function getAddressFormat(_x3) {
317
- return _getAddressFormat.apply(this, arguments);
318
- } // 告警table列配置
319
-
320
-
321
- function _getAddressFormat() {
322
- _getAddressFormat = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(_ref2) {
306
+ return (_getAddressFormat = _getAddressFormat || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(_ref2) {
323
307
  var owned_computer_room, owned_cabinet, start_u_location, end_u_location, address, _res$find, _res$find$attributes, _res$find2, _res$find2$attributes, res, u;
324
308
 
325
309
  return _regenerator["default"].wrap(function _callee3$(_context3) {
326
- while (1) {
327
- switch (_context3.prev = _context3.next) {
328
- case 0:
329
- owned_computer_room = _ref2.owned_computer_room, owned_cabinet = _ref2.owned_cabinet, start_u_location = _ref2.start_u_location, end_u_location = _ref2.end_u_location;
330
- address = '';
310
+ while (1) switch (_context3.prev = _context3.next) {
311
+ case 0:
312
+ owned_computer_room = _ref2.owned_computer_room, owned_cabinet = _ref2.owned_cabinet, start_u_location = _ref2.start_u_location, end_u_location = _ref2.end_u_location;
313
+ address = '';
331
314
 
332
- if (!(owned_computer_room && owned_cabinet)) {
333
- _context3.next = 7;
334
- break;
335
- }
315
+ if (!(owned_computer_room && owned_cabinet)) {
316
+ _context3.next = 7;
317
+ break;
318
+ }
336
319
 
337
- _context3.next = 5;
338
- return (0, _services.queryCisByIds)([owned_computer_room, owned_cabinet]);
320
+ _context3.next = 5;
321
+ return (0, _services.queryCisByIds)([owned_computer_room, owned_cabinet]);
339
322
 
340
- case 5:
341
- res = _context3.sent;
342
- address = (((_res$find = res.find(function (item) {
343
- return item.id === owned_computer_room;
344
- })) === null || _res$find === void 0 ? void 0 : (_res$find$attributes = _res$find.attributes) === null || _res$find$attributes === void 0 ? void 0 : _res$find$attributes.display_name) || '') + " " + (((_res$find2 = res.find(function (item) {
345
- return item.id === owned_cabinet;
346
- })) === null || _res$find2 === void 0 ? void 0 : (_res$find2$attributes = _res$find2.attributes) === null || _res$find2$attributes === void 0 ? void 0 : _res$find2$attributes.display_name) || '');
323
+ case 5:
324
+ res = _context3.sent;
325
+ address = (((_res$find = res.find(function (item) {
326
+ return item.id === owned_computer_room;
327
+ })) === null || _res$find === void 0 ? void 0 : (_res$find$attributes = _res$find.attributes) === null || _res$find$attributes === void 0 ? void 0 : _res$find$attributes.display_name) || '') + " " + (((_res$find2 = res.find(function (item) {
328
+ return item.id === owned_cabinet;
329
+ })) === null || _res$find2 === void 0 ? void 0 : (_res$find2$attributes = _res$find2.attributes) === null || _res$find2$attributes === void 0 ? void 0 : _res$find2$attributes.display_name) || '');
347
330
 
348
- case 7:
349
- u = '';
331
+ case 7:
332
+ u = '';
350
333
 
351
- if (start_u_location || end_u_location) {
352
- u = (start_u_location || '') + "-" + (end_u_location || '');
353
- }
334
+ if (start_u_location || end_u_location) {
335
+ u = (start_u_location || '') + "-" + (end_u_location || '');
336
+ }
354
337
 
355
- return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
338
+ return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
356
339
 
357
- case 10:
358
- case "end":
359
- return _context3.stop();
360
- }
340
+ case 10:
341
+ case "end":
342
+ return _context3.stop();
361
343
  }
362
344
  }, _callee3);
363
- }));
364
- return _getAddressFormat.apply(this, arguments);
365
- }
345
+ }))).apply(this, arguments);
346
+ } // 告警table列配置
347
+
366
348
 
367
349
  var columns = [{
368
350
  title: '描述',
@@ -418,48 +400,41 @@ function ResourceOverview(props) {
418
400
  }]; // 告警/风险 操作 (受理)
419
401
 
420
402
  function alarmRiskOperation(_x4, _x5) {
421
- return _alarmRiskOperation.apply(this, arguments);
422
- }
423
-
424
- function _alarmRiskOperation() {
425
- _alarmRiskOperation = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(type, params) {
403
+ return (_alarmRiskOperation = _alarmRiskOperation || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(type, params) {
426
404
  var res;
427
405
  return _regenerator["default"].wrap(function _callee4$(_context4) {
428
- while (1) {
429
- switch (_context4.prev = _context4.next) {
430
- case 0:
431
- if (!(type === 'alarm')) {
432
- _context4.next = 6;
433
- break;
434
- }
406
+ while (1) switch (_context4.prev = _context4.next) {
407
+ case 0:
408
+ if (!(type === 'alarm')) {
409
+ _context4.next = 6;
410
+ break;
411
+ }
435
412
 
436
- _context4.next = 3;
437
- return _overview["default"].handleAlarm(params);
413
+ _context4.next = 3;
414
+ return _overview["default"].handleAlarm(params);
438
415
 
439
- case 3:
440
- res = _context4.sent;
416
+ case 3:
417
+ res = _context4.sent;
441
418
 
442
- _message["default"].success('受理成功');
419
+ _message["default"].success('受理成功');
443
420
 
444
- refreshAlarmData(id); // if (isAppTopo) {
445
- // const {
446
- // displayName: ciName,
447
- // attributeMap: modelAttributeMap,
448
- // domain,
449
- // } = topo.ciTyeCache.getCiType(ciType);
450
- // initAppTopo(monitorMetricModels, modelAttributeMap, ciName, domain);
451
- // } else {
452
- // getAlarmRiskData(id);
453
- // }
421
+ refreshAlarmData(id); // if (isAppTopo) {
422
+ // const {
423
+ // displayName: ciName,
424
+ // attributeMap: modelAttributeMap,
425
+ // domain,
426
+ // } = topo.ciTyeCache.getCiType(ciType);
427
+ // initAppTopo(monitorMetricModels, modelAttributeMap, ciName, domain);
428
+ // } else {
429
+ // getAlarmRiskData(id);
430
+ // }
454
431
 
455
- case 6:
456
- case "end":
457
- return _context4.stop();
458
- }
432
+ case 6:
433
+ case "end":
434
+ return _context4.stop();
459
435
  }
460
436
  }, _callee4);
461
- }));
462
- return _alarmRiskOperation.apply(this, arguments);
437
+ }))).apply(this, arguments);
463
438
  }
464
439
 
465
440
  var elementData = {
@@ -471,345 +446,324 @@ function ResourceOverview(props) {
471
446
  }; // 基本信息设置改变
472
447
 
473
448
  function baseInfoColChange(_x6) {
474
- return _baseInfoColChange.apply(this, arguments);
475
- } // 获取属性信息
449
+ return (_baseInfoColChange = _baseInfoColChange || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(col) {
450
+ var _col;
476
451
 
452
+ var infoData, attributeMap, _loop, _iterator, _step;
477
453
 
478
- function _baseInfoColChange() {
479
- _baseInfoColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(col) {
480
- var _col;
454
+ return _regenerator["default"].wrap(function _callee5$(_context6) {
455
+ while (1) switch (_context6.prev = _context6.next) {
456
+ case 0:
457
+ if ((_col = col) !== null && _col !== void 0 && _col.length) {
458
+ _context6.next = 3;
459
+ break;
460
+ }
481
461
 
482
- var infoData, attributeMap, _iterator, _step, item, value, contentTitle, _data, _ref3, _ref3$, _item, _attributeMap, object, _object, displayName, attr;
462
+ setBaseInfo([]);
463
+ return _context6.abrupt("return");
483
464
 
484
- return _regenerator["default"].wrap(function _callee6$(_context6) {
485
- while (1) {
486
- switch (_context6.prev = _context6.next) {
487
- case 0:
488
- if ((_col = col) !== null && _col !== void 0 && _col.length) {
489
- _context6.next = 3;
490
- break;
491
- }
465
+ case 3:
466
+ settBaseInfoInitLoading(true);
467
+ infoData = [];
468
+ _context6.next = 7;
469
+ return getAttribute(id);
492
470
 
493
- setBaseInfo([]);
494
- return _context6.abrupt("return");
471
+ case 7:
472
+ attributeMap = _context6.sent;
473
+ // console.log('getAttribute', attributeMap);
474
+ col = col.filter(function (item) {
475
+ return !item.hidden;
476
+ });
477
+ _loop = /*#__PURE__*/_regenerator["default"].mark(function _loop() {
478
+ var item, value, contentTitle, link, address, owned_computer_room, owned_cabinet, roomLink, node, data, _ref3, _ref3$, _item, _attributeMap, object, _object2, displayName, attr;
479
+
480
+ return _regenerator["default"].wrap(function _loop$(_context5) {
481
+ while (1) switch (_context5.prev = _context5.next) {
482
+ case 0:
483
+ item = _step.value;
484
+ value = (0, _attributeFormatter.formatMetric)(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
485
+ contentTitle = value;
486
+ _context5.t0 = item.dataIndex;
487
+ _context5.next = _context5.t0 === 'display_name' ? 6 : _context5.t0 === 'ciName' ? 9 : _context5.t0 === 'res_address' ? 12 : _context5.t0 === 'imageName' ? 19 : 23;
488
+ break;
489
+
490
+ case 6:
491
+ // 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
492
+ if (attributeMap.support_templates) {
493
+ link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
494
+
495
+ value = /*#__PURE__*/_react["default"].createElement("span", {
496
+ onClick: onClose
497
+ }, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
498
+ className: _indexModule["default"].link,
499
+ disabled: true,
500
+ title: attributeMap.display_name || '',
501
+ to: formatUrl(link)
502
+ }, attributeMap.display_name || '-'));
503
+ } else {
504
+ value = attributeMap.display_name || '-';
505
+ }
495
506
 
496
- case 3:
497
- settBaseInfoInitLoading(true);
498
- infoData = [];
499
- _context6.next = 7;
500
- return getAttribute(id);
507
+ contentTitle = attributeMap.display_name || '-';
508
+ return _context5.abrupt("break", 24);
501
509
 
502
- case 7:
503
- attributeMap = _context6.sent;
504
- // console.log('getAttribute', attributeMap);
505
- col = col.filter(function (item) {
506
- return !item.hidden;
507
- });
508
- _iterator = _createForOfIteratorHelperLoose(col);
510
+ case 9:
511
+ value = ciTypeMeta.displayName;
512
+ contentTitle = value;
513
+ return _context5.abrupt("break", 24);
509
514
 
510
- case 10:
511
- if ((_step = _iterator()).done) {
512
- _context6.next = 26;
513
- break;
514
- }
515
+ case 12:
516
+ _context5.next = 14;
517
+ return getAddressFormat(attributeMap);
515
518
 
516
- item = _step.value;
517
- value = (0, _attributeFormatter.formatMetric)(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
518
- contentTitle = value;
519
- return _context6.delegateYield( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
520
- var link, address, owned_computer_room, owned_cabinet, roomLink, node;
521
- return _regenerator["default"].wrap(function _callee5$(_context5) {
522
- while (1) {
523
- switch (_context5.prev = _context5.next) {
524
- case 0:
525
- _context5.t0 = item.dataIndex;
526
- _context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
527
- break;
528
-
529
- case 3:
530
- // 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
531
- if (attributeMap.support_templates) {
532
- link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
533
-
534
- value = /*#__PURE__*/_react["default"].createElement("span", {
535
- onClick: onClose
536
- }, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
537
- className: _indexModule["default"].link,
538
- disabled: true,
539
- title: attributeMap.display_name || '',
540
- to: formatUrl(link)
541
- }, attributeMap.display_name || '-'));
542
- } else {
543
- value = attributeMap.display_name || '-';
544
- }
519
+ case 14:
520
+ address = _context5.sent;
521
+ owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
545
522
 
546
- contentTitle = attributeMap.display_name || '-';
547
- return _context5.abrupt("break", 21);
548
-
549
- case 6:
550
- value = ciTypeMeta.displayName;
551
- contentTitle = value;
552
- return _context5.abrupt("break", 21);
553
-
554
- case 9:
555
- _context5.next = 11;
556
- return getAddressFormat(attributeMap);
557
-
558
- case 11:
559
- address = _context5.sent;
560
- owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
561
-
562
- if (owned_computer_room && owned_cabinet) {
563
- // /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
564
- roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
565
- value = /*#__PURE__*/_react["default"].createElement("span", {
566
- onClick: function onClick() {
567
- jump(roomLink, owned_computer_room);
568
- }
569
- }, /*#__PURE__*/_react["default"].createElement("span", {
570
- className: _indexModule["default"].link,
571
- title: address
572
- }, address));
573
- } else {
574
- value = address;
523
+ if (owned_computer_room && owned_cabinet) {
524
+ // /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
525
+ roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
526
+ value = /*#__PURE__*/_react["default"].createElement("span", {
527
+ onClick: function onClick() {
528
+ jump(roomLink, owned_computer_room);
575
529
  }
530
+ }, /*#__PURE__*/_react["default"].createElement("span", {
531
+ className: _indexModule["default"].link,
532
+ title: address
533
+ }, address));
534
+ } else {
535
+ value = address;
536
+ }
576
537
 
577
- contentTitle = address;
578
- return _context5.abrupt("break", 21);
538
+ contentTitle = address;
539
+ return _context5.abrupt("break", 24);
579
540
 
580
- case 16:
581
- node = topo.getDataModel().getDataByTag(id);
582
- value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
583
- contentTitle = value;
584
- return _context5.abrupt("break", 21);
541
+ case 19:
542
+ node = topo.getDataModel().getDataByTag(id);
543
+ value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
544
+ contentTitle = value;
545
+ return _context5.abrupt("break", 24);
585
546
 
586
- case 20:
587
- return _context5.abrupt("break", 21);
547
+ case 23:
548
+ return _context5.abrupt("break", 24);
588
549
 
589
- case 21:
590
- case "end":
591
- return _context5.stop();
550
+ case 24:
551
+ // 拿翻译字段属性数据
552
+ if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
553
+ value = attributeMap[item.dataIndex + ".name"];
554
+ contentTitle = value;
592
555
  }
593
- }
594
- }, _callee5);
595
- })(), "t0", 15);
596
-
597
- case 15:
598
- // 拿翻译字段属性数据
599
- if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
600
- value = attributeMap[item.dataIndex + ".name"];
601
- contentTitle = value;
602
- }
603
556
 
604
- _data = topo.attributeMetricDisplay.getData() || [];
605
- _ref3 = [].concat(_data.filter(function (m) {
606
- return m.id === id;
607
- })), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
608
- _attributeMap = _item.attributeMap || {};
609
- object = _attributeMap[item.dataIndex + "_object"] || {};
610
-
611
- if (!attributeMap[item.dataIndex + ".name"] && JSON.stringify(object) !== '{}') {
612
- _object = (0, _extends2["default"])({}, object), displayName = _object.displayName;
613
- value = displayName || _attributeMap["" + item.dataIndex];
614
- contentTitle = value;
615
- }
557
+ data = topo.attributeMetricDisplay.getData() || [];
558
+ _ref3 = [].concat(data.filter(function (m) {
559
+ return m.id === id;
560
+ })), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
561
+ _attributeMap = _item.attributeMap || {};
562
+ object = _attributeMap[item.dataIndex + "_object"] || {};
563
+
564
+ if (!attributeMap[item.dataIndex + ".name"] && JSON.stringify(object) !== '{}') {
565
+ _object2 = (0, _extends2["default"])({}, object), displayName = _object2.displayName;
566
+ value = displayName || _attributeMap["" + item.dataIndex];
567
+ contentTitle = value;
568
+ }
616
569
 
617
- if (item.dataIndex === 'ipv6_address') {
618
- value = _attributeMap["" + item.dataIndex];
619
- contentTitle = value;
620
- }
570
+ if (item.dataIndex === 'ipv6_address') {
571
+ value = _attributeMap["" + item.dataIndex];
572
+ contentTitle = value;
573
+ }
621
574
 
622
- if (isAppTopo && (item.dataIndex === 'source_type' || item.dataIndex === 'destination_type')) {
623
- attr = topo.ciTyeCache.getCiType(attributeMap["" + item.dataIndex]) || {};
624
- value = attr.displayName || attributeMap["" + item.dataIndex];
625
- contentTitle = value;
626
- }
575
+ if (isAppTopo && (item.dataIndex === 'source_type' || item.dataIndex === 'destination_type')) {
576
+ attr = topo.ciTyeCache.getCiType(attributeMap["" + item.dataIndex]) || {};
577
+ value = attr.displayName || attributeMap["" + item.dataIndex];
578
+ contentTitle = value;
579
+ }
627
580
 
628
- infoData.push((0, _extends2["default"])({}, item, {
629
- value: value,
630
- contentTitle: contentTitle
631
- }));
581
+ infoData.push((0, _extends2["default"])({}, item, {
582
+ value: value,
583
+ contentTitle: contentTitle
584
+ }));
632
585
 
633
- case 24:
634
- _context6.next = 10;
586
+ case 33:
587
+ case "end":
588
+ return _context5.stop();
589
+ }
590
+ }, _loop);
591
+ });
592
+ _iterator = _createForOfIteratorHelperLoose(col);
593
+
594
+ case 11:
595
+ if ((_step = _iterator()).done) {
596
+ _context6.next = 15;
635
597
  break;
598
+ }
636
599
 
637
- case 26:
638
- settBaseInfoInitLoading(false);
639
- setBaseInfo(infoData);
600
+ return _context6.delegateYield(_loop(), "t0", 13);
640
601
 
641
- case 28:
642
- case "end":
643
- return _context6.stop();
644
- }
645
- }
646
- }, _callee6);
647
- }));
648
- return _baseInfoColChange.apply(this, arguments);
649
- }
602
+ case 13:
603
+ _context6.next = 11;
604
+ break;
650
605
 
651
- function getAttribute(_x7) {
652
- return _getAttribute.apply(this, arguments);
653
- } // 指标设置改变
606
+ case 15:
607
+ settBaseInfoInitLoading(false);
608
+ setBaseInfo(infoData);
654
609
 
610
+ case 17:
611
+ case "end":
612
+ return _context6.stop();
613
+ }
614
+ }, _callee5);
615
+ }))).apply(this, arguments);
616
+ } // 获取属性信息
655
617
 
656
- function _getAttribute() {
657
- _getAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id) {
658
- var _yield$resourceOvervi, baseInfos, res, _ref4, attributes;
659
618
 
660
- return _regenerator["default"].wrap(function _callee7$(_context7) {
661
- while (1) {
662
- switch (_context7.prev = _context7.next) {
663
- case 0:
664
- if (id) {
665
- _context7.next = 2;
666
- break;
667
- }
619
+ function getAttribute(_x7) {
620
+ return (_getAttribute = _getAttribute || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(id) {
621
+ var _yield$resourceOvervi2, baseInfos, res, _ref4, attributes;
622
+
623
+ return _regenerator["default"].wrap(function _callee6$(_context7) {
624
+ while (1) switch (_context7.prev = _context7.next) {
625
+ case 0:
626
+ if (id) {
627
+ _context7.next = 2;
628
+ break;
629
+ }
668
630
 
669
- return _context7.abrupt("return");
631
+ return _context7.abrupt("return");
670
632
 
671
- case 2:
672
- if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
673
- _context7.next = 9;
674
- break;
675
- }
633
+ case 2:
634
+ if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
635
+ _context7.next = 9;
636
+ break;
637
+ }
676
638
 
677
- _context7.next = 5;
678
- return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
679
- id: id
680
- });
639
+ _context7.next = 5;
640
+ return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
641
+ id: id
642
+ });
681
643
 
682
- case 5:
683
- _yield$resourceOvervi = _context7.sent;
684
- baseInfos = _yield$resourceOvervi.baseInfos;
644
+ case 5:
645
+ _yield$resourceOvervi2 = _context7.sent;
646
+ baseInfos = _yield$resourceOvervi2.baseInfos;
685
647
 
686
- if (!baseInfos) {
687
- _context7.next = 9;
688
- break;
689
- }
648
+ if (!baseInfos) {
649
+ _context7.next = 9;
650
+ break;
651
+ }
690
652
 
691
- return _context7.abrupt("return", baseInfos);
692
-
693
- case 9:
694
- _context7.next = 11;
695
- return _overview["default"].commonQueryCiData({
696
- condition: "id('" + id + "')",
697
- refAttribute: true,
698
- orders: [{
699
- name: 'CREATED_TIME',
700
- type: 'asc'
701
- }],
702
- pageIndex: 1,
703
- pageSize: 10
704
- });
653
+ return _context7.abrupt("return", baseInfos);
654
+
655
+ case 9:
656
+ _context7.next = 11;
657
+ return _overview["default"].commonQueryCiData({
658
+ condition: "id('" + id + "')",
659
+ refAttribute: true,
660
+ orders: [{
661
+ name: 'CREATED_TIME',
662
+ type: 'asc'
663
+ }],
664
+ pageIndex: 1,
665
+ pageSize: 10
666
+ });
705
667
 
706
- case 11:
707
- res = _context7.sent;
708
- _ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
709
- return _context7.abrupt("return", attributes || {});
668
+ case 11:
669
+ res = _context7.sent;
670
+ _ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
671
+ return _context7.abrupt("return", attributes || {});
710
672
 
711
- case 14:
712
- case "end":
713
- return _context7.stop();
714
- }
673
+ case 14:
674
+ case "end":
675
+ return _context7.stop();
715
676
  }
716
- }, _callee7);
717
- }));
718
- return _getAttribute.apply(this, arguments);
719
- }
677
+ }, _callee6);
678
+ }))).apply(this, arguments);
679
+ } // 指标设置改变
720
680
 
721
- function metricColChange(_x8) {
722
- return _metricColChange.apply(this, arguments);
723
- }
724
681
 
725
- function _metricColChange() {
726
- _metricColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(col) {
682
+ function metricColChange(_x8) {
683
+ return (_metricColChange = _metricColChange || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(col) {
727
684
  var _col2, _col3;
728
685
 
729
- var codes, endTime, params, _ref5, times, metricList, metricLists;
686
+ var codes, endTime, params, _ref6, times, metricList, metricLists;
730
687
 
731
- return _regenerator["default"].wrap(function _callee8$(_context8) {
732
- while (1) {
733
- switch (_context8.prev = _context8.next) {
734
- case 0:
735
- // console.log('metricColChange col', col);
736
- col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
737
- return !item.hidden;
738
- });
688
+ return _regenerator["default"].wrap(function _callee7$(_context8) {
689
+ while (1) switch (_context8.prev = _context8.next) {
690
+ case 0:
691
+ // console.log('metricColChange col', col);
692
+ col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
693
+ return !item.hidden;
694
+ });
695
+
696
+ if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
697
+ _context8.next = 4;
698
+ break;
699
+ }
700
+
701
+ setMetric([]); // Message.error('指标未设置')
702
+
703
+ return _context8.abrupt("return");
739
704
 
740
- if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
741
- _context8.next = 4;
742
- break;
705
+ case 4:
706
+ codes = col.map(function (item) {
707
+ return item.dataIndex;
708
+ });
709
+ endTime = Math.floor(new Date().getTime() / 1000);
710
+ params = {
711
+ ciIds: [id],
712
+ subIds: [id],
713
+ startTime: endTime - 60 * 60,
714
+ endTime: endTime,
715
+ codes: codes
716
+ };
717
+
718
+ if (isAppTopo) {
719
+ _ref6 = resourceOverviewProps.metricProps || {}, times = _ref6.times;
720
+
721
+ if (times !== null && times !== void 0 && times.length) {
722
+ params.startTime = times[0];
723
+ params.endTime = times[1];
743
724
  }
725
+ }
744
726
 
745
- setMetric([]); // Message.error('指标未设置')
727
+ setMetricInitLoading(true);
728
+ _context8.next = 11;
729
+ return _overview["default"].getMetricList(params);
746
730
 
747
- return _context8.abrupt("return");
731
+ case 11:
732
+ metricList = _context8.sent;
733
+ metricLists = metricList.concat(getNewMetricList());
748
734
 
749
- case 4:
750
- codes = col.map(function (item) {
751
- return item.dataIndex;
752
- });
753
- endTime = Math.floor(new Date().getTime() / 1000);
754
- params = {
755
- ciIds: [id],
756
- subIds: [id],
735
+ _rlog.rlog.debug('metricColChange', metricLists, monitorMetricModels);
736
+
737
+ setMetric(col.map(function (item, key) {
738
+ return {
739
+ code: item.dataIndex,
740
+ chartIndex: key,
757
741
  startTime: endTime - 60 * 60,
758
742
  endTime: endTime,
759
- codes: codes
743
+ metricItem: monitorMetricModels.find(function (m_item) {
744
+ return m_item.code === item.dataIndex;
745
+ }),
746
+ list: metricLists.filter(function (m_item) {
747
+ return m_item.metricCode === item.dataIndex;
748
+ })
760
749
  };
750
+ }));
751
+ setMetricInitLoading(false);
752
+
753
+ if (!isAppTopo) {
754
+ // 一分钟更新一次指标信息 metricTimer
755
+ window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
756
+ window.topo_overview_metric_timer = setInterval(function () {
757
+ metricColChange(col);
758
+ }, 60000);
759
+ }
761
760
 
762
- if (isAppTopo) {
763
- _ref5 = resourceOverviewProps.metricProps || {}, times = _ref5.times;
764
-
765
- if (times !== null && times !== void 0 && times.length) {
766
- params.startTime = times[0];
767
- params.endTime = times[1];
768
- }
769
- }
770
-
771
- setMetricInitLoading(true);
772
- _context8.next = 11;
773
- return _overview["default"].getMetricList(params);
774
-
775
- case 11:
776
- metricList = _context8.sent;
777
- metricLists = metricList.concat(getNewMetricList());
778
-
779
- _rlog.rlog.debug('metricColChange', metricLists, monitorMetricModels);
780
-
781
- setMetric(col.map(function (item, key) {
782
- return {
783
- code: item.dataIndex,
784
- chartIndex: key,
785
- startTime: endTime - 60 * 60,
786
- endTime: endTime,
787
- metricItem: monitorMetricModels.find(function (m_item) {
788
- return m_item.code === item.dataIndex;
789
- }),
790
- list: metricLists.filter(function (m_item) {
791
- return m_item.metricCode === item.dataIndex;
792
- })
793
- };
794
- }));
795
- setMetricInitLoading(false);
796
-
797
- if (!isAppTopo) {
798
- // 一分钟更新一次指标信息 metricTimer
799
- window.topo_overview_metric_timer && clearInterval(window.topo_overview_metric_timer);
800
- window.topo_overview_metric_timer = setInterval(function () {
801
- metricColChange(col);
802
- }, 60000);
803
- }
804
-
805
- case 17:
806
- case "end":
807
- return _context8.stop();
808
- }
761
+ case 17:
762
+ case "end":
763
+ return _context8.stop();
809
764
  }
810
- }, _callee8);
811
- }));
812
- return _metricColChange.apply(this, arguments);
765
+ }, _callee7);
766
+ }))).apply(this, arguments);
813
767
  }
814
768
 
815
769
  var getNewMetricList = function getNewMetricList() {