@riil-frontend/component-topology 11.0.33 → 11.0.35

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 (217) 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/MultiResourceDrawer/index.js +22 -26
  6. package/es/components/ResourceList/ResourceSelect.js +55 -58
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  11. package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
  12. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
  13. package/es/core/editor/components/BackgroundView/index.js +149 -178
  14. package/es/core/editor/components/BackgroundView/index.module.scss +2 -1
  15. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
  16. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
  17. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
  18. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
  19. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  20. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  21. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  22. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
  23. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
  24. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  25. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
  26. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
  27. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  28. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  29. package/es/core/editor/store/background.js +8 -10
  30. package/es/core/editor/store/topoEdit.js +4 -6
  31. package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  32. package/es/core/hooks/usePolling.js +130 -142
  33. package/es/core/hooks/useResourceConfig.js +76 -100
  34. package/es/core/hooks/useTopoEdit.js +525 -623
  35. package/es/core/models/Alarm.js +319 -402
  36. package/es/core/models/AttributeMetricDisplay.js +115 -143
  37. package/es/core/models/PluginManager.js +4 -3
  38. package/es/core/models/SelectionModel.js +4 -5
  39. package/es/core/models/TopoApp.js +279 -436
  40. package/es/core/models/TopoGraphView.js +28 -41
  41. package/es/core/models/cache/CiCache.js +34 -39
  42. package/es/core/models/cache/CiTypeCache.js +47 -61
  43. package/es/core/models/cache/DictCache.js +36 -42
  44. package/es/core/models/graph/Background.js +21 -26
  45. package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
  46. package/es/core/models/tagstips/ElementTagTipConfig.js +44 -58
  47. package/es/core/models/topoData.js +73 -77
  48. package/es/core/models/utils/linkUtils.js +46 -51
  49. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  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 +37 -41
  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 +9 -11
  65. package/es/core/store/models/topoConfig.js +215 -231
  66. package/es/core/store/models/topoGraphView.js +4 -6
  67. package/es/core/store/models/topoMod.js +373 -395
  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.js +104 -126
  84. package/es/networkTopo/components/Link/setting.js +48 -52
  85. package/es/networkTopo/getTopoData.js +73 -92
  86. package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
  87. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  88. package/es/networkTopo/models/TopoCenter.js +28 -46
  89. package/es/networkTopo/services/alert.js +18 -22
  90. package/es/networkTopo/services/authorization.js +45 -55
  91. package/es/networkTopo/services/cmdb.js +548 -696
  92. package/es/networkTopo/services/funcAuth.js +22 -24
  93. package/es/networkTopo/services/link.js +107 -117
  94. package/es/networkTopo/services/mdc.js +33 -48
  95. package/es/networkTopo/services/metric.js +38 -47
  96. package/es/networkTopo/services/model.js +616 -809
  97. package/es/networkTopo/services/risk.js +9 -11
  98. package/es/networkTopo/services/topo/auth.js +27 -33
  99. package/es/networkTopo/services/topo/basic.js +251 -289
  100. package/es/networkTopo/services/topo/blacklist.js +20 -24
  101. package/es/networkTopo/services/topo/ciInfo.js +27 -31
  102. package/es/networkTopo/services/topo/icon.js +49 -59
  103. package/es/networkTopo/services/topo/networkLink.js +32 -36
  104. package/es/networkTopo/services/topo/relation.js +9 -11
  105. package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
  106. package/es/networkTopo/store/functionAuth.js +31 -37
  107. package/es/networkTopo/store/topoCenter.js +142 -152
  108. package/es/networkTopo/store/topoLinkMod.js +4 -6
  109. package/es/networkTopo/store/topoTreeMod.js +170 -182
  110. package/es/networkTopo/utils/exportData.js +57 -61
  111. package/lib/components/MultiResourceDrawer/index.js +22 -26
  112. package/lib/components/ResourceList/ResourceSelect.js +54 -58
  113. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
  114. package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
  115. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
  116. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
  117. package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
  118. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
  119. package/lib/core/editor/components/BackgroundView/index.js +148 -177
  120. package/lib/core/editor/components/BackgroundView/index.module.scss +2 -1
  121. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
  122. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
  123. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
  124. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
  125. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
  126. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
  127. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
  128. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
  129. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
  130. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
  131. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
  132. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
  133. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  134. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  135. package/lib/core/editor/store/background.js +8 -10
  136. package/lib/core/editor/store/topoEdit.js +4 -6
  137. package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
  138. package/lib/core/hooks/usePolling.js +129 -141
  139. package/lib/core/hooks/useResourceConfig.js +76 -100
  140. package/lib/core/hooks/useTopoEdit.js +517 -615
  141. package/lib/core/models/Alarm.js +313 -396
  142. package/lib/core/models/AttributeMetricDisplay.js +118 -146
  143. package/lib/core/models/PluginManager.js +4 -3
  144. package/lib/core/models/SelectionModel.js +4 -5
  145. package/lib/core/models/TopoApp.js +279 -436
  146. package/lib/core/models/TopoGraphView.js +28 -41
  147. package/lib/core/models/cache/CiCache.js +39 -44
  148. package/lib/core/models/cache/CiTypeCache.js +48 -62
  149. package/lib/core/models/cache/DictCache.js +39 -45
  150. package/lib/core/models/graph/Background.js +22 -27
  151. package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
  152. package/lib/core/models/tagstips/ElementTagTipConfig.js +44 -58
  153. package/lib/core/models/topoData.js +73 -78
  154. package/lib/core/models/utils/linkUtils.js +45 -51
  155. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  156. package/lib/core/services/alarm.js +18 -20
  157. package/lib/core/services/background.js +70 -78
  158. package/lib/core/services/cmdb/metric.js +14 -19
  159. package/lib/core/services/cmdb.js +24 -29
  160. package/lib/core/services/index.js +53 -72
  161. package/lib/core/services/overview.js +131 -151
  162. package/lib/core/services/topo/basic.js +37 -41
  163. package/lib/core/services/topo/tagtip.js +16 -21
  164. package/lib/core/store/models/ciModel.js +66 -70
  165. package/lib/core/store/models/customIcon.js +126 -145
  166. package/lib/core/store/models/displayConfig.js +15 -19
  167. package/lib/core/store/models/selection.js +4 -6
  168. package/lib/core/store/models/topoAlarm.js +163 -145
  169. package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
  170. package/lib/core/store/models/topoBizMod.js +9 -11
  171. package/lib/core/store/models/topoConfig.js +222 -238
  172. package/lib/core/store/models/topoGraphView.js +4 -6
  173. package/lib/core/store/models/topoMod.js +375 -397
  174. package/lib/core/utils/imageUtil.js +26 -31
  175. package/lib/core/utils/saveSerialize.js +13 -18
  176. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
  177. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
  178. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
  179. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
  185. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
  186. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
  187. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
  188. package/lib/networkTopo/components/Link/hook.js +86 -98
  189. package/lib/networkTopo/components/Link/index.js +105 -127
  190. package/lib/networkTopo/components/Link/setting.js +48 -52
  191. package/lib/networkTopo/getTopoData.js +73 -92
  192. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
  193. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  194. package/lib/networkTopo/models/TopoCenter.js +28 -46
  195. package/lib/networkTopo/services/alert.js +18 -22
  196. package/lib/networkTopo/services/authorization.js +55 -65
  197. package/lib/networkTopo/services/cmdb.js +551 -700
  198. package/lib/networkTopo/services/funcAuth.js +24 -26
  199. package/lib/networkTopo/services/link.js +108 -118
  200. package/lib/networkTopo/services/mdc.js +35 -51
  201. package/lib/networkTopo/services/metric.js +37 -47
  202. package/lib/networkTopo/services/model.js +615 -809
  203. package/lib/networkTopo/services/risk.js +11 -13
  204. package/lib/networkTopo/services/topo/auth.js +27 -33
  205. package/lib/networkTopo/services/topo/basic.js +252 -290
  206. package/lib/networkTopo/services/topo/blacklist.js +20 -24
  207. package/lib/networkTopo/services/topo/ciInfo.js +34 -38
  208. package/lib/networkTopo/services/topo/icon.js +59 -69
  209. package/lib/networkTopo/services/topo/networkLink.js +32 -36
  210. package/lib/networkTopo/services/topo/relation.js +11 -13
  211. package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
  212. package/lib/networkTopo/store/functionAuth.js +31 -37
  213. package/lib/networkTopo/store/topoCenter.js +142 -152
  214. package/lib/networkTopo/store/topoLinkMod.js +4 -6
  215. package/lib/networkTopo/store/topoTreeMod.js +166 -178
  216. package/lib/networkTopo/utils/exportData.js +63 -68
  217. package/package.json +4 -3
