@riil-frontend/component-topology 11.0.35 → 11.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.js +37 -29
  4. package/es/components/MultiResourceDrawer/index.js +8 -6
  5. package/es/components/ResourceList/ResourceSelect.js +8 -7
  6. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
  7. package/es/components/SingleResourceDrawer/SelectDrawer.js +8 -6
  8. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
  9. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
  10. package/es/core/editor/components/BackgroundView/index.js +73 -54
  11. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
  12. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -5
  13. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
  14. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
  15. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
  16. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
  17. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
  18. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
  19. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
  20. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
  21. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
  22. package/es/core/hooks/usePolling.js +21 -13
  23. package/es/core/hooks/useResourceConfig.js +37 -21
  24. package/es/core/hooks/useTopoEdit.js +202 -139
  25. package/es/core/models/Alarm.js +104 -38
  26. package/es/core/models/AttributeMetricDisplay.js +36 -14
  27. package/es/core/models/TopoApp.js +197 -75
  28. package/es/core/models/TopoGraphView.js +20 -10
  29. package/es/core/models/cache/CiCache.js +12 -6
  30. package/es/core/models/cache/CiTypeCache.js +20 -10
  31. package/es/core/models/cache/DictCache.js +10 -6
  32. package/es/core/models/graph/Background.js +9 -6
  33. package/es/core/models/plugins/resourceWebControllUrl.js +21 -8
  34. package/es/core/models/tagstips/ElementTagTipConfig.js +20 -10
  35. package/es/core/models/topoData.js +7 -5
  36. package/es/core/models/utils/linkUtils.js +8 -5
  37. package/es/core/services/cmdb/metric.js +7 -5
  38. package/es/core/services/cmdb.js +7 -5
  39. package/es/core/services/index.js +23 -9
  40. package/es/core/services/topo/tagtip.js +7 -5
  41. package/es/core/store/models/customIcon.js +11 -6
  42. package/es/core/utils/edgeUtil.js +2 -1
  43. package/es/core/utils/imageUtil.js +7 -5
  44. package/es/core/utils/saveSerialize.js +7 -5
  45. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
  46. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +8 -5
  47. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
  48. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +47 -34
  49. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
  50. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +74 -34
  51. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
  52. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
  53. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -26
  54. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +15 -7
  55. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
  56. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
  57. package/es/networkTopo/components/Link/hook.js +21 -14
  58. package/es/networkTopo/components/Link/index.js +32 -18
  59. package/es/networkTopo/components/Link/setting.js +8 -6
  60. package/es/networkTopo/getTopoData.js +23 -10
  61. package/es/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
  62. package/es/networkTopo/models/TopoCenter.js +24 -10
  63. package/es/networkTopo/services/cmdb.js +333 -233
  64. package/es/networkTopo/services/mdc.js +24 -15
  65. package/es/networkTopo/services/metric.js +16 -11
  66. package/es/networkTopo/services/model.js +412 -283
  67. package/es/networkTopo/utils/exportData.js +7 -5
  68. package/lib/components/MultiResourceDrawer/index.js +8 -6
  69. package/lib/components/ResourceList/ResourceSelect.js +8 -6
  70. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
  71. package/lib/components/SingleResourceDrawer/SelectDrawer.js +8 -6
  72. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
  73. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
  74. package/lib/core/editor/components/BackgroundView/index.js +74 -55
  75. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
  76. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -4
  77. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
  78. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
  79. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
  80. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
  81. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
  82. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
  83. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
  84. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
  85. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
  86. package/lib/core/hooks/usePolling.js +21 -13
  87. package/lib/core/hooks/useResourceConfig.js +37 -21
  88. package/lib/core/hooks/useTopoEdit.js +202 -139
  89. package/lib/core/models/Alarm.js +104 -38
  90. package/lib/core/models/AttributeMetricDisplay.js +36 -14
  91. package/lib/core/models/TopoApp.js +197 -75
  92. package/lib/core/models/TopoGraphView.js +20 -10
  93. package/lib/core/models/cache/CiCache.js +12 -6
  94. package/lib/core/models/cache/CiTypeCache.js +20 -10
  95. package/lib/core/models/cache/DictCache.js +10 -6
  96. package/lib/core/models/graph/Background.js +9 -6
  97. package/lib/core/models/plugins/resourceWebControllUrl.js +21 -8
  98. package/lib/core/models/tagstips/ElementTagTipConfig.js +20 -10
  99. package/lib/core/models/topoData.js +7 -4
  100. package/lib/core/models/utils/linkUtils.js +8 -4
  101. package/lib/core/services/cmdb/metric.js +7 -4
  102. package/lib/core/services/cmdb.js +7 -4
  103. package/lib/core/services/index.js +21 -8
  104. package/lib/core/services/topo/tagtip.js +7 -4
  105. package/lib/core/store/models/customIcon.js +11 -6
  106. package/lib/core/utils/edgeUtil.js +2 -1
  107. package/lib/core/utils/imageUtil.js +7 -4
  108. package/lib/core/utils/saveSerialize.js +7 -4
  109. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
  110. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +9 -6
  111. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
  112. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +49 -36
  113. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
  114. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +73 -35
  115. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
  116. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
  117. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -25
  118. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +14 -6
  119. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
  120. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
  121. package/lib/networkTopo/components/Link/hook.js +23 -15
  122. package/lib/networkTopo/components/Link/index.js +32 -18
  123. package/lib/networkTopo/components/Link/setting.js +8 -6
  124. package/lib/networkTopo/getTopoData.js +23 -10
  125. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
  126. package/lib/networkTopo/models/TopoCenter.js +24 -10
  127. package/lib/networkTopo/services/cmdb.js +336 -235
  128. package/lib/networkTopo/services/mdc.js +24 -14
  129. package/lib/networkTopo/services/metric.js +16 -10
  130. package/lib/networkTopo/services/model.js +414 -284
  131. package/lib/networkTopo/utils/exportData.js +7 -4
  132. package/lib/utils/htElementDataUtil.js +4 -2
  133. package/package.json +2 -2
