@riil-frontend/component-topology 11.0.35 → 12.0.0-dev.1

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 (139) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.js +45 -29
  4. package/es/components/BatchAttrMetric/setting.js +1 -1
  5. package/es/components/MultiResourceDrawer/index.js +8 -6
  6. package/es/components/ResourceList/ResourceSelect.js +8 -7
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +8 -6
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
  11. package/es/core/editor/components/BackgroundView/index.js +73 -54
  12. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
  13. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -5
  14. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
  15. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
  16. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
  17. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
  18. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
  19. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
  20. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
  21. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
  22. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
  23. package/es/core/editor/hooks/useKeyboardShortcut.js +36 -32
  24. package/es/core/editor/utils/copyElementUtil.js +171 -0
  25. package/es/core/hooks/usePolling.js +21 -13
  26. package/es/core/hooks/useResourceConfig.js +37 -21
  27. package/es/core/hooks/useTopoEdit.js +202 -139
  28. package/es/core/models/Alarm.js +104 -38
  29. package/es/core/models/AttributeMetricDisplay.js +36 -14
  30. package/es/core/models/TopoApp.js +197 -75
  31. package/es/core/models/TopoGraphView.js +20 -10
  32. package/es/core/models/cache/CiCache.js +12 -6
  33. package/es/core/models/cache/CiTypeCache.js +20 -10
  34. package/es/core/models/cache/DictCache.js +10 -6
  35. package/es/core/models/graph/Background.js +9 -6
  36. package/es/core/models/plugins/resourceWebControllUrl.js +21 -8
  37. package/es/core/models/tagstips/ElementTagTipConfig.js +20 -10
  38. package/es/core/models/topoData.js +7 -5
  39. package/es/core/models/utils/linkUtils.js +8 -5
  40. package/es/core/services/cmdb/metric.js +7 -5
  41. package/es/core/services/cmdb.js +9 -5
  42. package/es/core/services/index.js +23 -9
  43. package/es/core/services/topo/tagtip.js +7 -5
  44. package/es/core/store/models/customIcon.js +11 -6
  45. package/es/core/utils/imageUtil.js +7 -5
  46. package/es/core/utils/metricUtil.js +5 -0
  47. package/es/core/utils/saveSerialize.js +7 -5
  48. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
  49. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +8 -5
  50. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
  51. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +47 -34
  52. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
  53. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +74 -34
  54. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
  55. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
  56. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -26
  57. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +15 -7
  58. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
  59. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
  60. package/es/networkTopo/components/Link/hook.js +21 -14
  61. package/es/networkTopo/components/Link/index.js +32 -18
  62. package/es/networkTopo/components/Link/setting.js +8 -6
  63. package/es/networkTopo/getTopoData.js +23 -10
  64. package/es/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
  65. package/es/networkTopo/models/TopoCenter.js +24 -10
  66. package/es/networkTopo/services/cmdb.js +333 -233
  67. package/es/networkTopo/services/mdc.js +24 -15
  68. package/es/networkTopo/services/metric.js +16 -11
  69. package/es/networkTopo/services/model.js +412 -283
  70. package/es/networkTopo/utils/exportData.js +7 -5
  71. package/lib/components/BatchAttrMetric/setting.js +1 -1
  72. package/lib/components/MultiResourceDrawer/index.js +8 -6
  73. package/lib/components/ResourceList/ResourceSelect.js +8 -6
  74. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
  75. package/lib/components/SingleResourceDrawer/SelectDrawer.js +8 -6
  76. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
  77. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
  78. package/lib/core/editor/components/BackgroundView/index.js +74 -55
  79. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
  80. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -4
  81. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
  82. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
  83. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
  84. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
  85. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
  86. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
  87. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
  88. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
  89. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
  90. package/lib/core/editor/hooks/useKeyboardShortcut.js +37 -34
  91. package/lib/core/editor/utils/copyElementUtil.js +182 -0
  92. package/lib/core/hooks/usePolling.js +21 -13
  93. package/lib/core/hooks/useResourceConfig.js +37 -21
  94. package/lib/core/hooks/useTopoEdit.js +202 -139
  95. package/lib/core/models/Alarm.js +104 -38
  96. package/lib/core/models/AttributeMetricDisplay.js +36 -14
  97. package/lib/core/models/TopoApp.js +197 -75
  98. package/lib/core/models/TopoGraphView.js +20 -10
  99. package/lib/core/models/cache/CiCache.js +12 -6
  100. package/lib/core/models/cache/CiTypeCache.js +20 -10
  101. package/lib/core/models/cache/DictCache.js +10 -6
  102. package/lib/core/models/graph/Background.js +9 -6
  103. package/lib/core/models/plugins/resourceWebControllUrl.js +21 -8
  104. package/lib/core/models/tagstips/ElementTagTipConfig.js +20 -10
  105. package/lib/core/models/topoData.js +7 -4
  106. package/lib/core/models/utils/linkUtils.js +8 -4
  107. package/lib/core/services/cmdb/metric.js +7 -4
  108. package/lib/core/services/cmdb.js +9 -4
  109. package/lib/core/services/index.js +21 -8
  110. package/lib/core/services/topo/tagtip.js +7 -4
  111. package/lib/core/store/models/customIcon.js +11 -6
  112. package/lib/core/utils/imageUtil.js +7 -4
  113. package/lib/core/utils/metricUtil.js +5 -0
  114. package/lib/core/utils/saveSerialize.js +7 -4
  115. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
  116. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +9 -6
  117. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
  118. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +49 -36
  119. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
  120. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +73 -35
  121. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
  122. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
  123. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -25
  124. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +14 -6
  125. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
  126. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
  127. package/lib/networkTopo/components/Link/hook.js +23 -15
  128. package/lib/networkTopo/components/Link/index.js +32 -18
  129. package/lib/networkTopo/components/Link/setting.js +8 -6
  130. package/lib/networkTopo/getTopoData.js +23 -10
  131. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
  132. package/lib/networkTopo/models/TopoCenter.js +24 -10
  133. package/lib/networkTopo/services/cmdb.js +336 -235
  134. package/lib/networkTopo/services/mdc.js +24 -14
  135. package/lib/networkTopo/services/metric.js +16 -10
  136. package/lib/networkTopo/services/model.js +414 -284
  137. package/lib/networkTopo/utils/exportData.js +7 -4
  138. package/lib/utils/htElementDataUtil.js +4 -2
  139. package/package.json +3 -2