@@ -38,6 +38,8 @@ var Title = function Title(_ref) {
38
38
 
39
39
 
40
40
  var LinkSetting = function LinkSetting(_ref2) {
41
+ var _ref3;
42
+
41
43
  var link = _ref2.link,
42
44
  topoElements = _ref2.topoElements,
43
45
  topo = _ref2.topo,
@@ -106,62 +108,56 @@ var LinkSetting = function LinkSetting(_ref2) {
106
108
  return validatorErrors;
107
109
  };
108
110
 
109
- var onSave = /*#__PURE__*/function () {
110
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
111
- var values, _values$, src, dst;
111
+ var onSave = function onSave() {
112
+ return (_ref3 = _ref3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
113
+ var values, _values$2, src, dst;
112
114
 
113
115
  return _regeneratorRuntime.wrap(function _callee$(_context) {
114
- while (1) {
115
- switch (_context.prev = _context.next) {
116
- case 0:
117
- if (!isAvailableArray(getValidatorErrors())) {
118
- _context.next = 2;
119
- break;
120
- }
121
-
122
- return _context.abrupt("return");
123
-
124
- case 2:
125
- values = list.map(function (i, index) {
126
- return refs[index].field.getValues();
127
- });
128
-
129
- if (isAddMode) {
130
- _context.next = 8;
131
- break;
132
- }
133
-
134
- _values$ = values[0], src = _values$.src, dst = _values$.dst;
135
-
136
- if (!(src.sub === link.interfaceSource && dst.sub === link.interfaceTarget)) {
137
- _context.next = 8;
138
- break;
139
- }
140
-
141
- saveCb({
142
- changed: false
143
- });
144
- return _context.abrupt("return");
145
-
146
- case 8:
147
- _context.next = 10;
148
- return execSave({
149
- link: link,
150
- values: values
151
- });
152
-
153
- case 10:
154
- case "end":
155
- return _context.stop();
156
- }
116
+ while (1) switch (_context.prev = _context.next) {
117
+ case 0:
118
+ if (!isAvailableArray(getValidatorErrors())) {
119
+ _context.next = 2;
120
+ break;
121
+ }
122
+
123
+ return _context.abrupt("return");
124
+
125
+ case 2:
126
+ values = list.map(function (i, index) {
127
+ return refs[index].field.getValues();
128
+ });
129
+
130
+ if (isAddMode) {
131
+ _context.next = 8;
132
+ break;
133
+ }
134
+
135
+ _values$2 = values[0], src = _values$2.src, dst = _values$2.dst;
136
+
137
+ if (!(src.sub === link.interfaceSource && dst.sub === link.interfaceTarget)) {
138
+ _context.next = 8;
139
+ break;
140
+ }
141
+
142
+ saveCb({
143
+ changed: false
144
+ });
145
+ return _context.abrupt("return");
146
+
147
+ case 8:
148
+ _context.next = 10;
149
+ return execSave({
150
+ link: link,
151
+ values: values
152
+ });
153
+
154
+ case 10:
155
+ case "end":
156
+ return _context.stop();
157
157
  }
158
158
  }, _callee);
159
- }));
160
-
161
- return function onSave() {
162
- return _ref3.apply(this, arguments);
163
- };
164
- }();
159
+ }))).apply(this, arguments);
160
+ };
165
161
 
