@riil-frontend/component-topology 10.0.58 → 10.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +4 -2
  4. package/build/index.js +52 -45
  5. package/es/components/IndexSettingDrawer/index.js +6 -5
  6. package/es/components/MultiResourceDrawer/index.js +22 -26
  7. package/es/components/ResourceList/ResourceSelect.js +55 -58
  8. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
  9. package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  10. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
  11. package/es/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +78 -100
  12. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  13. package/es/core/components/titlebar/widgets/TitleWidget.js +5 -4
  14. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
  15. package/es/core/editor/components/BackgroundView/index.js +149 -178
  16. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
  17. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
  18. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
  19. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
  20. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  21. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  22. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  23. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
  24. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
  25. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  26. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
  27. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
  28. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  29. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  30. package/es/core/editor/store/background.js +8 -10
  31. package/es/core/editor/store/topoEdit.js +4 -6
  32. package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  33. package/es/core/hooks/usePolling.js +110 -122
  34. package/es/core/hooks/useResourceConfig.js +76 -100
  35. package/es/core/hooks/useTopoEdit.js +539 -638
  36. package/es/core/models/Alarm.js +311 -394
  37. package/es/core/models/AttributeMetricDisplay.js +115 -143
  38. package/es/core/models/PluginManager.js +4 -3
  39. package/es/core/models/SelectionModel.js +4 -5
  40. package/es/core/models/TopoApp.js +287 -454
  41. package/es/core/models/TopoGraphView.js +28 -41
  42. package/es/core/models/cache/CiCache.js +34 -39
  43. package/es/core/models/cache/CiTypeCache.js +70 -84
  44. package/es/core/models/cache/DictCache.js +36 -42
  45. package/es/core/models/graph/Background.js +21 -26
  46. package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
  47. package/es/core/models/tagstips/ElementTagTipConfig.js +34 -40
  48. package/es/core/models/topoData.js +73 -77
  49. package/es/core/models/utils/linkUtils.js +46 -51
  50. package/es/core/services/alarm.js +14 -16
  51. package/es/core/services/background.js +59 -67
  52. package/es/core/services/cmdb/metric.js +14 -18
  53. package/es/core/services/cmdb.js +23 -27
  54. package/es/core/services/index.js +48 -68
  55. package/es/core/services/overview.js +131 -151
  56. package/es/core/services/topo/basic.js +11 -13
  57. package/es/core/services/topo/tagtip.js +15 -19
  58. package/es/core/store/models/ciModel.js +58 -62
  59. package/es/core/store/models/customIcon.js +126 -145
  60. package/es/core/store/models/displayConfig.js +15 -19
  61. package/es/core/store/models/selection.js +4 -6
  62. package/es/core/store/models/topoAlarm.js +162 -145
  63. package/es/core/store/models/topoBaseInfoOverview.js +4 -6
  64. package/es/core/store/models/topoBizMod.js +28 -32
  65. package/es/core/store/models/topoConfig.js +217 -233
  66. package/es/core/store/models/topoGraphView.js +4 -6
  67. package/es/core/store/models/topoMod.js +379 -401
  68. package/es/core/utils/imageUtil.js +23 -27
  69. package/es/core/utils/saveSerialize.js +14 -18
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
  79. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
  80. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  81. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
  82. package/es/networkTopo/components/Link/hook.js +85 -96
  83. package/es/networkTopo/components/Link/index copy.js +104 -126
  84. package/es/networkTopo/components/Link/index.js +104 -126
  85. package/es/networkTopo/components/Link/setting.js +48 -52
  86. package/es/networkTopo/getTopoData.js +73 -92
  87. package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
  88. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  89. package/es/networkTopo/models/TopoCenter.js +28 -46
  90. package/es/networkTopo/services/alert.js +18 -22
  91. package/es/networkTopo/services/authorization.js +45 -55
  92. package/es/networkTopo/services/cmdb.js +548 -696
  93. package/es/networkTopo/services/funcAuth.js +22 -24
  94. package/es/networkTopo/services/link.js +107 -117
  95. package/es/networkTopo/services/mdc.js +33 -48
  96. package/es/networkTopo/services/metric.js +38 -47
  97. package/es/networkTopo/services/model.js +616 -809
  98. package/es/networkTopo/services/risk.js +9 -11
  99. package/es/networkTopo/services/topo/auth.js +27 -33
  100. package/es/networkTopo/services/topo/basic.js +274 -314
  101. package/es/networkTopo/services/topo/blacklist.js +20 -24
  102. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  103. package/es/networkTopo/services/topo/icon.js +49 -59
  104. package/es/networkTopo/services/topo/networkLink.js +32 -36
  105. package/es/networkTopo/services/topo/relation.js +9 -11
  106. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  107. package/es/networkTopo/store/functionAuth.js +31 -37
  108. package/es/networkTopo/store/linkDynamicStyle.js +102 -108
  109. package/es/networkTopo/store/linkDynamicStyleConfig.js +42 -44
  110. package/es/networkTopo/store/linkManager.js +4 -6
  111. package/es/networkTopo/store/topoCenter.js +142 -152
  112. package/es/networkTopo/store/topoLinkMod.js +4 -6
  113. package/es/networkTopo/store/topoTreeMod.js +170 -182
  114. package/es/networkTopo/utils/exportData.js +57 -61
  115. package/lib/components/IndexSettingDrawer/index.js +6 -5
  116. package/lib/components/MultiResourceDrawer/index.js +22 -26
  117. package/lib/components/ResourceList/ResourceSelect.js +54 -58
  118. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
  119. package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  120. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
  121. package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/useElementTagTipConfig.js +82 -104
  122. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  123. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -4
  124. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  125. package/lib/core/editor/components/BackgroundView/index.js +148 -177
  126. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
  127. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  128. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
  129. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
  130. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  131. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  132. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  133. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
  134. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
  135. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  136. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
  137. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
  138. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  139. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  140. package/lib/core/editor/store/background.js +8 -10
  141. package/lib/core/editor/store/topoEdit.js +4 -6
  142. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  143. package/lib/core/hooks/usePolling.js +108 -120
  144. package/lib/core/hooks/useResourceConfig.js +76 -100
  145. package/lib/core/hooks/useTopoEdit.js +530 -629
  146. package/lib/core/models/Alarm.js +308 -391
  147. package/lib/core/models/AttributeMetricDisplay.js +118 -146
  148. package/lib/core/models/PluginManager.js +4 -3
  149. package/lib/core/models/SelectionModel.js +4 -5
  150. package/lib/core/models/TopoApp.js +287 -454
  151. package/lib/core/models/TopoGraphView.js +28 -41
  152. package/lib/core/models/cache/CiCache.js +39 -44
  153. package/lib/core/models/cache/CiTypeCache.js +71 -85
  154. package/lib/core/models/cache/DictCache.js +39 -45
  155. package/lib/core/models/graph/Background.js +22 -27
  156. package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
  157. package/lib/core/models/tagstips/ElementTagTipConfig.js +34 -40
  158. package/lib/core/models/topoData.js +73 -78
  159. package/lib/core/models/utils/linkUtils.js +45 -51
  160. package/lib/core/services/alarm.js +18 -20
  161. package/lib/core/services/background.js +70 -78
  162. package/lib/core/services/cmdb/metric.js +14 -19
  163. package/lib/core/services/cmdb.js +24 -29
  164. package/lib/core/services/index.js +53 -72
  165. package/lib/core/services/overview.js +131 -151
  166. package/lib/core/services/topo/basic.js +13 -15
  167. package/lib/core/services/topo/tagtip.js +16 -21
  168. package/lib/core/store/models/ciModel.js +66 -70
  169. package/lib/core/store/models/customIcon.js +126 -145
  170. package/lib/core/store/models/displayConfig.js +15 -19
  171. package/lib/core/store/models/selection.js +4 -6
  172. package/lib/core/store/models/topoAlarm.js +163 -145
  173. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  174. package/lib/core/store/models/topoBizMod.js +34 -38
  175. package/lib/core/store/models/topoConfig.js +224 -240
  176. package/lib/core/store/models/topoGraphView.js +4 -6
  177. package/lib/core/store/models/topoMod.js +381 -403
  178. package/lib/core/utils/imageUtil.js +26 -31
  179. package/lib/core/utils/saveSerialize.js +13 -18
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
  185. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
  186. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  187. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  188. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
  189. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
  190. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  191. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
  192. package/lib/networkTopo/components/Link/hook.js +86 -98
  193. package/lib/networkTopo/components/Link/index copy.js +105 -127
  194. package/lib/networkTopo/components/Link/index.js +105 -127
  195. package/lib/networkTopo/components/Link/setting.js +48 -52
  196. package/lib/networkTopo/getTopoData.js +73 -92
  197. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
  198. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  199. package/lib/networkTopo/models/TopoCenter.js +28 -46
  200. package/lib/networkTopo/services/alert.js +18 -22
  201. package/lib/networkTopo/services/authorization.js +55 -65
  202. package/lib/networkTopo/services/cmdb.js +551 -700
  203. package/lib/networkTopo/services/funcAuth.js +24 -26
  204. package/lib/networkTopo/services/link.js +108 -118
  205. package/lib/networkTopo/services/mdc.js +35 -51
  206. package/lib/networkTopo/services/metric.js +37 -47
  207. package/lib/networkTopo/services/model.js +615 -809
  208. package/lib/networkTopo/services/risk.js +11 -13
  209. package/lib/networkTopo/services/topo/auth.js +27 -33
  210. package/lib/networkTopo/services/topo/basic.js +277 -317
  211. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  212. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  213. package/lib/networkTopo/services/topo/icon.js +59 -69
  214. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  215. package/lib/networkTopo/services/topo/relation.js +11 -13
  216. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  217. package/lib/networkTopo/store/functionAuth.js +31 -37
  218. package/lib/networkTopo/store/linkDynamicStyle.js +103 -109
  219. package/lib/networkTopo/store/linkDynamicStyleConfig.js +42 -44
  220. package/lib/networkTopo/store/linkManager.js +4 -6
  221. package/lib/networkTopo/store/topoCenter.js +142 -152
  222. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  223. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  224. package/lib/networkTopo/utils/exportData.js +63 -68
  225. package/package.json +3 -3
