@riil-frontend/component-topology 11.0.36 → 11.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +2 -4
  4. package/build/index.js +34 -49
  5. package/es/components/MultiResourceDrawer/index.js +18 -16
  6. package/es/components/ResourceList/ResourceSelect.js +50 -48
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +26 -24
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +20 -18
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +25 -23
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
  11. package/es/core/components/titlebar/widgets/TitleWidget.js +3 -5
  12. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
  13. package/es/core/editor/components/BackgroundView/index.js +129 -119
  14. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -20
  15. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
  16. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +17 -15
  17. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +9 -7
  18. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
  19. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
  20. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
  21. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +13 -11
  22. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +23 -21
  23. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
  24. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -10
  25. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +27 -21
  26. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  27. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  28. package/es/core/editor/store/background.js +10 -8
  29. package/es/core/editor/store/topoEdit.js +6 -4
  30. package/es/core/editor/utils/edgeTypeStyleUtil.js +4 -2
  31. package/es/core/hooks/usePolling.js +121 -117
  32. package/es/core/hooks/useResourceConfig.js +66 -58
  33. package/es/core/hooks/useTopoEdit.js +511 -476
  34. package/es/core/models/Alarm.js +298 -281
  35. package/es/core/models/AttributeMetricDisplay.js +107 -101
  36. package/es/core/models/PluginManager.js +3 -4
  37. package/es/core/models/SelectionModel.js +5 -4
  38. package/es/core/models/TopoApp.js +240 -205
  39. package/es/core/models/TopoGraphView.js +21 -18
  40. package/es/core/models/cache/CiCache.js +27 -28
  41. package/es/core/models/cache/CiTypeCache.js +41 -37
  42. package/es/core/models/cache/DictCache.js +35 -33
  43. package/es/core/models/graph/Background.js +17 -15
  44. package/es/core/models/plugins/resourceWebControllUrl.js +82 -76
  45. package/es/core/models/tagstips/ElementTagTipConfig.js +38 -34
  46. package/es/core/models/topoData.js +70 -68
  47. package/es/core/models/utils/linkUtils.js +43 -41
  48. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  49. package/es/core/services/alarm.js +16 -14
  50. package/es/core/services/background.js +67 -59
  51. package/es/core/services/cmdb/metric.js +11 -9
  52. package/es/core/services/cmdb.js +20 -18
  53. package/es/core/services/index.js +45 -39
  54. package/es/core/services/overview.js +151 -131
  55. package/es/core/services/topo/basic.js +41 -37
  56. package/es/core/services/topo/tagtip.js +12 -10
  57. package/es/core/store/models/ciModel.js +62 -58
  58. package/es/core/store/models/customIcon.js +134 -120
  59. package/es/core/store/models/displayConfig.js +19 -15
  60. package/es/core/store/models/selection.js +6 -4
  61. package/es/core/store/models/topoAlarm.js +145 -162
  62. package/es/core/store/models/topoBaseInfoOverview.js +6 -4
  63. package/es/core/store/models/topoBizMod.js +11 -9
  64. package/es/core/store/models/topoConfig.js +231 -215
  65. package/es/core/store/models/topoGraphView.js +6 -4
  66. package/es/core/store/models/topoMod.js +395 -373
  67. package/es/core/utils/imageUtil.js +20 -18
  68. package/es/core/utils/saveSerialize.js +11 -9
  69. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +29 -28
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +357 -343
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +205 -189
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +111 -107
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +37 -33
  78. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
  79. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
  80. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +19 -17
  81. package/es/networkTopo/components/Link/hook.js +77 -73
  82. package/es/networkTopo/components/Link/index.js +94 -86
  83. package/es/networkTopo/components/Link/setting.js +44 -42
  84. package/es/networkTopo/getTopoData.js +69 -63
  85. package/es/networkTopo/hooks/viewer/useRelateTopo.js +32 -30
  86. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  87. package/es/networkTopo/models/TopoCenter.js +22 -18
  88. package/es/networkTopo/services/alert.js +22 -18
  89. package/es/networkTopo/services/authorization.js +55 -45
  90. package/es/networkTopo/services/cmdb.js +470 -422
  91. package/es/networkTopo/services/funcAuth.js +24 -22
  92. package/es/networkTopo/services/link.js +117 -107
  93. package/es/networkTopo/services/mdc.js +24 -18
  94. package/es/networkTopo/services/metric.js +27 -23
  95. package/es/networkTopo/services/model.js +509 -445
  96. package/es/networkTopo/services/risk.js +11 -9
  97. package/es/networkTopo/services/topo/auth.js +33 -27
  98. package/es/networkTopo/services/topo/basic.js +289 -251
  99. package/es/networkTopo/services/topo/blacklist.js +24 -20
  100. package/es/networkTopo/services/topo/ciInfo.js +31 -27
  101. package/es/networkTopo/services/topo/icon.js +59 -49
  102. package/es/networkTopo/services/topo/networkLink.js +36 -32
  103. package/es/networkTopo/services/topo/relation.js +11 -9
  104. package/es/networkTopo/services/topo/resourceWebUrl.js +42 -36
  105. package/es/networkTopo/store/functionAuth.js +37 -31
  106. package/es/networkTopo/store/topoCenter.js +152 -142
  107. package/es/networkTopo/store/topoLinkMod.js +6 -4
  108. package/es/networkTopo/store/topoTreeMod.js +182 -170
  109. package/es/networkTopo/utils/exportData.js +54 -52
  110. package/lib/components/MultiResourceDrawer/index.js +18 -16
  111. package/lib/components/ResourceList/ResourceSelect.js +50 -48
  112. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +29 -27
  113. package/lib/components/SingleResourceDrawer/SelectDrawer.js +20 -18
  114. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +32 -30
  115. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
  116. package/lib/core/components/titlebar/widgets/TitleWidget.js +3 -5
  117. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
  118. package/lib/core/editor/components/BackgroundView/index.js +128 -118
  119. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +24 -22
  120. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
  121. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +21 -19
  122. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +10 -8
  123. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
  124. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
  125. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
  126. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +14 -12
  127. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +28 -26
  128. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
  129. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +14 -12
  130. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +31 -25
  131. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  132. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  133. package/lib/core/editor/store/background.js +10 -8
  134. package/lib/core/editor/store/topoEdit.js +6 -4
  135. package/lib/core/editor/utils/edgeTypeStyleUtil.js +4 -2
  136. package/lib/core/hooks/usePolling.js +120 -116
  137. package/lib/core/hooks/useResourceConfig.js +66 -58
  138. package/lib/core/hooks/useTopoEdit.js +503 -468
  139. package/lib/core/models/Alarm.js +292 -275
  140. package/lib/core/models/AttributeMetricDisplay.js +110 -104
  141. package/lib/core/models/PluginManager.js +3 -4
  142. package/lib/core/models/SelectionModel.js +5 -4
  143. package/lib/core/models/TopoApp.js +240 -205
  144. package/lib/core/models/TopoGraphView.js +21 -18
  145. package/lib/core/models/cache/CiCache.js +32 -33
  146. package/lib/core/models/cache/CiTypeCache.js +42 -38
  147. package/lib/core/models/cache/DictCache.js +35 -33
  148. package/lib/core/models/graph/Background.js +18 -16
  149. package/lib/core/models/plugins/resourceWebControllUrl.js +80 -74
  150. package/lib/core/models/tagstips/ElementTagTipConfig.js +38 -34
  151. package/lib/core/models/topoData.js +71 -69
  152. package/lib/core/models/utils/linkUtils.js +43 -41
  153. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  154. package/lib/core/services/alarm.js +20 -18
  155. package/lib/core/services/background.js +78 -70
  156. package/lib/core/services/cmdb/metric.js +12 -10
  157. package/lib/core/services/cmdb.js +22 -20
  158. package/lib/core/services/index.js +51 -45
  159. package/lib/core/services/overview.js +151 -131
  160. package/lib/core/services/topo/basic.js +41 -37
  161. package/lib/core/services/topo/tagtip.js +14 -12
  162. package/lib/core/store/models/ciModel.js +70 -66
  163. package/lib/core/store/models/customIcon.js +134 -120
  164. package/lib/core/store/models/displayConfig.js +19 -15
  165. package/lib/core/store/models/selection.js +6 -4
  166. package/lib/core/store/models/topoAlarm.js +145 -163
  167. package/lib/core/store/models/topoBaseInfoOverview.js +6 -4
  168. package/lib/core/store/models/topoBizMod.js +11 -9
  169. package/lib/core/store/models/topoConfig.js +238 -222
  170. package/lib/core/store/models/topoGraphView.js +6 -4
  171. package/lib/core/store/models/topoMod.js +397 -375
  172. package/lib/core/utils/imageUtil.js +24 -22
  173. package/lib/core/utils/saveSerialize.js +11 -9
  174. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
  175. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +29 -28
  176. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +358 -344
  177. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
  178. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
  179. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +206 -190
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +111 -107
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -29
  183. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
  184. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
  185. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +20 -18
  186. package/lib/networkTopo/components/Link/hook.js +77 -73
  187. package/lib/networkTopo/components/Link/index.js +95 -87
  188. package/lib/networkTopo/components/Link/setting.js +44 -42
  189. package/lib/networkTopo/getTopoData.js +69 -63
  190. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +33 -31
  191. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  192. package/lib/networkTopo/models/TopoCenter.js +22 -18
  193. package/lib/networkTopo/services/alert.js +22 -18
  194. package/lib/networkTopo/services/authorization.js +65 -55
  195. package/lib/networkTopo/services/cmdb.js +470 -422
  196. package/lib/networkTopo/services/funcAuth.js +26 -24
  197. package/lib/networkTopo/services/link.js +118 -108
  198. package/lib/networkTopo/services/mdc.js +27 -21
  199. package/lib/networkTopo/services/metric.js +31 -27
  200. package/lib/networkTopo/services/model.js +509 -445
  201. package/lib/networkTopo/services/risk.js +13 -11
  202. package/lib/networkTopo/services/topo/auth.js +33 -27
  203. package/lib/networkTopo/services/topo/basic.js +290 -252
  204. package/lib/networkTopo/services/topo/blacklist.js +24 -20
  205. package/lib/networkTopo/services/topo/ciInfo.js +38 -34
  206. package/lib/networkTopo/services/topo/icon.js +69 -59
  207. package/lib/networkTopo/services/topo/networkLink.js +36 -32
  208. package/lib/networkTopo/services/topo/relation.js +13 -11
  209. package/lib/networkTopo/services/topo/resourceWebUrl.js +50 -44
  210. package/lib/networkTopo/store/functionAuth.js +37 -31
  211. package/lib/networkTopo/store/topoCenter.js +152 -142
  212. package/lib/networkTopo/store/topoLinkMod.js +6 -4
  213. package/lib/networkTopo/store/topoTreeMod.js +178 -166
  214. package/lib/networkTopo/utils/exportData.js +61 -59
  215. package/lib/utils/htElementDataUtil.js +2 -4
  216. package/package.json +3 -3