@@ -32,8 +32,6 @@ var _useHtDataPropertyChangeListener = _interopRequireDefault(require("./ht/useH
32
32
  * @param {*} props
33
33
  */
34
34
  var usePolling = function usePolling(props) {
35
- var _fetchData, _refresh;
36
-
37
35
  var topo = props.topo;
38
36
  var store = topo.store;
39
37
  (0, _useCiAttributeChange["default"])({
@@ -52,7 +50,16 @@ var usePolling = function usePolling(props) {
52
50
  */
53
51
 
54
52
  function fetchData() {
55
- return (_fetchData = _fetchData || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
53
+ return _fetchData.apply(this, arguments);
54
+ }
55
+ /**
56
+ *
57
+ * @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
58
+ */
59
+
60
+
61
+ function _fetchData() {
62
+ _fetchData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
56
63
  var _topo$store$getModelS, resIdsList, nodeIdsList, codes, param, _yield$Promise$all, ciMetricsResult, mergeData, transformLinkData, adapterIpv6;
57
64
 
58
65
  return _regenerator["default"].wrap(function _callee$(_context) {
@@ -161,16 +168,17 @@ var usePolling = function usePolling(props) {
161
168
  return _context.stop();
162
169
  }
163
170
  }, _callee);
164
- }))).apply(this, arguments);
171
+ }));
172
+ return _fetchData.apply(this, arguments);
165
173
  }
166
- /**
167
- *
168
- * @returns {{id, attributes: object[], metrics: object[]}[]} 属性和指标
169
- */
170
-
171
174
 
172
175
  function refresh() {
173
- return (_refresh = _refresh || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
176
+ return _refresh.apply(this, arguments);
177
+ } // 轮询hooks
178
+
179
+
180
+ function _refresh() {
181
+ _refresh = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
174
182
  var data;
175
183
  return _regenerator["default"].wrap(function _callee2$(_context2) {
176
184
  while (1) switch (_context2.prev = _context2.next) {
@@ -195,9 +203,9 @@ var usePolling = function usePolling(props) {
195
203
  return _context2.stop();
196
204
  }
197
205
  }, _callee2);
198
- }))).apply(this, arguments);
199
- } // 轮询hooks
200
-
206
+ }));
207
+ return _refresh.apply(this, arguments);
208
+ }
201
209
 