@@ -4,6 +4,8 @@ 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
+
7
9
  var topo = props.topo,
8
10
  backgroundConfig = props.backgroundConfig,
9
11
  settingRuntimeState = props.settingRuntimeState;
@@ -12,31 +14,25 @@ export default function BackgroundSize(props) {
12
14
  current: backgroundConfig.current
13
15
  });
14
16
 
15
- var setSize = /*#__PURE__*/function () {
16
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(size) {
17
+ var setSize = function setSize(_x) {
18
+ return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(size) {
17
19
  return _regeneratorRuntime.wrap(function _callee$(_context) {
18
- while (1) {
19
- switch (_context.prev = _context.next) {
20
- case 0:
21
- topo.historyManager.beginTransaction();
22
- _context.next = 3;
23
- return backgroundSizeConfig.setSize(size);
20
+ while (1) switch (_context.prev = _context.next) {
21
+ case 0:
22
+ topo.historyManager.beginTransaction();
23
+ _context.next = 3;
24
+ return backgroundSizeConfig.setSize(size);
24
25
 
25
- case 3:
26
- topo.historyManager.endTransaction();
26
+ case 3:
27
+ topo.historyManager.endTransaction();
27
28
 
28
- case 4:
29
- case "end":
30
- return _context.stop();
31
- }
29
+ case 4:
30
+ case "end":
31
+ return _context.stop();
32
32
  }
33
33
  }, _callee);
34
- }));
35
-
36
- return function setSize(_x) {
37
- return _ref.apply(this, arguments);
38
- };
39
- }();
34
+ }))).apply(this, arguments);
35
+ };
40
36
 