@@ -7,8 +7,6 @@ import ColorPanel from "../../../../../../components/ColorPanel";
7
7
  import FontColorRange from "../../../../../../components/ColorPanel/components/FontColorRange";
8
8
 
9
9
  function BoxBackgroundSetting(props) {
10
- var _ref, _ref2;
11
-
12
10
  var topo = props.topo,
13
11
  fieldProps = props.fieldProps,
14
12
  setStyle = props.setStyle,
@@ -36,8 +34,8 @@ function BoxBackgroundSetting(props) {
36
34
  topo.historyManager.endTransaction();
37
35
  };
38
36
 
39
- var backgroundChang = function backgroundChang(_x, _x2) {
40
- return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value, type) {
37
+ var backgroundChang = /*#__PURE__*/function () {
38
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value, type) {
41
39
  return _regeneratorRuntime.wrap(function _callee$(_context) {
42
40
  while (1) switch (_context.prev = _context.next) {
43
41
  case 0:
@@ -67,8 +65,12 @@ function BoxBackgroundSetting(props) {
67
65
  return _context.stop();
68
66
  }
69
67
  }, _callee);
70
- }))).apply(this, arguments);
71
- };
68
+ }));
69
+
70
+ return function backgroundChang(_x, _x2) {
71
+ return _ref.apply(this, arguments);
72
+ };
73
+ }();
72
74
 
73
75
  var borderOpacityChange = function borderOpacityChange(value) {
74
76
  topo.historyManager.beginTransaction();
@@ -86,8 +88,8 @@ function BoxBackgroundSetting(props) {
86
88
  topo.historyManager.endTransaction();
87
89
  };
88
90
 
89
- var borderColorChang = function borderColorChang(_x3, _x4) {
90
- return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value, type) {
91
+ var borderColorChang = /*#__PURE__*/function () {
92
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value, type) {
91
93
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
92
94
  while (1) switch (_context2.prev = _context2.next) {
93
95
  case 0:
@@ -117,8 +119,12 @@ function BoxBackgroundSetting(props) {
117
119
  return _context2.stop();
118
120
  }
119
121
  }, _callee2);
120
- }))).apply(this, arguments);
121
- };
122
+ }));
123
+
124
+ return function borderColorChang(_x3, _x4) {
125
+ return _ref2.apply(this, arguments);
126
+ };
127
+ }();
122
128
 