166
162
  var formProp = {
167
163
  link: link,
@@ -1,5 +1,8 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
+
4
+ var _addLinkData, _buildData, _getTopoData;
5
+
3
6
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
7
  import { getLinksDetail } from "../core/models/utils/linkUtils";
5
8
  import { addTopoDataResourcePermission } from "./utils/resourcePermissionUtil"; // import "./utils/__tests__/resourcePermissionUtil.test";
@@ -61,112 +64,90 @@ function isNetworkLink(link) {
61
64
  }
62
65
 
63
66
  export function addLinkData(_x) {
64
- return _addLinkData.apply(this, arguments);
65
- } // FIXME 业务拓扑不需要链路相关逻辑
66
-
67
- function _addLinkData() {
68
- _addLinkData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
67
+ return (_addLinkData = _addLinkData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
69
68
  var links, nodes, prevNetworkLinks, networkLinks, otherLinks;
70
69
  return _regeneratorRuntime.wrap(function _callee$(_context) {
71
- while (1) {
72
- switch (_context.prev = _context.next) {
73
- case 0:
74
- links = data.links || [];
75
- nodes = data.nodes || []; // 如果是网络链路,补充详情信息
76
-
77
- prevNetworkLinks = links.filter(function (link) {
78
- return isNetworkLink(link);
79
- });
80
- _context.next = 5;
81
- return getLinksDetail(prevNetworkLinks, nodes);
82
-
83
- case 5:
84
- networkLinks = _context.sent;
85
- otherLinks = links.filter(function (link) {
86
- return !isNetworkLink(link);
87
- });
88
- return _context.abrupt("return", _extends({}, data, {
89
- links: [].concat(networkLinks, otherLinks),
90
- linkGroups: []
91
- }));
92
-
93
- case 8:
94
- case "end":
95
- return _context.stop();
96
- }
70
+ while (1) switch (_context.prev = _context.next) {
71
+ case 0:
72
+ links = data.links || [];
73
+ nodes = data.nodes || []; // 如果是网络链路,补充详情信息
74
+
75
+ prevNetworkLinks = links.filter(function (link) {
76
+ return isNetworkLink(link);
77
+ });
78
+ _context.next = 5;
79
+ return getLinksDetail(prevNetworkLinks, nodes);
80
+
81
+ case 5:
82
+ networkLinks = _context.sent;
83
+ otherLinks = links.filter(function (link) {
84
+ return !isNetworkLink(link);
85
+ });
86
+ return _context.abrupt("return", _extends({}, data, {
87
+ links: [].concat(networkLinks, otherLinks),
88
+ linkGroups: []
89
+ }));
90
+
91
+ case 8:
92
+ case "end":
93
+ return _context.stop();
97
94
  }
98
95
  }, _callee);
99
- }));
100
- return _addLinkData.apply(this, arguments);
101
- }
96
+ }))).apply(this, arguments);
97
+ } // FIXME 业务拓扑不需要链路相关逻辑
102
98
 