@@ -115,62 +115,64 @@ function _updateLink() {
115
115
  _updateLink = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(oldLink, params) {
116
116
  var result, src, dst, srcRelation, dstRelation, srcIsCurrentRelation, dstIsCurrentRelation, onlyChangeOneEnd, createResult;
117
117
  return _regenerator["default"].wrap(function _callee$(_context) {
118
- while (1) switch (_context.prev = _context.next) {
119
- case 0:
120
- result = {
121
- oldId: oldLink.id
122
- };
123
- src = params.src, dst = params.dst; // 如果只修改一端,则先删除再新建
124
-
125
- _context.next = 4;
126
- return cmdbService.queryRelationByEndpoint(src.sub);
127
-
128
- case 4:
129
- srcRelation = _context.sent;
130
- _context.next = 7;
131
- return cmdbService.queryRelationByEndpoint(dst.sub);
132
-
133
- case 7:
134
- dstRelation = _context.sent;
135
- srcIsCurrentRelation = srcRelation && srcRelation.id === oldLink.id && !dstRelation;
136
- dstIsCurrentRelation = dstRelation && dstRelation.id === oldLink.id && !srcRelation;
137
- onlyChangeOneEnd = srcIsCurrentRelation || dstIsCurrentRelation;
138
-
139
- if (!onlyChangeOneEnd) {
118
+ while (1) {
119
+ switch (_context.prev = _context.next) {
120
+ case 0:
121
+ result = {
122
+ oldId: oldLink.id
123
+ };
124
+ src = params.src, dst = params.dst; // 如果只修改一端,则先删除再新建
125
+
126
+ _context.next = 4;
127
+ return cmdbService.queryRelationByEndpoint(src.sub);
128
+
129
+ case 4:
130
+ srcRelation = _context.sent;
131
+ _context.next = 7;
132
+ return cmdbService.queryRelationByEndpoint(dst.sub);
133
+
134
+ case 7:
135
+ dstRelation = _context.sent;
136
+ srcIsCurrentRelation = srcRelation && srcRelation.id === oldLink.id && !dstRelation;
137
+ dstIsCurrentRelation = dstRelation && dstRelation.id === oldLink.id && !srcRelation;
138
+ onlyChangeOneEnd = srcIsCurrentRelation || dstIsCurrentRelation;
139
+
140
+ if (!onlyChangeOneEnd) {
141
+ _context.next = 14;
142
+ break;
143
+ }
144
+
140
145
  _context.next = 14;
141
- break;
142
- }
146
+ return cmdbService.forceDeleteRelation(oldLink.id);
143
147
 
144
- _context.next = 14;
145
- return cmdbService.forceDeleteRelation(oldLink.id);
148
+ case 14:
149
+ _context.next = 16;
150
+ return cmdbService.batchCreateRelation([buildCreateLinkParams(params, 0)]);
146
151
 
147
- case 14:
148
- _context.next = 16;
149
- return cmdbService.batchCreateRelation([buildCreateLinkParams(params, 0)]);
152
+ case 16:
153
+ createResult = _context.sent;
154
+ Object.assign(result, createResult[0]);
150
155
 
151
- case 16:
152
- createResult = _context.sent;
153
- Object.assign(result, createResult[0]);
156
+ if (!(result.status === 0)) {
157
+ _context.next = 22;
158
+ break;
159
+ }
154
160
 
155
- if (!(result.status === 0)) {
156
- _context.next = 22;
157
- break;
158
- }
161
+ if (onlyChangeOneEnd) {
162
+ _context.next = 22;
163
+ break;
164
+ }
159
165
 
160
- if (onlyChangeOneEnd) {
161
166
  _context.next = 22;
162
- break;
163
- }
164
-
165
- _context.next = 22;
166
- return cmdbService.forceDeleteRelation(oldLink.id);
167
+ return cmdbService.forceDeleteRelation(oldLink.id);
167
168
 
168
- case 22:
169
- return _context.abrupt("return", result);
169
+ case 22:
170
+ return _context.abrupt("return", result);
170
171
 
171
- case 23:
172
- case "end":
173
- return _context.stop();
172
+ case 23:
173
+ case "end":
174
+ return _context.stop();
175
+ }
174
176
  }
175
177
  }, _callee);
176
178
  }));