41
37
  return /*#__PURE__*/React.createElement(NodeSizeInput, {
42
38
  nodeId: backgroundSizeConfig.nodeId,
@@ -11,6 +11,8 @@ 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
+
14
16
  var topo = props.topo,
15
17
  topoEditApi = props.topoEditApi;
16
18
  var store = topo.store;
@@ -25,30 +27,24 @@ export default function TopoEditorTitleBar(props) {
25
27
  exitFlag = _useState[0],
26
28
  setExitFlag = _useState[1];
27
29
 
28
- var saveAndExit = /*#__PURE__*/function () {
29
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
30
+ var saveAndExit = function saveAndExit() {
31
+ return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
30
32
  return _regeneratorRuntime.wrap(function _callee$(_context) {
31
- while (1) {
32
- switch (_context.prev = _context.next) {
33
- case 0:
34
- _context.next = 2;
35
- return topo.save();
33
+ while (1) switch (_context.prev = _context.next) {
34
+ case 0:
35
+ _context.next = 2;
36
+ return topo.save();
36
37
 
37
- case 2:
38
- setExitFlag(true);
38
+ case 2:
39
+ setExitFlag(true);
39
40
 
40
- case 3:
41
- case "end":
42
- return _context.stop();
43
- }
41
+ case 3:
42
+ case "end":
43
+ return _context.stop();
44
44
  }
45
45
  }, _callee);
46
- }));
47
-
48
- return function saveAndExit() {
49
- return _ref.apply(this, arguments);
50
- };
51
- }();
46
+ }))).apply(this, arguments);
47
+ };
52
48
 