103
99
  export function buildData(_x2) {
104
- return _buildData.apply(this, arguments);
105
- }
106
-
107
- function _buildData() {
108
- _buildData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(oldData) {
100
+ return (_buildData = _buildData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(oldData) {
109
101
  var data;
110
102
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
111
- while (1) {
112
- switch (_context2.prev = _context2.next) {
113
- case 0:
114
- data = oldData;
115
- data = fixNodeGroupId(data);
116
- data = filterLinkNoSourceTarget(data); // data = await addLinkData(data)
117
-
118
- data = addTopoDataResourcePermission(data);
119
- return _context2.abrupt("return", data);
120
-
121
- case 5:
122
- case "end":
123
- return _context2.stop();
124
- }
103
+ while (1) switch (_context2.prev = _context2.next) {
104
+ case 0:
105
+ data = oldData;
106
+ data = fixNodeGroupId(data);
107
+ data = filterLinkNoSourceTarget(data); // data = await addLinkData(data)
108
+
109
+ data = addTopoDataResourcePermission(data);
110
+ return _context2.abrupt("return", data);
111
+
112
+ case 5:
113
+ case "end":
114
+ return _context2.stop();
125
115
  }
126
116
  }, _callee2);
127
- }));
128
- return _buildData.apply(this, arguments);
117
+ }))).apply(this, arguments);
129
118
  }