123
129
  var leftInputChange = function leftInputChange(val) {
124
130
  setLeftInputVal(val);
@@ -11,8 +11,6 @@ import styles from "./FontColorButton.module.scss";
11
11
  import textStyleSettingRouter from "./components/textStyleSetting/textStyleSettingRouter.js";
12
12
 
13
13
  function FontColorDropdown(props) {
14
- var _ref, _ref2;
15
-
16
14
  var color = props.color,
17
15
  onChange = props.onChange,
18
16
  topo = props.topo,
@@ -37,8 +35,8 @@ function FontColorDropdown(props) {
37
35
  topo.historyManager.endTransaction();
38
36
  };
39
37
 
40
- var colorChang = function colorChang(_x, _x2) {
41
- return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value, type) {
38
+ var colorChang = /*#__PURE__*/function () {
39
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value, type) {
42
40
  return _regeneratorRuntime.wrap(function _callee$(_context) {
43
41
  while (1) switch (_context.prev = _context.next) {
44
42
  case 0:
@@ -68,11 +66,15 @@ function FontColorDropdown(props) {
68
66
  return _context.stop();
69
67
  }
70
68
  }, _callee);
71
- }))).apply(this, arguments);
72
- };
69
+ }));
70
+
71
+ return function colorChang(_x, _x2) {
72
+ return _ref.apply(this, arguments);
73
+ };
74
+ }();
73
75
 
74
- var backgroundChang = function backgroundChang(_x3, _x4) {
75
- return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value, type) {
76
+ var backgroundChang = /*#__PURE__*/function () {
77
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value, type) {
76
78
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
77
79
  while (1) switch (_context2.prev = _context2.next) {
78
80
  case 0:
@@ -102,8 +104,12 @@ function FontColorDropdown(props) {
102
104
  return _context2.stop();
103
105
  }
104
106
  }, _callee2);
105
- }))).apply(this, arguments);
106
- };
107
+ }));
108
+
109
+ return function backgroundChang(_x3, _x4) {
110
+ return _ref2.apply(this, arguments);
111
+ };
112
+ }();
107
113
 
108
114
  var onFocus = function onFocus() {// topo.historyManager.beginTransaction();
109
115
  };
@@ -4,16 +4,14 @@ import React, { useState, useEffect } from 'react';
4
4
  import ResourceSelectDrawer from "../../../../../../../components/NetworkTopoResourceSelectDrawer";
5
5
 
6
6
  var LayerAddResourceDrawer = function LayerAddResourceDrawer(props) {
7
- var _ref;
8
-
9
7
  var visible = props.visible,
10
8
  layer = props.layer,
11
9
  topo = props.topo,
12
10
  topoEdit = props.topoEdit,
13
11
  onClose = props.onClose;
14
12
 
15
- var onOk = function onOk(_x) {
16
- return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
13
+ var onOk = /*#__PURE__*/function () {
14
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
17
15
  var layerData;
18
16
  return _regeneratorRuntime.wrap(function _callee$(_context) {
19
17
  while (1) switch (_context.prev = _context.next) {
@@ -30,8 +28,12 @@ var LayerAddResourceDrawer = function LayerAddResourceDrawer(props) {
30
28
  return _context.stop();
31
29
  }
32
30
  }, _callee);
33
- }))).apply(this, arguments);
34
- };
31
+ }));
32
+
33
+ return function onOk(_x) {
34
+ return _ref.apply(this, arguments);
35
+ };
36
+ }();
35
37
 
36
38
  return /*#__PURE__*/React.createElement(ResourceSelectDrawer, {
37
39
  visible: visible,
@@ -11,16 +11,14 @@ import ResourceSelectDrawer from "../../../../../../../components/NetworkTopoRes
11
11
  */
12
12
 
13
13
  var BindResourceDrawer = function BindResourceDrawer(props) {
14
- var _ref;
15
-
16
14
  var visible = props.visible,
17
15
  topoEditApi = props.topoEditApi,
18
16
  node = props.node,
19
17
  currentResId = props.currentResId,
20
18
  onClose = props.onClose;
21
19
 
22
- var handleSave = function handleSave(_x) {
23
- return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
20
+ var handleSave = /*#__PURE__*/function () {
21
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
24
22
  var result;
25
23
  return _regeneratorRuntime.wrap(function _callee$(_context) {
26
24
  while (1) switch (_context.prev = _context.next) {
@@ -51,8 +49,12 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
51
49
  return _context.stop();
52
50
  }
53
51
  }, _callee);
54
- }))).apply(this, arguments);
55
- };
52
+ }));
53
+
54
+ return function handleSave(_x) {
55
+ return _ref.apply(this, arguments);
56
+ };
57
+ }();
56
58
 