53
49
  useEffect(function () {
54
50
  if (!saving && exitFlag) {
@@ -77,53 +73,39 @@ export default function TopoEditorTitleBar(props) {
77
73
  }, "\u4FDD\u5B58"), /*#__PURE__*/React.createElement(_Button, {
78
74
  className: styles.button,
79
75
  onClick: function onClick() {
76
+ var _onOk, _onCancel;
77
+
80
78
  _Dialog.confirm({
81
79
  title: '提示',
82
80
  content: '若直接退出,图上修改的内容将不会保存!',
83
- onOk: function () {
84
- var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
81
+ onOk: function onOk() {
82
+ return (_onOk = _onOk || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
85
83
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
86
- while (1) {
87
- switch (_context2.prev = _context2.next) {
88
- case 0:
89
- saveAndExit();
84
+ while (1) switch (_context2.prev = _context2.next) {
85
+ case 0:
86
+ saveAndExit();
90
87
 
91
- case 1:
92
- case "end":
93
- return _context2.stop();
94
- }
88
+ case 1:
89
+ case "end":
90
+ return _context2.stop();
95
91
  }
96
92
  }, _callee2);
97
- }));
98
-
99
- function onOk() {
100
- return _onOk.apply(this, arguments);
101
- }
102
-
103
- return onOk;
104
- }(),
105
- onCancel: function () {
106
- var _onCancel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
93
+ }))).apply(this, arguments);
94
+ },
95
+ onCancel: function onCancel() {
96
+ return (_onCancel = _onCancel || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
107
97
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
108
- while (1) {
109
- switch (_context3.prev = _context3.next) {
110
- case 0:
111
- topo.exitEditMode();
98
+ while (1) switch (_context3.prev = _context3.next) {
99
+ case 0:
100
+ topo.exitEditMode();
112
101
 
113
- case 1:
114
- case "end":
115
- return _context3.stop();
116
- }
102
+ case 1:
103
+ case "end":
104
+ return _context3.stop();
117
105
  }
118
106
  }, _callee3);
119
- }));
120
-
121
- function onCancel() {
122
- return _onCancel.apply(this, arguments);
123
- }
124
-
125
- return onCancel;
126
- }(),
107
+ }))).apply(this, arguments);
108
+ },
127
109
  cancelProps: {
128
110
  children: '退出'
129
111
  },