130
-
131
119
  export default function getTopoData(_x3, _x4) {
132
- return _getTopoData.apply(this, arguments);
133
- }
134
-
135
- function _getTopoData() {
136
- _getTopoData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, topoService) {
120
+ return (_getTopoData = _getTopoData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, topoService) {
137
121
  var data;
138
122
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
139
- while (1) {
140
- switch (_context3.prev = _context3.next) {
141
- case 0:
142
- _context3.next = 2;
143
- return topoService.getTopoData(id);
144
-
145
- case 2:
146
- data = _context3.sent;
147
-
148
- if (data) {
149
- _context3.next = 5;
150
- break;
151
- }
152
-
153
- return _context3.abrupt("return", data);
154
-
155
- case 5:
156
- data = fixAlarmConfig(data);
157
- _context3.next = 8;
158
- return buildData(data);
159
-
160
- case 8:
161
- data = _context3.sent;
162
- return _context3.abrupt("return", data);
163
-
164
- case 10:
165
- case "end":
166
- return _context3.stop();
167
- }
123
+ while (1) switch (_context3.prev = _context3.next) {
124
+ case 0:
125
+ _context3.next = 2;
126
+ return topoService.getTopoData(id);
127
+
128
+ case 2:
129
+ data = _context3.sent;
130
+
131
+ if (data) {
132
+ _context3.next = 5;
133
+ break;
134
+ }
135
+
136
+ return _context3.abrupt("return", data);
137
+
138
+ case 5:
139
+ data = fixAlarmConfig(data);
140
+ _context3.next = 8;
141
+ return buildData(data);
142
+
143
+ case 8:
144
+ data = _context3.sent;
145
+ return _context3.abrupt("return", data);
146
+
147
+ case 10:
148
+ case "end":
149
+ return _context3.stop();
168
150
  }
169
151
  }, _callee3);
170
- }));
171
- return _getTopoData.apply(this, arguments);
152
+ }))).apply(this, arguments);
172
153
  }
@@ -12,6 +12,8 @@ import { loopTreeFun } from "../../../utils/tree";
12
12
  */
13
13
 