57
59
  return /*#__PURE__*/React.createElement(ResourceSelectDrawer, {
58
60
  visible: visible,
@@ -34,8 +34,6 @@ function getBindType(values) {
34
34
  }
35
35
 
36
36
  export default function Data(props) {
37
- var _ref;
38
-
39
37
  var node = props.node,
40
38
  topo = props.topo,
41
39
  topoEditApi = props.topoEditApi,
@@ -74,8 +72,8 @@ export default function Data(props) {
74
72
  }
75
73
  };
76
74
 
77
- var handleBindTopoChange = function handleBindTopoChange(_x, _x2) {
78
- return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value, data) {
75
+ var handleBindTopoChange = /*#__PURE__*/function () {
76
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(value, data) {
79
77
  return _regeneratorRuntime.wrap(function _callee$(_context) {
80
78
  while (1) switch (_context.prev = _context.next) {
81
79
  case 0:
@@ -94,8 +92,12 @@ export default function Data(props) {
94
92
  return _context.stop();
95
93
  }
96
94
  }, _callee);
97
- }))).apply(this, arguments);
98
- };
95
+ }));
96
+
97
+ return function handleBindTopoChange(_x, _x2) {
98
+ return _ref.apply(this, arguments);
99
+ };
100
+ }();
99
101
 
100
102
  var RelateTopoTree = editorProps === null || editorProps === void 0 ? void 0 : editorProps.relateTopoTree;
101
103
  return /*#__PURE__*/React.createElement(_Collapse, {
@@ -4,8 +4,6 @@ import React from 'react';
4
4
  import NodeSizeInput from "../../common/NodeSizeInput/NodeSizeInput";
5
5
  import useBackgroundSizeConfig from "./hooks/useBackgroundSizeConfig";
6
6
  export default function BackgroundSize(props) {
7
- var _ref;
8
-
9
7
  var topo = props.topo,
10
8
  backgroundConfig = props.backgroundConfig,
11
9
  settingRuntimeState = props.settingRuntimeState;
@@ -14,8 +12,8 @@ export default function BackgroundSize(props) {
14
12
  current: backgroundConfig.current
15
13
  });
16
14
 
17
- var setSize = function setSize(_x) {
18
- return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(size) {
15
+ var setSize = /*#__PURE__*/function () {
16
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(size) {
19
17
  return _regeneratorRuntime.wrap(function _callee$(_context) {
20
18
  while (1) switch (_context.prev = _context.next) {
21
19
  case 0:
@@ -31,8 +29,12 @@ export default function BackgroundSize(props) {
31
29
  return _context.stop();
32
30
  }
33
31
  }, _callee);
34
- }))).apply(this, arguments);
35
- };
32
+ }));
33
+
34
+ return function setSize(_x) {
35
+ return _ref.apply(this, arguments);
36
+ };
37
+ }();
36
38
 
37
39
  return /*#__PURE__*/React.createElement(NodeSizeInput, {
38
40
  nodeId: backgroundSizeConfig.nodeId,
@@ -11,8 +11,6 @@ import styles from "../../../components/titlebar/TitleBar.module.scss";
11
11
  import DebugTools from "./widgets/DebugTools";
12
12
  import SettingButtonWidget from "../../../viewer/components/titlebar/widgets/SettingButtonWidget";
13
13
  export default function TopoEditorTitleBar(props) {
14
- var _ref;
15
-
16
14
  var topo = props.topo,
17
15
  topoEditApi = props.topoEditApi;
18
16
  var store = topo.store;
@@ -27,8 +25,8 @@ export default function TopoEditorTitleBar(props) {
27
25
  exitFlag = _useState[0],
28
26
  setExitFlag = _useState[1];
29
27
 
30
- var saveAndExit = function saveAndExit() {
31
- return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
28
+ var saveAndExit = /*#__PURE__*/function () {
29
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
32
30
  return _regeneratorRuntime.wrap(function _callee$(_context) {
33
31
  while (1) switch (_context.prev = _context.next) {
34
32
  case 0:
@@ -43,8 +41,12 @@ export default function TopoEditorTitleBar(props) {
43
41
  return _context.stop();
44
42
  }
45
43
  }, _callee);
46
- }))).apply(this, arguments);
47
- };
44
+ }));
45
+
46
+ return function saveAndExit() {
47
+ return _ref.apply(this, arguments);
48
+ };
49
+ }();
48
50
 