@@ -24,8 +24,8 @@ export default function useKeyboardShortcut(props) {
24
24
 
25
25
  if (e.keyCode === 32 && e.target.nodeName !== 'TEXTAREA') {
26
26
  // 空格
27
- var _topo$store$getModelS = topo.store.getModelState('topoEdit'),
28
- viewMouseMode = _topo$store$getModelS.viewMouseMode;
27
+ var _topo$store$getModelS2 = topo.store.getModelState('topoEdit'),
28
+ viewMouseMode = _topo$store$getModelS2.viewMouseMode;
29
29
 
30
30
  topoEdit.setViewMouseMode(viewMouseMode === 'select' ? 'move' : 'select');
31
31
  }
@@ -26,10 +26,10 @@ function useNewElementTheme(props) {
26
26
  return item.name === theme;
27
27
  });
28
28
 
29
- var _ThemeUtil = ThemeUtil({
29
+ var _ThemeUtil2 = ThemeUtil({
30
30
  topo: topo
31
31
  }),
32
- setElementTheme = _ThemeUtil.setElementTheme;
32
+ setElementTheme = _ThemeUtil2.setElementTheme;
33
33
 
34
34
  setElementTheme(data, themeConfig);
35
35
  }
@@ -36,17 +36,15 @@ export default {
36
36
 
37
37
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
38
38
  return _regeneratorRuntime.wrap(function _callee$(_context) {
39
- while (1) {
40
- switch (_context.prev = _context.next) {
41
- case 0:
42
- _this.update({
43
- current: extraConfig.background
44
- });
39
+ while (1) switch (_context.prev = _context.next) {
40
+ case 0:
41
+ _this.update({
42
+ current: extraConfig.background
43
+ });
45
44
 
46
- case 1:
47
- case "end":
48
- return _context.stop();
49
- }
45
+ case 1:
46
+ case "end":
47
+ return _context.stop();
50
48
  }
51
49
  }, _callee);
52
50
  }))();
@@ -37,12 +37,10 @@ export default function (topo) {
37
37
  init: function init(payload, rootState) {
38
38
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
39
39
  return _regeneratorRuntime.wrap(function _callee$(_context) {
40
- while (1) {
41
- switch (_context.prev = _context.next) {
42
- case 0:
43
- case "end":
44
- return _context.stop();
45
- }
40
+ while (1) switch (_context.prev = _context.next) {
41
+ case 0:
42
+ case "end":
43
+ return _context.stop();
46
44
  }
47
45
  }, _callee);
48
46
  }))();
@@ -68,14 +68,12 @@ export function isNodeAllEdges(topo) {
68
68
  return nodeLineList[i]._id == edge._id;
69
69
  }).length == 0) {
70
70
  inEdges = true;
71
- return "break";
71
+ return 1; // break
72
72
  }
73
73
  };
74
74
 
75
75
  for (var i = 0; i < nodeLineList.length; i++) {
76
- var _ret = _loop(i);
77
-
78
- if (_ret === "break") break;
76
+ if (_loop(i)) break;
79
77
  }
80
78
  });
81
79
  return inEdges;
@@ -16,6 +16,8 @@ import useHtDataPropertyChangeListener from "./ht/useHtDataPropertyChangeListene
16
16
  */
17
17
 