@@ -193,32 +195,34 @@ function _saveLink() {
193
195
  var link, values, params, result, _params;
194
196
 
195
197
  return _regenerator["default"].wrap(function _callee2$(_context2) {
196
- while (1) switch (_context2.prev = _context2.next) {
197
- case 0:
198
- link = _ref2.link, values = _ref2.values;
199
-
200
- if (!link) {
201
- _context2.next = 9;
202
- break;
203
- }
204
-
205
- params = values[0];
206
- _context2.next = 5;
207
- return updateLink(link, params);
208
-
209
- case 5:
210
- result = _context2.sent;
211
- return _context2.abrupt("return", [result]);
212
-
213
- case 9:
214
- _params = values.map(function (item, index) {
215
- return buildCreateLinkParams(item, index);
216
- });
217
- return _context2.abrupt("return", cmdbService.batchCreateRelation(_params));
218
-
219
- case 11:
220
- case "end":
221
- return _context2.stop();
198
+ while (1) {
199
+ switch (_context2.prev = _context2.next) {
200
+ case 0:
201
+ link = _ref2.link, values = _ref2.values;
202
+
203
+ if (!link) {
204
+ _context2.next = 9;
205
+ break;
206
+ }
207
+
208
+ params = values[0];
209
+ _context2.next = 5;
210
+ return updateLink(link, params);
211
+
212
+ case 5:
213
+ result = _context2.sent;
214
+ return _context2.abrupt("return", [result]);
215
+
216
+ case 9:
217
+ _params = values.map(function (item, index) {
218
+ return buildCreateLinkParams(item, index);
219
+ });
220
+ return _context2.abrupt("return", cmdbService.batchCreateRelation(_params));
221
+
222
+ case 11:
223
+ case "end":
224
+ return _context2.stop();
225
+ }
222
226
  }
223
227
  }, _callee2);
224
228
  }));