202
210
  var _useRequest = (0, _ahooks.useRequest)(refresh, {
203
211
  pollingInterval: 60 * 1000,
@@ -20,14 +20,12 @@ var _ResourceConfigUtil = _interopRequireDefault(require("../../utils/ResourceCo
20
20
  var _template = require("../../utils/template");
21
21
 
22
22
  function _default(props) {
23
- var _ref, _ref2, _updateGroupResources, _addLayerStaticResources;
24
-
25
23
  var topo = props.topo;
26
24
  var store = topo.store;
27
25
  var editDispatchers = store.useModelDispatchers('topoConfig');
28
26
 
29
- var loadConfig = function loadConfig() {
30
- return (_ref = _ref || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
27
+ var loadConfig = /*#__PURE__*/function () {
28
+ var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
31
29
  return _regenerator["default"].wrap(function _callee$(_context) {
32
30
  while (1) switch (_context.prev = _context.next) {
33
31
  case 0:
@@ -39,8 +37,12 @@ function _default(props) {
39
37
  return _context.stop();
40
38
  }
41
39
  }, _callee);
42
- }))).apply(this, arguments);
43
- };
40
+ }));
41
+
42
+ return function loadConfig() {
43
+ return _ref.apply(this, arguments);
44
+ };
45
+ }();
44
46
  /**
45
47
  * 获取拓扑资源配置
46
48
  *
@@ -68,8 +70,8 @@ function _default(props) {
68
70
  return getConfig().groups;
69
71
  }
70
72
 
71
- var updateConfig = function updateConfig(_x) {
72
- return (_ref2 = _ref2 || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(config) {
73
+ var updateConfig = /*#__PURE__*/function () {
74
+ var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(config) {
73
75
  return _regenerator["default"].wrap(function _callee2$(_context2) {
74
76
  while (1) switch (_context2.prev = _context2.next) {
75
77
  case 0:
@@ -81,8 +83,12 @@ function _default(props) {
81
83
  return _context2.stop();
82
84
  }
83
85
  }, _callee2);
84
- }))).apply(this, arguments);
85
- }; // 查找分组
86
+ }));
87
+
88
+ return function updateConfig(_x) {
89
+ return _ref2.apply(this, arguments);
90
+ };
91
+ }(); // 查找分组
86
92
 
87
93
 
88
94
  var getGroupById = function getGroupById(groupId) {
@@ -179,7 +185,11 @@ function _default(props) {
179
185
  function addGroupAt(group, index) {}
180
186
 
181
187
  function updateGroupResources(_x2, _x3) {
182
- return (_updateGroupResources = _updateGroupResources || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(groupData, resources) {
188
+ return _updateGroupResources.apply(this, arguments);
189
+ }
190
+
191
+ function _updateGroupResources() {
192
+ _updateGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(groupData, resources) {
183
193
  var config;
184
194
  return _regenerator["default"].wrap(function _callee3$(_context3) {
185
195
  while (1) switch (_context3.prev = _context3.next) {
@@ -204,7 +214,8 @@ function _default(props) {
204
214
  return _context3.stop();
205
215
  }
206
216
  }, _callee3);
207
- }))).apply(this, arguments);
217
+ }));
218
+ return _updateGroupResources.apply(this, arguments);
208
219
  }
209
220
 
210
221
  function matchGroup(group, data) {
@@ -212,7 +223,18 @@ function _default(props) {
212
223
  }
213
224
 
214
225
  function addLayerStaticResources(_x4, _x5) {
215
- return (_addLayerStaticResources = _addLayerStaticResources || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(data, newResourceIds) {
226
+ return _addLayerStaticResources.apply(this, arguments);
227
+ }
228
+ /**
229
+ * 从拓扑图解析出拓扑资源配置
230
+ *
231
+ * @param {ht.DataModel} dataModel
232
+ * @returns {{layers, groups, resources}}
233
+ */
234
+
235
+
236
+ function _addLayerStaticResources() {
237
+ _addLayerStaticResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(data, newResourceIds) {
216
238
  var config;
217
239
  return _regenerator["default"].wrap(function _callee4$(_context4) {
218
240
  while (1) switch (_context4.prev = _context4.next) {
@@ -239,15 +261,9 @@ function _default(props) {
239
261
  return _context4.stop();
240
262
  }
241
263
  }, _callee4);
242
- }))).apply(this, arguments);
264
+ }));
265
+ return _addLayerStaticResources.apply(this, arguments);
243
266
  }
244
- /**
245
- * 从拓扑图解析出拓扑资源配置
246
- *
247
- * @param {ht.DataModel} dataModel
248
- * @returns {{layers, groups, resources}}
249
- */
250
-
251
267
 
252
268
  function getConfigFromHt() {
253
269
  return _ResourceConfigUtil["default"].getResourceConfigFromHt(topo);