18
18
  var usePolling = function usePolling(props) {
19
+ var _fetchData, _refresh;
20
+
19
21
  var topo = props.topo;
20
22
  var store = topo.store;
21
23
  useCiAttributeChange({
@@ -34,142 +36,128 @@ var usePolling = function usePolling(props) {
34
36
  */
35
37
 
36
38
  function fetchData() {
37
- return _fetchData.apply(this, arguments);
38
- }
39
- /**
40
- *
41
- * @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
42
- */
43
-
44
-
45
- function _fetchData() {
46
- _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
39
+ return (_fetchData = _fetchData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
47
40
  var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all, ciMetricResult, transformLinkData;
48
41
 
49
42
  return _regeneratorRuntime.wrap(function _callee$(_context) {
50
- while (1) {
51
- switch (_context.prev = _context.next) {
52
- case 0:
53
- transformLinkData = function _transformLinkData(data) {
54
- var _topo$dataModel$getDa = topo.dataModel.getData(),
55
- links = _topo$dataModel$getDa.links,
56
- linkGroups = _topo$dataModel$getDa.linkGroups;
57
-
58
- var link = [].concat(links, linkGroups).find(function (item) {
59
- return item.id === data.id;
60
- });
61
-
62
- if (!link) {
63
- return data;
64
- }
65
-
66
- return _extends({}, data, {
67
- attributeMap: link.attributes || {}
68
- });
69
- };
70
-
71
- _topo$store$getModelS = topo.store.getModelState('topoBizMod').resAndMetrics, resIdsList = _topo$store$getModelS.resIdsList, nodeIdsList = _topo$store$getModelS.nodeIdsList; // rlog.debug('根据ci的id获取属性的值-getCiArrByIds', resIdsList, metrics);
72
- // 无资源,不查询
73
-
74
- if (resIdsList.length) {
75
- _context.next = 4;
76
- break;
43
+ while (1) switch (_context.prev = _context.next) {
44
+ case 0:
45
+ transformLinkData = function _transformLinkData(data) {
46
+ var _topo$dataModel$getDa = topo.dataModel.getData(),
47
+ links = _topo$dataModel$getDa.links,
48
+ linkGroups = _topo$dataModel$getDa.linkGroups;
49
+
50
+ var link = [].concat(links, linkGroups).find(function (item) {
51
+ return item.id === data.id;
52
+ });
53
+
54
+ if (!link) {
55
+ return data;
56
+ }
57
+
58
+ return _extends({}, data, {
59
+ attributeMap: link.attributes || {}
60
+ });
61
+ };
62
+
63
+ _topo$store$getModelS = topo.store.getModelState('topoBizMod').resAndMetrics, resIdsList = _topo$store$getModelS.resIdsList, nodeIdsList = _topo$store$getModelS.nodeIdsList; // rlog.debug('根据ci的id获取属性的值-getCiArrByIds', resIdsList, metrics);
64
+ // 无资源,不查询
65
+
66
+ if (resIdsList.length) {
67
+ _context.next = 4;
68
+ break;
69
+ }
70
+
71
+ return _context.abrupt("return", []);
72
+
73
+ case 4:
74
+ // 需要查询的指标列表
75
+ codes = topo.attributeMetricDisplay.getResourceMetricCodes();
76
+ param = {
77
+ ciId: nodeIdsList,
78
+ codes: codes,
79
+ // 过滤掉不需要查询的
80
+ relationId: topo.attributeMetricDisplay.getEdges().map(function (edge) {
81
+ return {
82
+ ciId: edge.id,
83
+ operation: edge.operation
84
+ };
85
+ })
86
+ };
87
+ _context.t0 = Promise;
88
+ _context.t1 = // 查询指标值
89
+ topoServer.ciInfo.batchQueryCiInfo(param);
90
+ _context.next = 10;
91
+ return DictCache.init();
92
+
93
+ case 10:
94
+ _context.t2 = _context.sent;
95
+ _context.t3 = [_context.t1, _context.t2];
96
+ _context.next = 14;
97
+ return _context.t0.all.call(_context.t0, _context.t3);
98
+
99
+ case 14:
100
+ _yield$Promise$all = _context.sent;
101
+ ciMetricResult = _yield$Promise$all[0];
102
+ return _context.abrupt("return", ciMetricResult.map(function (data) {
103
+ var ci = topo.dataModel.getDataById(data.id);
104
+
105
+ var resultData = _extends({}, data, ci, {
106
+ attributeMap: _extends({}, (ci === null || ci === void 0 ? void 0 : ci.attributes) || {})
107
+ });
108
+
109
+ resultData = transformLinkData(resultData); // 特殊处理:ipv6 从ipv6_address_list取第一个
110
+
111
+ // 特殊处理:ipv6 从ipv6_address_list取第一个
112
+ if (resultData.attributeMap.ipv6_address_list && !resultData.attributeMap.ipv6_address) {
113
+ resultData.attributeMap.ipv6_address = (resultData.attributeMap.ipv6_address_list || '').split(',')[0];
77
114
  }
78
115
 
79
- return _context.abrupt("return", []);
80
-
81
- case 4:
82
- // 需要查询的指标列表
83
- codes = topo.attributeMetricDisplay.getResourceMetricCodes();
84
- param = {
85
- ciId: nodeIdsList,
86
- codes: codes,
87
- // 过滤掉不需要查询的
88
- relationId: topo.attributeMetricDisplay.getEdges().map(function (edge) {
89
- return {
90
- ciId: edge.id,
91
- operation: edge.operation
92
- };
93
- })
94
- };
95
- _context.t0 = Promise;
96
- _context.t1 = // 查询指标值
97
- topoServer.ciInfo.batchQueryCiInfo(param);
98
- _context.next = 10;
99
- return DictCache.init();
100
-
101
- case 10:
102
- _context.t2 = _context.sent;
103
- _context.t3 = [_context.t1, _context.t2];
104
- _context.next = 14;
105
- return _context.t0.all.call(_context.t0, _context.t3);
106
-
107
- case 14:
108
- _yield$Promise$all = _context.sent;
109
- ciMetricResult = _yield$Promise$all[0];
110
- return _context.abrupt("return", ciMetricResult.map(function (data) {
111
- var ci = topo.dataModel.getDataById(data.id);
112
-
113
- var resultData = _extends({}, data, ci, {
114
- attributeMap: _extends({}, (ci === null || ci === void 0 ? void 0 : ci.attributes) || {})
115
- });
116
-
117
- resultData = transformLinkData(resultData); // 特殊处理:ipv6 从ipv6_address_list取第一个
118
-
119
- // 特殊处理:ipv6 从ipv6_address_list取第一个
120
- if (resultData.attributeMap.ipv6_address_list && !resultData.attributeMap.ipv6_address) {
121
- resultData.attributeMap.ipv6_address = (resultData.attributeMap.ipv6_address_list || '').split(',')[0];
122
- }
123
-
124
- return resultData;
125
- }));
126
-
127
- case 17:
128
- case "end":
129
- return _context.stop();
130
- }
116
+ return resultData;
117
+ }));
118
+
119
+ case 17:
120
+ case "end":
121
+ return _context.stop();
131
122
  }
132
123
  }, _callee);
133
- }));
134
- return _fetchData.apply(this, arguments);
124
+ }))).apply(this, arguments);
135
125
  }