@@ -105,23 +105,25 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
105
105
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
106
106
  var data;
107
107
  return _regenerator["default"].wrap(function _callee$(_context) {
108
- while (1) switch (_context.prev = _context.next) {
109
- case 0:
110
- _rlog["default"].debug('useTopoEdit.refreshLink');
111
-
112
- _context.next = 3;
113
- return editDispatchers.fetchData();
114
-
115
- case 3:
116
- data = _context.sent;
117
- topo.view.topoClient.emitEvent(_componentTopologyGraph.TopoEvent.EVENT_DATA_RESULT, {
118
- type: _componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO,
119
- data: data
120
- });
121
-
122
- case 5:
123
- case "end":
124
- return _context.stop();
108
+ while (1) {
109
+ switch (_context.prev = _context.next) {
110
+ case 0:
111
+ _rlog["default"].debug('useTopoEdit.refreshLink');
112
+
113
+ _context.next = 3;
114
+ return editDispatchers.fetchData();
115
+
116
+ case 3:
117
+ data = _context.sent;
118
+ topo.view.topoClient.emitEvent(_componentTopologyGraph.TopoEvent.EVENT_DATA_RESULT, {
119
+ type: _componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO,
120
+ data: data
121
+ });
122
+
123
+ case 5:
124
+ case "end":
125
+ return _context.stop();
126
+ }
125
127
  }
126
128
  }, _callee);
127
129
  }));