14
14
  export default function useRelateTopo(params) {
15
+ var _openLinkedTopo;
16
+
15
17
  var topo = params.topo;
16
18
  var store = topo.store;
17
19
  var topoState = store.useModelState('topoMod');
@@ -54,51 +56,44 @@ export default function useRelateTopo(params) {
54
56
 
55
57
 
56
58
  function openLinkedTopo(_x) {
57
- return _openLinkedTopo.apply(this, arguments);
58
- }
59
-
60
- function _openLinkedTopo() {
61
- _openLinkedTopo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(topoId) {
59
+ return (_openLinkedTopo = _openLinkedTopo || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(topoId) {
62
60
  var thumbnailImg;
63
61
  return _regeneratorRuntime.wrap(function _callee$(_context) {
64
- while (1) {
65
- switch (_context.prev = _context.next) {
66
- case 0:
67
- rlog.info('打开关联拓扑图', topoId);
68
-
69
- if (checkTopoExisted(topoId)) {
70
- _context.next = 4;
71
- break;
72
- }
73
-
74
- rlog.error('关联拓扑图不存在:', topoId);
75
- return _context.abrupt("return");
76
-
77
- case 4:
78
- _context.next = 6;
79
- return topo.getHtTopo().createThumbnail();
80
-
81
- case 6:
82
- thumbnailImg = _context.sent;
83
- // 打开新拓扑,传递缩略图和原拓扑id
84
- topoCenterDispatchers.openTopoPage({
85
- id: topoId,
86
- linkTo: {
87
- img: thumbnailImg,
88
- sourceTopo: {
89
- id: topoState.topoId
90
- }
62
+ while (1) switch (_context.prev = _context.next) {
63
+ case 0:
64
+ rlog.info('打开关联拓扑图', topoId);
65
+
66
+ if (checkTopoExisted(topoId)) {
67
+ _context.next = 4;
68
+ break;
69
+ }
70
+
71
+ rlog.error('关联拓扑图不存在:', topoId);
72
+ return _context.abrupt("return");
73
+
74
+ case 4:
75
+ _context.next = 6;
76
+ return topo.getHtTopo().createThumbnail();
77
+
78
+ case 6:
79
+ thumbnailImg = _context.sent;
80
+ // 打开新拓扑,传递缩略图和原拓扑id
81
+ topoCenterDispatchers.openTopoPage({
82
+ id: topoId,
83
+ linkTo: {
84
+ img: thumbnailImg,
85
+ sourceTopo: {
86
+ id: topoState.topoId
91
87
  }
92
- });
88
+ }
89
+ });
93
90
 
94
- case 8:
95
- case "end":
96
- return _context.stop();
97
- }
91
+ case 8:
92
+ case "end":
93
+ return _context.stop();
98
94
  }
99
95
  }, _callee);
100
- }));
101
- return _openLinkedTopo.apply(this, arguments);
96
+ }))).apply(this, arguments);
102
97
  }
103
98
 
104
99
  function returnSourceTopo(data) {
@@ -39,6 +39,7 @@ var getChildrenNodeCiIds = function getChildrenNodeCiIds(nodes) {
39
39
 
40
40
  var LinkDynamicStyleExecutor = /*#__PURE__*/function () {
41
41
  function LinkDynamicStyleExecutor(topo) {
42
+ // network_link.actual_bandwidth
42
43
  this.calcEdgeWidth = calcEdgeWidth;
43
44
  this.topo = topo;
44
45
  }
@@ -196,8 +197,7 @@ var LinkDynamicStyleExecutor = /*#__PURE__*/function () {
196
197
  }
197
198
 
198
199
  return this.calcEdgeWidth(link.attributes['network_link.actual_bandwidth']);
199
- } // network_link.actual_bandwidth
200
- ;
200
+ };
201
201
 
202
202
  return LinkDynamicStyleExecutor;
203
203
  }();
@@ -12,6 +12,8 @@ import { DEFAULT_LINK_TAG_COMMON_CONFIG, DEFAULT_TIP_COMMON_CONFIG } from "../..
12
12
  import ExtElementTagTipBuilder from "./ExtElementTagTipBuilder";
13
13
 
14
14
  var TopoCenter = /*#__PURE__*/function (_TopoApp) {
15
+ var _initData, _exit;
16
+
15
17
  _inheritsLoose(TopoCenter, _TopoApp);
16
18
 
17
19
  function TopoCenter(options) {
@@ -49,33 +51,23 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
49
51
 
50
52
  var _proto = TopoCenter.prototype;
51
53
 
52
- _proto.initData =
53
- /*#__PURE__*/
54
- function () {
55
- var _initData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
54
+ _proto.initData = function initData(_x) {
55
+ return (_initData = _initData || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
56
56
  var topoDispatchers;
57
57
  return _regeneratorRuntime.wrap(function _callee$(_context) {
58
- while (1) {
59
- switch (_context.prev = _context.next) {
60
- case 0:
61
- topoDispatchers = this.store.getModelDispatchers('topoCenter');
62
- _context.next = 3;
63
- return topoDispatchers.initData(params);
64
-
65
- case 3:
66
- case "end":
67
- return _context.stop();
68
- }
58
+ while (1) switch (_context.prev = _context.next) {
59
+ case 0:
60
+ topoDispatchers = this.store.getModelDispatchers('topoCenter');
61
+ _context.next = 3;
62
+ return topoDispatchers.initData(params);
63
+
64
+ case 3:
65
+ case "end":
66
+ return _context.stop();
69
67
  }
70
68
  }, _callee, this);
71
- }));
72
-
73
- function initData(_x) {
74
- return _initData.apply(this, arguments);
75
- }
76
-
77
- return initData;
78
- }();
69
+ }))).apply(this, arguments);
70
+ };
79
71
 