49
51
  useEffect(function () {
50
52
  if (!saving && exitFlag) {
@@ -73,13 +75,11 @@ export default function TopoEditorTitleBar(props) {
73
75
  }, "\u4FDD\u5B58"), /*#__PURE__*/React.createElement(_Button, {
74
76
  className: styles.button,
75
77
  onClick: function onClick() {
76
- var _onOk, _onCancel;
77
-
78
78
  _Dialog.confirm({
79
79
  title: '提示',
80
80
  content: '若直接退出,图上修改的内容将不会保存!',
81
- onOk: function onOk() {
82
- return (_onOk = _onOk || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
81
+ onOk: function () {
82
+ var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
83
83
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
84
84
  while (1) switch (_context2.prev = _context2.next) {
85
85
  case 0:
@@ -90,10 +90,16 @@ export default function TopoEditorTitleBar(props) {
90
90
  return _context2.stop();
91
91
  }
92
92
  }, _callee2);
93
- }))).apply(this, arguments);
94
- },
95
- onCancel: function onCancel() {
96
- return (_onCancel = _onCancel || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
93
+ }));
94
+
95
+ function onOk() {
96
+ return _onOk.apply(this, arguments);
97
+ }
98
+
99
+ return onOk;
100
+ }(),
101
+ onCancel: function () {
102
+ var _onCancel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
97
103
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
98
104
  while (1) switch (_context3.prev = _context3.next) {
99
105
  case 0:
@@ -104,8 +110,14 @@ export default function TopoEditorTitleBar(props) {
104
110
  return _context3.stop();
105
111
  }
106
112
  }, _callee3);
107
- }))).apply(this, arguments);
108
- },
113
+ }));
114
+
115
+ function onCancel() {
116
+ return _onCancel.apply(this, arguments);
117
+ }
118
+
119
+ return onCancel;
120
+ }(),
109
121
  cancelProps: {
110
122
  children: '退出'
111
123
  },
@@ -15,8 +15,6 @@ import useHtDataPropertyChangeListener from "./ht/useHtDataPropertyChangeListene
15
15
  */
16
16
 
17
17
  var usePolling = function usePolling(props) {
18
- var _fetchData, _refresh;
19
-
20
18
  var topo = props.topo;
21
19
  var store = topo.store;
22
20
  useCiAttributeChange({
@@ -35,7 +33,16 @@ var usePolling = function usePolling(props) {
35
33
  */
36
34
 
37
35
  function fetchData() {
38
- return (_fetchData = _fetchData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
36
+ return _fetchData.apply(this, arguments);
37
+ }
38
+ /**
39
+ *
40
+ * @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
41
+ */
42
+
43
+
44
+ function _fetchData() {
45
+ _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
39
46
  var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all, ciMetricsResult, mergeData, transformLinkData, adapterIpv6;
40
47
 
41
48
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -145,16 +152,17 @@ var usePolling = function usePolling(props) {
145
152
  return _context.stop();
146
153
  }
147
154
  }, _callee);
148
- }))).apply(this, arguments);
155
+ }));
156
+ return _fetchData.apply(this, arguments);
149
157
  }
150
- /**
151
- *
152
- * @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
153
- */
154
-
155
158
 
156
159
  function refresh() {
157
- return (_refresh = _refresh || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
160
+ return _refresh.apply(this, arguments);
161
+ } // 轮询hooks
162
+
163
+
164
+ function _refresh() {
165
+ _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
158
166
  var data;
159
167
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
160
168
  while (1) switch (_context2.prev = _context2.next) {
@@ -179,9 +187,9 @@ var usePolling = function usePolling(props) {
179
187
  return _context2.stop();
180
188
  }
181
189
  }, _callee2);
182
- }))).apply(this, arguments);
183
- } // 轮询hooks
184
-
190
+ }));
191
+ return _refresh.apply(this, arguments);
192
+ }
185
193
 