@@ -135,20 +137,22 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
135
137
  var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
136
138
  var data;
137
139
  return _regenerator["default"].wrap(function _callee2$(_context2) {
138
- while (1) switch (_context2.prev = _context2.next) {
139
- case 0:
140
- _context2.next = 2;
141
- return editDispatchers.fetchData();
142
-
143
- case 2:
144
- data = _context2.sent;
145
- return _context2.abrupt("return", data.filter(function (item) {
146
- return item.id === id;
147
- })[0]);
148
-
149
- case 4:
150
- case "end":
151
- return _context2.stop();
140
+ while (1) {
141
+ switch (_context2.prev = _context2.next) {
142
+ case 0:
143
+ _context2.next = 2;
144
+ return editDispatchers.fetchData();
145
+
146
+ case 2:
147
+ data = _context2.sent;
148
+ return _context2.abrupt("return", data.filter(function (item) {
149
+ return item.id === id;
150
+ })[0]);
151
+
152
+ case 4:
153
+ case "end":
154
+ return _context2.stop();
155
+ }
152
156
  }
153
157
  }, _callee2);
154
158
  }));
@@ -160,48 +164,50 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
160
164
 
161
165
  var updateTopo = (0, _react.useCallback)( /*#__PURE__*/function () {
162
166
  var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(data) {
163
- var changed, isAdd, _data$result$2, oldId, id, linkData;
167
+ var changed, isAdd, _data$result$, oldId, id, linkData;
164
168
 
165
169
  return _regenerator["default"].wrap(function _callee3$(_context3) {
166
- while (1) switch (_context3.prev = _context3.next) {
167
- case 0:
168
- changed = data.changed, isAdd = data.isAddMode;
170
+ while (1) {
171
+ switch (_context3.prev = _context3.next) {
172
+ case 0:
173
+ changed = data.changed, isAdd = data.isAddMode;
169
174
 
170
- if (!(changed === false)) {
171
- _context3.next = 3;
172
- break;
173
- }
175
+ if (!(changed === false)) {
176
+ _context3.next = 3;
177
+ break;
178
+ }
179
+
180
+ return _context3.abrupt("return");
181
+
182
+ case 3:
183
+ if (!isAdd) {
184
+ _context3.next = 8;
185
+ break;
186
+ }
174
187
 
175
- return _context3.abrupt("return");
188
+ _context3.next = 6;
189
+ return refreshLink();
176
190
 
177
- case 3:
178
- if (!isAdd) {
179
- _context3.next = 8;
191
+ case 6:
192
+ _context3.next = 13;
180
193
  break;
181
- }
182
-
183
- _context3.next = 6;
184
- return refreshLink();
185
-
186
- case 6:
187
- _context3.next = 13;
188
- break;
189
-
190
- case 8:
191
- _data$result$2 = data.result[0], oldId = _data$result$2.oldId, id = _data$result$2.id;
192
- _context3.next = 11;
193
- return getLink(id);
194
-
195
- case 11:
196
- linkData = _context3.sent;
197
- topo.view.topoClient.emitEvent('topo_link_update', {
198
- id: oldId,
199
- link: linkData
200
- });
201
-
202
- case 13:
203
- case "end":
204
- return _context3.stop();
194
+
195
+ case 8:
196
+ _data$result$ = data.result[0], oldId = _data$result$.oldId, id = _data$result$.id;
197
+ _context3.next = 11;
198
+ return getLink(id);
199
+
200
+ case 11:
201
+ linkData = _context3.sent;
202
+ topo.view.topoClient.emitEvent('topo_link_update', {
203
+ id: oldId,
204
+ link: linkData
205
+ });
206
+
207
+ case 13:
208
+ case "end":
209
+ return _context3.stop();
210
+ }
205
211
  }
206
212
  }, _callee3);
207
213
  }));
@@ -214,26 +220,28 @@ var LinkDrawer = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
214
220
  var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(data) {
215
221
  var errorItems;
216
222
  return _regenerator["default"].wrap(function _callee4$(_context4) {
217
- while (1) switch (_context4.prev = _context4.next) {
218
- case 0:
219
- errorItems = data.errorItems;
220
-
221
- if (errorItems.length) {
222
- _context4.next = 7;
223
- break;
224
- }
225
-
226
- setFalse();
227
- setUpdateTopoState(true);
228
- _context4.next = 6;
229
- return updateTopo(data);
230
-
231
- case 6:
232
- setUpdateTopoState(false);
233
-
234
- case 7:
235
- case "end":
236
- return _context4.stop();
223
+ while (1) {
224
+ switch (_context4.prev = _context4.next) {
225
+ case 0:
226
+ errorItems = data.errorItems;
227
+
228
+ if (errorItems.length) {
229
+ _context4.next = 7;
230
+ break;
231
+ }
232
+
233
+ setFalse();
234
+ setUpdateTopoState(true);
235
+ _context4.next = 6;
236
+ return updateTopo(data);
237
+
238
+ case 6:
239
+ setUpdateTopoState(false);
240
+
241
+ case 7:
242
+ case "end":
243
+ return _context4.stop();
244
+ }
237
245
  }
238
246
  }, _callee4);
239
247
  }));