80
72
  _proto.openTopo = function openTopo(params) {
81
73
  var topoDispatchers = this.store.getModelDispatchers('topoCenter');
@@ -86,33 +78,23 @@ var TopoCenter = /*#__PURE__*/function (_TopoApp) {
86
78
  */
87
79
  ;
88
80
 
89
- _proto.exit =
90
- /*#__PURE__*/
91
- function () {
92
- var _exit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
81
+ _proto.exit = function exit() {
82
+ return (_exit = _exit || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
93
83
  var topoDispatchers;
94
84
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
95
- while (1) {
96
- switch (_context2.prev = _context2.next) {
97
- case 0:
98
- topoDispatchers = this.store.getModelDispatchers('topoCenter');
99
- _context2.next = 3;
100
- return topoDispatchers.exit();
101
-
102
- case 3:
103
- case "end":
104
- return _context2.stop();
105
- }
85
+ while (1) switch (_context2.prev = _context2.next) {
86
+ case 0:
87
+ topoDispatchers = this.store.getModelDispatchers('topoCenter');
88
+ _context2.next = 3;
89
+ return topoDispatchers.exit();
90
+
91
+ case 3:
92
+ case "end":
93
+ return _context2.stop();
106
94
  }
107
95
  }, _callee2, this);
108
- }));
109
-
110
- function exit() {
111
- return _exit.apply(this, arguments);
112
- }
113
-
114
- return exit;
115
- }();
96
+ }))).apply(this, arguments);
97
+ };
116
98
 
117
99
  _proto.getResourceConfigManager = function getResourceConfigManager() {
118
100
  return this.resourceConfig;
@@ -9,19 +9,17 @@ export default {
9
9
  getAlarmByIds: function getAlarmByIds(params) {
10
10
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
11
11
  return _regeneratorRuntime.wrap(function _callee$(_context) {
12
- while (1) {
13
- switch (_context.prev = _context.next) {
14
- case 0:
15
- _context.next = 2;
16
- return request.post('/alert/v1/api/alert/getAlertListInResource', params);
12
+ while (1) switch (_context.prev = _context.next) {
13
+ case 0:
14
+ _context.next = 2;
15
+ return request.post('/alert/v1/api/alert/getAlertListInResource', params);
17
16
 
18
- case 2:
19
- return _context.abrupt("return", _context.sent);
17
+ case 2:
18
+ return _context.abrupt("return", _context.sent);
20
19
 
21
- case 3:
22
- case "end":
23
- return _context.stop();
24
- }
20
+ case 3:
21
+ case "end":
22
+ return _context.stop();
25
23
  }
26
24
  }, _callee);
27
25
  }))();
@@ -35,19 +33,17 @@ export default {
35
33
  getCisComponentIds: function getCisComponentIds(params) {
36
34
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
37
35
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
38
- while (1) {
39
- switch (_context2.prev = _context2.next) {
40
- case 0:
41
- _context2.next = 2;
42
- return request.post('/topo/v1/api/structure/componentIds', params);
36
+ while (1) switch (_context2.prev = _context2.next) {
37
+ case 0:
38
+ _context2.next = 2;
39
+ return request.post('/topo/v1/api/structure/componentIds', params);
43
40
 
44
- case 2:
45
- return _context2.abrupt("return", _context2.sent);
41
+ case 2:
42
+ return _context2.abrupt("return", _context2.sent);
46
43
 
47
- case 3:
48
- case "end":
49
- return _context2.stop();
50
- }
44
+ case 3:
45
+ case "end":
46
+ return _context2.stop();
51
47
  }
52
48
  }, _callee2);
53
49
  }))();