136
-
137
- function refresh() {
138
- return _refresh.apply(this, arguments);
139
- } // 轮询hooks
126
+ /**
127
+ *
128
+ * @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
129
+ */
140
130
 
141
131
 
142
- function _refresh() {
143
- _refresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
132
+ function refresh() {
133
+ return (_refresh = _refresh || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
144
134
  var data;
145
135
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
146
- while (1) {
147
- switch (_context2.prev = _context2.next) {
148
- case 0:
149
- if (!(!pollingSwitch || !(resAndMetrics !== null && resAndMetrics !== void 0 && resAndMetrics.resIdsList.length))) {
150
- _context2.next = 2;
151
- break;
152
- }
153
-
154
- return _context2.abrupt("return");
155
-
156
- case 2:
157
- _context2.next = 4;
158
- return fetchData();
159
-
160
- case 4:
161
- data = _context2.sent;
162
- return _context2.abrupt("return", data);
163
-
164
- case 6:
165
- case "end":
166
- return _context2.stop();
167
- }
136
+ while (1) switch (_context2.prev = _context2.next) {
137
+ case 0:
138
+ if (!(!pollingSwitch || !(resAndMetrics !== null && resAndMetrics !== void 0 && resAndMetrics.resIdsList.length))) {
139
+ _context2.next = 2;
140
+ break;
141
+ }
142
+
143
+ return _context2.abrupt("return");
144
+
145
+ case 2:
146
+ _context2.next = 4;
147
+ return fetchData();
148
+
149
+ case 4:
150
+ data = _context2.sent;
151
+ return _context2.abrupt("return", data);
152
+
153
+ case 6:
154
+ case "end":
155
+ return _context2.stop();
168
156
  }
169
157
  }, _callee2);
170
- }));
171
- return _refresh.apply(this, arguments);
172
- }
158
+ }))).apply(this, arguments);
159
+ } // 轮询hooks
160
+
173
161
 
174
162
  var _useRequest = useRequest(refresh, {
175
163
  pollingInterval: 60 * 1000,