@@ -136,50 +136,52 @@ var LinkSetting = function LinkSetting(_ref2) {
136
136
 
137
137
  var onSave = /*#__PURE__*/function () {
138
138
  var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
139
- var values, _values$2, src, dst;
139
+ var values, _values$, src, dst;
140
140
 
141
141
  return _regenerator["default"].wrap(function _callee$(_context) {
142
- while (1) switch (_context.prev = _context.next) {
143
- case 0:
144
- if (!(0, _utils.isAvailableArray)(getValidatorErrors())) {
145
- _context.next = 2;
146
- break;
147
- }
148
-
149
- return _context.abrupt("return");
150
-
151
- case 2:
152
- values = list.map(function (i, index) {
153
- return refs[index].field.getValues();
154
- });
155
-
156
- if (isAddMode) {
157
- _context.next = 8;
158
- break;
159
- }
160
-
161
- _values$2 = values[0], src = _values$2.src, dst = _values$2.dst;
162
-
163
- if (!(src.sub === link.interfaceSource && dst.sub === link.interfaceTarget)) {
164
- _context.next = 8;
165
- break;
166
- }
167
-
168
- saveCb({
169
- changed: false
170
- });
171
- return _context.abrupt("return");
172
-
173
- case 8:
174
- _context.next = 10;
175
- return execSave({
176
- link: link,
177
- values: values
178
- });
179
-
180
- case 10:
181
- case "end":
182
- return _context.stop();
142
+ while (1) {
143
+ switch (_context.prev = _context.next) {
144
+ case 0:
145
+ if (!(0, _utils.isAvailableArray)(getValidatorErrors())) {
146
+ _context.next = 2;
147
+ break;
148
+ }
149
+
150
+ return _context.abrupt("return");
151
+
152
+ case 2:
153
+ values = list.map(function (i, index) {
154
+ return refs[index].field.getValues();
155
+ });
156
+
157
+ if (isAddMode) {
158
+ _context.next = 8;
159
+ break;
160
+ }
161
+
162
+ _values$ = values[0], src = _values$.src, dst = _values$.dst;
163
+
164
+ if (!(src.sub === link.interfaceSource && dst.sub === link.interfaceTarget)) {
165
+ _context.next = 8;
166
+ break;
167
+ }
168
+
169
+ saveCb({
170
+ changed: false
171
+ });
172
+ return _context.abrupt("return");
173
+
174
+ case 8:
175
+ _context.next = 10;
176
+ return execSave({
177
+ link: link,
178
+ values: values
179
+ });
180
+
181
+ case 10:
182
+ case "end":
183
+ return _context.stop();
184
+ }
183
185
  }
184
186
  }, _callee);
185
187
  }));