186
194
  var _useRequest = useRequest(refresh, {
187
195
  pollingInterval: 60 * 1000,
@@ -6,14 +6,12 @@ import { getElements } from "../../utils/htElementUtils";
6
6
  import ResourceConfigUtil from "../../utils/ResourceConfigUtil";
7
7
  import { DEFAULT_GROUP } from "../../utils/template";
8
8
  export default function (props) {
9
- var _ref, _ref2, _updateGroupResources, _addLayerStaticResources;
10
-
11
9
  var topo = props.topo;
12
10
  var store = topo.store;
13
11
  var editDispatchers = store.useModelDispatchers('topoConfig');
14
12
 
15
- var loadConfig = function loadConfig() {
16
- return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
13
+ var loadConfig = /*#__PURE__*/function () {
14
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
17
15
  return _regeneratorRuntime.wrap(function _callee$(_context) {
18
16
  while (1) switch (_context.prev = _context.next) {
19
17
  case 0:
@@ -25,8 +23,12 @@ export default function (props) {
25
23
  return _context.stop();
26
24
  }
27
25
  }, _callee);
28
- }))).apply(this, arguments);
29
- };
26
+ }));
27
+
28
+ return function loadConfig() {
29
+ return _ref.apply(this, arguments);
30
+ };
31
+ }();
30
32
  /**
31
33
  * 获取拓扑资源配置
32
34
  *
@@ -54,8 +56,8 @@ export default function (props) {
54
56
  return getConfig().groups;
55
57
  }
56
58
 
57
- var updateConfig = function updateConfig(_x) {
58
- return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(config) {
59
+ var updateConfig = /*#__PURE__*/function () {
60
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(config) {
59
61
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
60
62
  while (1) switch (_context2.prev = _context2.next) {
61
63
  case 0:
@@ -67,8 +69,12 @@ export default function (props) {
67
69
  return _context2.stop();
68
70
  }
69
71
  }, _callee2);
70
- }))).apply(this, arguments);
71
- }; // 查找分组
72
+ }));
73
+
74
+ return function updateConfig(_x) {
75
+ return _ref2.apply(this, arguments);
76
+ };
77
+ }(); // 查找分组
72
78
 
73
79
 
74
80
  var getGroupById = function getGroupById(groupId) {
@@ -165,7 +171,11 @@ export default function (props) {
165
171
  function addGroupAt(group, index) {}
166
172
 
167
173
  function updateGroupResources(_x2, _x3) {
168
- return (_updateGroupResources = _updateGroupResources || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(groupData, resources) {
174
+ return _updateGroupResources.apply(this, arguments);
175
+ }
176
+
177
+ function _updateGroupResources() {
178
+ _updateGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(groupData, resources) {
169
179
  var config;
170
180
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
171
181
  while (1) switch (_context3.prev = _context3.next) {
@@ -190,7 +200,8 @@ export default function (props) {
190
200
  return _context3.stop();
191
201
  }
192
202
  }, _callee3);
193
- }))).apply(this, arguments);
203
+ }));
204
+ return _updateGroupResources.apply(this, arguments);
194
205
  }
195
206
 
196
207
  function matchGroup(group, data) {
@@ -198,7 +209,18 @@ export default function (props) {
198
209
  }
199
210
 
200
211
  function addLayerStaticResources(_x4, _x5) {
201
- return (_addLayerStaticResources = _addLayerStaticResources || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data, newResourceIds) {
212
+ return _addLayerStaticResources.apply(this, arguments);
213
+ }
214
+ /**
215
+ * 从拓扑图解析出拓扑资源配置
216
+ *
217
+ * @param {ht.DataModel} dataModel
218
+ * @returns {{layers, groups, resources}}
219
+ */
220
+
221
+
222
+ function _addLayerStaticResources() {
223
+ _addLayerStaticResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data, newResourceIds) {
202
224
  var config;
203
225
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
204
226
  while (1) switch (_context4.prev = _context4.next) {
@@ -225,15 +247,9 @@ export default function (props) {
225
247
  return _context4.stop();
226
248
  }
227
249
  }, _callee4);
228
- }))).apply(this, arguments);
250
+ }));
251
+ return _addLayerStaticResources.apply(this, arguments);
229
252
  }
230
- /**
231
- * 从拓扑图解析出拓扑资源配置
232
- *
233
- * @param {ht.DataModel} dataModel
234
- * @returns {{layers, groups, resources}}
235
- */
236
-
237
253
 
238
254
  function getConfigFromHt() {
239
255
  return ResourceConfigUtil.getResourceConfigFromHt(topo);