@@ -83,30 +83,32 @@ function _addLinkData() {
83
83
  _addLinkData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
84
84
  var links, nodes, prevNetworkLinks, networkLinks, otherLinks;
85
85
  return _regenerator["default"].wrap(function _callee$(_context) {
86
- while (1) switch (_context.prev = _context.next) {
87
- case 0:
88
- links = data.links || [];
89
- nodes = data.nodes || []; // 如果是网络链路,补充详情信息
90
-
91
- prevNetworkLinks = links.filter(function (link) {
92
- return isNetworkLink(link);
93
- });
94
- _context.next = 5;
95
- return (0, _linkUtils.getLinksDetail)(prevNetworkLinks, nodes);
96
-
97
- case 5:
98
- networkLinks = _context.sent;
99
- otherLinks = links.filter(function (link) {
100
- return !isNetworkLink(link);
101
- });
102
- return _context.abrupt("return", (0, _extends2["default"])({}, data, {
103
- links: [].concat(networkLinks, otherLinks),
104
- linkGroups: []
105
- }));
106
-
107
- case 8:
108
- case "end":
109
- return _context.stop();
86
+ while (1) {
87
+ switch (_context.prev = _context.next) {
88
+ case 0:
89
+ links = data.links || [];
90
+ nodes = data.nodes || []; // 如果是网络链路,补充详情信息
91
+
92
+ prevNetworkLinks = links.filter(function (link) {
93
+ return isNetworkLink(link);
94
+ });
95
+ _context.next = 5;
96
+ return (0, _linkUtils.getLinksDetail)(prevNetworkLinks, nodes);
97
+
98
+ case 5:
99
+ networkLinks = _context.sent;
100
+ otherLinks = links.filter(function (link) {
101
+ return !isNetworkLink(link);
102
+ });
103
+ return _context.abrupt("return", (0, _extends2["default"])({}, data, {
104
+ links: [].concat(networkLinks, otherLinks),
105
+ linkGroups: []
106
+ }));
107
+
108
+ case 8:
109
+ case "end":
110
+ return _context.stop();
111
+ }
110
112
  }
111
113
  }, _callee);
112
114
  }));
@@ -121,18 +123,20 @@ function _buildData() {
121
123
  _buildData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(oldData) {
122
124
  var data;
123
125
  return _regenerator["default"].wrap(function _callee2$(_context2) {
124
- while (1) switch (_context2.prev = _context2.next) {
125
- case 0:
126
- data = oldData;
127
- data = fixNodeGroupId(data);
128
- data = filterLinkNoSourceTarget(data); // data = await addLinkData(data)
129
-
130
- data = (0, _resourcePermissionUtil.addTopoDataResourcePermission)(data);
131
- return _context2.abrupt("return", data);
132
-
133
- case 5:
134
- case "end":
135
- return _context2.stop();
126
+ while (1) {
127
+ switch (_context2.prev = _context2.next) {
128
+ case 0:
129
+ data = oldData;
130
+ data = fixNodeGroupId(data);
131
+ data = filterLinkNoSourceTarget(data); // data = await addLinkData(data)
132
+
133
+ data = (0, _resourcePermissionUtil.addTopoDataResourcePermission)(data);
134
+ return _context2.abrupt("return", data);
135
+
136
+ case 5:
137
+ case "end":
138
+ return _context2.stop();
139
+ }
136
140
  }
137
141
  }, _callee2);
138
142
  }));
@@ -147,33 +151,35 @@ function _getTopoData() {
147
151
  _getTopoData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id, topoService) {
148
152
  var data;
149
153
  return _regenerator["default"].wrap(function _callee3$(_context3) {
150
- while (1) switch (_context3.prev = _context3.next) {
151
- case 0:
152
- _context3.next = 2;
153
- return topoService.getTopoData(id);
154
-
155
- case 2:
156
- data = _context3.sent;
157
-
158
- if (data) {
159
- _context3.next = 5;
160
- break;
161
- }
162
-
163
- return _context3.abrupt("return", data);
164
-
165
- case 5:
166
- data = fixAlarmConfig(data);
167
- _context3.next = 8;
168
- return buildData(data);
169
-
170
- case 8:
171
- data = _context3.sent;
172
- return _context3.abrupt("return", data);
173
-
174
- case 10:
175
- case "end":
176
- return _context3.stop();
154
+ while (1) {
155
+ switch (_context3.prev = _context3.next) {
156
+ case 0:
157
+ _context3.next = 2;
158
+ return topoService.getTopoData(id);
159
+
160
+ case 2:
161
+ data = _context3.sent;
162
+
163
+ if (data) {
164
+ _context3.next = 5;
165
+ break;
166
+ }
167
+
168
+ return _context3.abrupt("return", data);
169
+
170
+ case 5:
171
+ data = fixAlarmConfig(data);
172
+ _context3.next = 8;
173
+ return buildData(data);
174
+
175
+ case 8:
176
+ data = _context3.sent;
177
+ return _context3.abrupt("return", data);
178
+
179
+ case 10:
180
+ case "end":
181
+ return _context3.stop();
182
+ }
177
183
  }
178
184
  }, _callee3);
179
185
  }));