@riil-frontend/component-topology 11.0.35 → 12.0.0-dev.2
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.
- package/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.js +45 -29
- package/es/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/MultiResourceDrawer/index.js +8 -6
- package/es/components/ResourceList/ResourceSelect.js +8 -7
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
- package/es/components/SingleResourceDrawer/SelectDrawer.js +8 -6
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
- package/es/core/editor/components/BackgroundView/index.js +73 -54
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -5
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
- package/es/core/editor/hooks/useKeyboardShortcut.js +36 -32
- package/es/core/editor/utils/copyElementUtil.js +174 -0
- package/es/core/hooks/useCiAttributeChange.js +6 -3
- package/es/core/hooks/usePolling.js +21 -13
- package/es/core/hooks/useResourceConfig.js +37 -21
- package/es/core/hooks/useTopoEdit.js +202 -139
- package/es/core/models/Alarm.js +104 -38
- package/es/core/models/AttributeMetricDisplay.js +36 -14
- package/es/core/models/TopoApp.js +197 -75
- package/es/core/models/TopoGraphView.js +20 -10
- package/es/core/models/attributeFormatter/formatter/commonTransform.js +0 -5
- package/es/core/models/cache/CiCache.js +12 -6
- package/es/core/models/cache/CiTypeCache.js +20 -10
- package/es/core/models/cache/DictCache.js +10 -6
- package/es/core/models/graph/Background.js +9 -6
- package/es/core/models/plugins/resourceWebControllUrl.js +21 -8
- package/es/core/models/tagstips/ElementTagTipConfig.js +20 -10
- package/es/core/models/topoData.js +7 -5
- package/es/core/models/utils/linkUtils.js +8 -5
- package/es/core/services/cmdb/metric.js +7 -5
- package/es/core/services/cmdb.js +9 -5
- package/es/core/services/index.js +23 -9
- package/es/core/services/topo/tagtip.js +7 -5
- package/es/core/store/models/customIcon.js +11 -6
- package/es/core/utils/imageUtil.js +7 -5
- package/es/core/utils/metricUtil.js +13 -1
- package/es/core/utils/saveSerialize.js +7 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +8 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +47 -34
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +74 -34
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -26
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +15 -7
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
- package/es/networkTopo/components/Link/hook.js +21 -14
- package/es/networkTopo/components/Link/index.js +32 -18
- package/es/networkTopo/components/Link/setting.js +8 -6
- package/es/networkTopo/getTopoData.js +23 -10
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
- package/es/networkTopo/models/TopoCenter.js +24 -10
- package/es/networkTopo/services/cmdb.js +333 -233
- package/es/networkTopo/services/mdc.js +24 -15
- package/es/networkTopo/services/metric.js +16 -11
- package/es/networkTopo/services/model.js +412 -283
- package/es/networkTopo/utils/exportData.js +7 -5
- package/es/utils/clipboardUtil.d.ts +7 -0
- package/es/utils/clipboardUtil.js +104 -0
- package/lib/components/BatchAttrMetric/setting.js +1 -1
- package/lib/components/MultiResourceDrawer/index.js +8 -6
- package/lib/components/ResourceList/ResourceSelect.js +8 -6
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -6
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +8 -6
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +8 -6
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +24 -14
- package/lib/core/editor/components/BackgroundView/index.js +74 -55
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +8 -6
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +7 -4
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +8 -6
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +15 -8
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -10
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +16 -10
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +8 -6
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +8 -6
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +28 -16
- package/lib/core/editor/hooks/useKeyboardShortcut.js +37 -34
- package/lib/core/editor/utils/copyElementUtil.js +187 -0
- package/lib/core/hooks/useCiAttributeChange.js +6 -3
- package/lib/core/hooks/usePolling.js +21 -13
- package/lib/core/hooks/useResourceConfig.js +37 -21
- package/lib/core/hooks/useTopoEdit.js +202 -139
- package/lib/core/models/Alarm.js +104 -38
- package/lib/core/models/AttributeMetricDisplay.js +36 -14
- package/lib/core/models/TopoApp.js +197 -75
- package/lib/core/models/TopoGraphView.js +20 -10
- package/lib/core/models/attributeFormatter/formatter/commonTransform.js +0 -5
- package/lib/core/models/cache/CiCache.js +12 -6
- package/lib/core/models/cache/CiTypeCache.js +20 -10
- package/lib/core/models/cache/DictCache.js +10 -6
- package/lib/core/models/graph/Background.js +9 -6
- package/lib/core/models/plugins/resourceWebControllUrl.js +21 -8
- package/lib/core/models/tagstips/ElementTagTipConfig.js +20 -10
- package/lib/core/models/topoData.js +7 -4
- package/lib/core/models/utils/linkUtils.js +8 -4
- package/lib/core/services/cmdb/metric.js +7 -4
- package/lib/core/services/cmdb.js +9 -4
- package/lib/core/services/index.js +21 -8
- package/lib/core/services/topo/tagtip.js +7 -4
- package/lib/core/store/models/customIcon.js +11 -6
- package/lib/core/utils/imageUtil.js +7 -4
- package/lib/core/utils/metricUtil.js +13 -1
- package/lib/core/utils/saveSerialize.js +7 -4
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +8 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +57 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +49 -36
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +9 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +73 -35
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +9 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +31 -25
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +14 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +7 -4
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +8 -6
- package/lib/networkTopo/components/Link/hook.js +23 -15
- package/lib/networkTopo/components/Link/index.js +32 -18
- package/lib/networkTopo/components/Link/setting.js +8 -6
- package/lib/networkTopo/getTopoData.js +23 -10
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +7 -4
- package/lib/networkTopo/models/TopoCenter.js +24 -10
- package/lib/networkTopo/services/cmdb.js +336 -235
- package/lib/networkTopo/services/mdc.js +24 -14
- package/lib/networkTopo/services/metric.js +16 -10
- package/lib/networkTopo/services/model.js +414 -284
- package/lib/networkTopo/utils/exportData.js +7 -4
- package/lib/utils/clipboardUtil.d.ts +7 -0
- package/lib/utils/clipboardUtil.js +113 -0
- package/lib/utils/htElementDataUtil.js +4 -2
- package/package.json +3 -2
@@ -48,8 +48,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
48
48
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
49
49
|
|
50
50
|
var useTopoEdit = function useTopoEdit(params) {
|
51
|
-
var _ref2, _ref3, _ref4, _bindGroupResources, _addGroupResources, _bindViewResources, _addLayerResources, _addResourceToFirstLayer, _ref5, _ref6, _ref8, _relateNodeIp;
|
52
|
-
|
53
51
|
var topo = params.topo,
|
54
52
|
topoId = params.topoId,
|
55
53
|
isEditing = params.isEditing,
|
@@ -104,8 +102,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
104
102
|
setShowComboResDrawer(true);
|
105
103
|
};
|
106
104
|
|
107
|
-
var onLayerAdded = function
|
108
|
-
|
105
|
+
var onLayerAdded = /*#__PURE__*/function () {
|
106
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
|
109
107
|
var target, direction, config;
|
110
108
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
111
109
|
while (1) switch (_context.prev = _context.next) {
|
@@ -140,11 +138,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
140
138
|
return _context.stop();
|
141
139
|
}
|
142
140
|
}, _callee);
|
143
|
-
}))
|
144
|
-
|
141
|
+
}));
|
142
|
+
|
143
|
+
return function onLayerAdded(_x) {
|
144
|
+
return _ref2.apply(this, arguments);
|
145
|
+
};
|
146
|
+
}();
|
145
147
|
|
146
|
-
var deleteLayer = function
|
147
|
-
|
148
|
+
var deleteLayer = /*#__PURE__*/function () {
|
149
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(layerElement) {
|
148
150
|
var config;
|
149
151
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
150
152
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -183,12 +185,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
183
185
|
return _context2.stop();
|
184
186
|
}
|
185
187
|
}, _callee2);
|
186
|
-
}))
|
187
|
-
};
|
188
|
+
}));
|
188
189
|
|
189
|
-
|
190
|
-
|
190
|
+
return function deleteLayer(_x2) {
|
191
|
+
return _ref3.apply(this, arguments);
|
192
|
+
};
|
193
|
+
}();
|
191
194
|
|
195
|
+
var handleDeleteLayer = function handleDeleteLayer(layerElement) {
|
192
196
|
var hasChildren = !!layerElement.getChildren().toArray().length;
|
193
197
|
|
194
198
|
if (!hasChildren) {
|
@@ -206,8 +210,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
206
210
|
messageProps: {
|
207
211
|
type: "warning"
|
208
212
|
},
|
209
|
-
onOk: function
|
210
|
-
|
213
|
+
onOk: function () {
|
214
|
+
var _onOk = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
211
215
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
212
216
|
while (1) switch (_context3.prev = _context3.next) {
|
213
217
|
case 0:
|
@@ -218,8 +222,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
218
222
|
return _context3.stop();
|
219
223
|
}
|
220
224
|
}, _callee3);
|
221
|
-
}))
|
222
|
-
|
225
|
+
}));
|
226
|
+
|
227
|
+
function onOk() {
|
228
|
+
return _onOk.apply(this, arguments);
|
229
|
+
}
|
230
|
+
|
231
|
+
return onOk;
|
232
|
+
}()
|
223
233
|
});
|
224
234
|
}; // const deleteGroupFooterBtn = () => {
|
225
235
|
// return (
|
@@ -369,8 +379,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
369
379
|
}; // 删除关联在节点上的出口链路
|
370
380
|
|
371
381
|
|
372
|
-
var deleteExLink = function
|
373
|
-
|
382
|
+
var deleteExLink = /*#__PURE__*/function () {
|
383
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(node) {
|
374
384
|
var _node$getEdges$toArra, _node$getEdges;
|
375
385
|
|
376
386
|
var config, edges, exportLinkIdList;
|
@@ -404,8 +414,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
404
414
|
return _context4.stop();
|
405
415
|
}
|
406
416
|
}, _callee4);
|
407
|
-
}))
|
408
|
-
|
417
|
+
}));
|
418
|
+
|
419
|
+
return function deleteExLink(_x3) {
|
420
|
+
return _ref4.apply(this, arguments);
|
421
|
+
};
|
422
|
+
}();
|
409
423
|
|
410
424
|
var onDeleteElement = function onDeleteElement(data) {
|
411
425
|
var dtype = data.dtype;
|
@@ -481,27 +495,31 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
481
495
|
|
482
496
|
|
483
497
|
function bindGroupResources(_x4, _x5) {
|
484
|
-
return
|
485
|
-
|
498
|
+
return _bindGroupResources.apply(this, arguments);
|
499
|
+
}
|
486
500
|
|
487
|
-
|
488
|
-
|
501
|
+
function _bindGroupResources() {
|
502
|
+
_bindGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(group, resources) {
|
503
|
+
var id, tag, _yield$editDispatcher2, elements, nodeElements, newLinkElements, updateElements;
|
504
|
+
|
505
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
506
|
+
while (1) switch (_context10.prev = _context10.next) {
|
489
507
|
case 0:
|
490
508
|
id = group.id, tag = group.tag;
|
491
509
|
|
492
510
|
_rlog["default"].debug("bindGroupResources--id, tag", id, tag);
|
493
511
|
|
494
512
|
topo.historyManager.beginTransaction();
|
495
|
-
|
513
|
+
_context10.next = 5;
|
496
514
|
return resourceConfig.updateGroupResources(group, resources);
|
497
515
|
|
498
516
|
case 5:
|
499
|
-
|
517
|
+
_context10.next = 7;
|
500
518
|
return editDispatchers.fetchDataByConfig();
|
501
519
|
|
502
520
|
case 7:
|
503
|
-
_yield$
|
504
|
-
elements = _yield$
|
521
|
+
_yield$editDispatcher2 = _context10.sent;
|
522
|
+
elements = _yield$editDispatcher2.elements;
|
505
523
|
// 区域里的子区域及子区域的节点、新增的链路
|
506
524
|
nodeElements = (0, _topoData.findGroupChildren)(elements, group);
|
507
525
|
newLinkElements = findUNExistedLinkElements(elements);
|
@@ -519,17 +537,26 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
519
537
|
|
520
538
|
case 14:
|
521
539
|
case "end":
|
522
|
-
return
|
540
|
+
return _context10.stop();
|
523
541
|
}
|
524
|
-
},
|
525
|
-
}))
|
542
|
+
}, _callee10);
|
543
|
+
}));
|
544
|
+
return _bindGroupResources.apply(this, arguments);
|
526
545
|
}
|
527
546
|
|
528
547
|
function addGroupResources(_x6, _x7) {
|
529
|
-
return
|
548
|
+
return _addGroupResources.apply(this, arguments);
|
549
|
+
}
|
550
|
+
/**
|
551
|
+
* 关联视图的资源
|
552
|
+
*/
|
553
|
+
|
554
|
+
|
555
|
+
function _addGroupResources() {
|
556
|
+
_addGroupResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(group, newResourceIds) {
|
530
557
|
var groupConfig, resources, groupData;
|
531
|
-
return _regenerator["default"].wrap(function
|
532
|
-
while (1) switch (
|
558
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
559
|
+
while (1) switch (_context11.prev = _context11.next) {
|
533
560
|
case 0:
|
534
561
|
groupConfig = resourceConfig.getGroupConfigByElement(group);
|
535
562
|
resources = {
|
@@ -539,41 +566,49 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
539
566
|
id: group.getTag(),
|
540
567
|
tag: group.a("tag")
|
541
568
|
};
|
542
|
-
|
569
|
+
_context11.next = 5;
|
543
570
|
return bindGroupResources(groupData, resources);
|
544
571
|
|
545
572
|
case 5:
|
546
573
|
case "end":
|
547
|
-
return
|
574
|
+
return _context11.stop();
|
548
575
|
}
|
549
|
-
},
|
550
|
-
}))
|
576
|
+
}, _callee11);
|
577
|
+
}));
|
578
|
+
return _addGroupResources.apply(this, arguments);
|
579
|
+
}
|
580
|
+
|
581
|
+
function bindViewResources(_x8) {
|
582
|
+
return _bindViewResources.apply(this, arguments);
|
551
583
|
}
|
552
584
|
/**
|
553
|
-
*
|
585
|
+
* 分层添加资源
|
586
|
+
* @param group
|
587
|
+
* @param newResourceIds 新增的资源id列表
|
588
|
+
* @return {Promise<void>}
|
554
589
|
*/
|
555
590
|
|
556
591
|
|
557
|
-
function
|
558
|
-
|
559
|
-
var config, _yield$
|
592
|
+
function _bindViewResources() {
|
593
|
+
_bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(data) {
|
594
|
+
var config, _yield$editDispatcher3, elements;
|
560
595
|
|
561
|
-
return _regenerator["default"].wrap(function
|
562
|
-
while (1) switch (
|
596
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
597
|
+
while (1) switch (_context12.prev = _context12.next) {
|
563
598
|
case 0:
|
564
599
|
// console.log("关联视图的资源", data);
|
565
600
|
config = resourceConfig.getConfig();
|
566
601
|
config.resources = data;
|
567
|
-
|
602
|
+
_context12.next = 4;
|
568
603
|
return resourceConfig.updateConfig(config);
|
569
604
|
|
570
605
|
case 4:
|
571
|
-
|
606
|
+
_context12.next = 6;
|
572
607
|
return editDispatchers.fetchDataByConfig();
|
573
608
|
|
574
609
|
case 6:
|
575
|
-
_yield$
|
576
|
-
elements = _yield$
|
610
|
+
_yield$editDispatcher3 = _context12.sent;
|
611
|
+
elements = _yield$editDispatcher3.elements;
|
577
612
|
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
|
578
613
|
|
579
614
|
if (topo.linkDynamicStyleExecutor) {
|
@@ -582,38 +617,36 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
582
617
|
|
583
618
|
case 10:
|
584
619
|
case "end":
|
585
|
-
return
|
620
|
+
return _context12.stop();
|
586
621
|
}
|
587
|
-
},
|
588
|
-
}))
|
622
|
+
}, _callee12);
|
623
|
+
}));
|
624
|
+
return _bindViewResources.apply(this, arguments);
|
589
625
|
}
|
590
|
-
/**
|
591
|
-
* 分层添加资源
|
592
|
-
* @param group
|
593
|
-
* @param newResourceIds 新增的资源id列表
|
594
|
-
* @return {Promise<void>}
|
595
|
-
*/
|
596
|
-
|
597
626
|
|
598
627
|
function addLayerResources(_x9, _x10) {
|
599
|
-
return
|
600
|
-
|
628
|
+
return _addLayerResources.apply(this, arguments);
|
629
|
+
}
|
630
|
+
|
631
|
+
function _addLayerResources() {
|
632
|
+
_addLayerResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(group, newResourceIds) {
|
633
|
+
var _yield$editDispatcher4, elements, newElements;
|
601
634
|
|
602
|
-
return _regenerator["default"].wrap(function
|
603
|
-
while (1) switch (
|
635
|
+
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
636
|
+
while (1) switch (_context13.prev = _context13.next) {
|
604
637
|
case 0:
|
605
638
|
topo.historyManager.beginTransaction(); // 构造新的配置
|
606
639
|
|
607
|
-
|
640
|
+
_context13.next = 3;
|
608
641
|
return resourceConfig.addLayerStaticResources(group, newResourceIds);
|
609
642
|
|
610
643
|
case 3:
|
611
|
-
|
644
|
+
_context13.next = 5;
|
612
645
|
return editDispatchers.fetchDataByConfig();
|
613
646
|
|
614
647
|
case 5:
|
615
|
-
_yield$
|
616
|
-
elements = _yield$
|
648
|
+
_yield$editDispatcher4 = _context13.sent;
|
649
|
+
elements = _yield$editDispatcher4.elements;
|
617
650
|
// 2022-11-10 修复 添加资源后分层重新布局问题,仅布局新增资源。替换api topo.updateElements(data)
|
618
651
|
newElements = findUNExistedElements(elements);
|
619
652
|
|
@@ -637,28 +670,34 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
637
670
|
|
638
671
|
case 14:
|
639
672
|
case "end":
|
640
|
-
return
|
673
|
+
return _context13.stop();
|
641
674
|
}
|
642
|
-
},
|
643
|
-
}))
|
675
|
+
}, _callee13);
|
676
|
+
}));
|
677
|
+
return _addLayerResources.apply(this, arguments);
|
644
678
|
}
|
645
679
|
|
646
680
|
function addResourceToFirstLayer(_x11) {
|
647
|
-
return
|
681
|
+
return _addResourceToFirstLayer.apply(this, arguments);
|
682
|
+
}
|
683
|
+
|
684
|
+
function _addResourceToFirstLayer() {
|
685
|
+
_addResourceToFirstLayer = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(data) {
|
648
686
|
var group;
|
649
|
-
return _regenerator["default"].wrap(function
|
650
|
-
while (1) switch (
|
687
|
+
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
688
|
+
while (1) switch (_context14.prev = _context14.next) {
|
651
689
|
case 0:
|
652
690
|
group = resourceConfig.getGroups()[0];
|
653
|
-
|
691
|
+
_context14.next = 3;
|
654
692
|
return addLayerResources(group, data);
|
655
693
|
|
656
694
|
case 3:
|
657
695
|
case "end":
|
658
|
-
return
|
696
|
+
return _context14.stop();
|
659
697
|
}
|
660
|
-
},
|
661
|
-
}))
|
698
|
+
}, _callee14);
|
699
|
+
}));
|
700
|
+
return _addResourceToFirstLayer.apply(this, arguments);
|
662
701
|
}
|
663
702
|
|
664
703
|
function getAddResourceType() {
|
@@ -687,29 +726,29 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
687
726
|
*/
|
688
727
|
|
689
728
|
|
690
|
-
var onSaveComboRes = function
|
691
|
-
|
692
|
-
return _regenerator["default"].wrap(function
|
693
|
-
while (1) switch (
|
729
|
+
var onSaveComboRes = /*#__PURE__*/function () {
|
730
|
+
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(data) {
|
731
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
732
|
+
while (1) switch (_context5.prev = _context5.next) {
|
694
733
|
case 0:
|
695
734
|
_rlog["default"].debug("关联资源-----onSaveComboRes", data);
|
696
735
|
|
697
736
|
topo.historyManager.beginTransaction();
|
698
737
|
|
699
738
|
if (!(getAddResourceType() === "addToFirstLayer")) {
|
700
|
-
|
739
|
+
_context5.next = 7;
|
701
740
|
break;
|
702
741
|
}
|
703
742
|
|
704
|
-
|
743
|
+
_context5.next = 5;
|
705
744
|
return addResourceToFirstLayer(data);
|
706
745
|
|
707
746
|
case 5:
|
708
|
-
|
747
|
+
_context5.next = 9;
|
709
748
|
break;
|
710
749
|
|
711
750
|
case 7:
|
712
|
-
|
751
|
+
_context5.next = 9;
|
713
752
|
return bindViewResources(data);
|
714
753
|
|
715
754
|
case 9:
|
@@ -721,30 +760,34 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
721
760
|
|
722
761
|
case 12:
|
723
762
|
case "end":
|
724
|
-
return
|
763
|
+
return _context5.stop();
|
725
764
|
}
|
726
|
-
},
|
727
|
-
}))
|
728
|
-
};
|
765
|
+
}, _callee5);
|
766
|
+
}));
|
729
767
|
|
730
|
-
|
731
|
-
|
732
|
-
|
768
|
+
return function onSaveComboRes(_x12) {
|
769
|
+
return _ref5.apply(this, arguments);
|
770
|
+
};
|
771
|
+
}();
|
733
772
|
|
734
|
-
|
735
|
-
|
773
|
+
var onSaveTopo = /*#__PURE__*/function () {
|
774
|
+
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(data) {
|
775
|
+
var id, config, serialize, _config$layout, template, layout, saveConfig;
|
776
|
+
|
777
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
778
|
+
while (1) switch (_context7.prev = _context7.next) {
|
736
779
|
case 0:
|
737
780
|
id = data.id, config = data.config, serialize = data.serialize;
|
738
781
|
_config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
|
739
782
|
|
740
783
|
if (onSave) {
|
741
784
|
// 自定义保存
|
742
|
-
saveConfig = function
|
743
|
-
|
744
|
-
return _regenerator["default"].wrap(function
|
745
|
-
while (1) switch (
|
785
|
+
saveConfig = /*#__PURE__*/function () {
|
786
|
+
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
787
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
788
|
+
while (1) switch (_context6.prev = _context6.next) {
|
746
789
|
case 0:
|
747
|
-
|
790
|
+
_context6.next = 2;
|
748
791
|
return editDispatchers.saveTopo({
|
749
792
|
id: id,
|
750
793
|
layout: layout,
|
@@ -753,11 +796,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
753
796
|
|
754
797
|
case 2:
|
755
798
|
case "end":
|
756
|
-
return
|
799
|
+
return _context6.stop();
|
757
800
|
}
|
758
|
-
},
|
759
|
-
}))
|
760
|
-
|
801
|
+
}, _callee6);
|
802
|
+
}));
|
803
|
+
|
804
|
+
return function saveConfig() {
|
805
|
+
return _ref7.apply(this, arguments);
|
806
|
+
};
|
807
|
+
}();
|
761
808
|
|
762
809
|
onSave({
|
763
810
|
topo: topo,
|
@@ -768,11 +815,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
768
815
|
|
769
816
|
case 3:
|
770
817
|
case "end":
|
771
|
-
return
|
818
|
+
return _context7.stop();
|
772
819
|
}
|
773
|
-
},
|
774
|
-
}))
|
775
|
-
|
820
|
+
}, _callee7);
|
821
|
+
}));
|
822
|
+
|
823
|
+
return function onSaveTopo(_x13) {
|
824
|
+
return _ref6.apply(this, arguments);
|
825
|
+
};
|
826
|
+
}();
|
776
827
|
|
777
828
|
var saveBind = function saveBind(type, data) {
|
778
829
|
var eventData = {
|
@@ -797,14 +848,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
797
848
|
*/
|
798
849
|
|
799
850
|
|
800
|
-
var bindNodeResource = function
|
801
|
-
|
802
|
-
var _doBind;
|
851
|
+
var bindNodeResource = /*#__PURE__*/function () {
|
852
|
+
var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(params) {
|
853
|
+
var id, oldResId, newResId, node, parentGroupElement, htTopo, config, groupId, groupTag, _yield$editDispatcher, elements, newData, doBind, _doBind, replaceOrAddRes;
|
803
854
|
|
804
|
-
|
805
|
-
|
806
|
-
return _regenerator["default"].wrap(function _callee14$(_context14) {
|
807
|
-
while (1) switch (_context14.prev = _context14.next) {
|
855
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
856
|
+
while (1) switch (_context9.prev = _context9.next) {
|
808
857
|
case 0:
|
809
858
|
replaceOrAddRes = function _replaceOrAddRes(resources, oldResId, newResId) {
|
810
859
|
return (0, _extends2["default"])({}, resources, {
|
@@ -814,11 +863,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
814
863
|
});
|
815
864
|
};
|
816
865
|
|
817
|
-
|
818
|
-
|
866
|
+
_doBind = function _doBind3() {
|
867
|
+
_doBind = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
819
868
|
var dm, newLinkElements, createElementsData, groupChildren, newGroupChildren, existedGroupChildren, groupElement, newElement, sm;
|
820
|
-
return _regenerator["default"].wrap(function
|
821
|
-
while (1) switch (
|
869
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
870
|
+
while (1) switch (_context8.prev = _context8.next) {
|
822
871
|
case 0:
|
823
872
|
dm = htTopo.getGraphView().dm(); // 创建
|
824
873
|
|
@@ -888,7 +937,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
888
937
|
// node.a("customName", null);
|
889
938
|
// 删除关联在节点上的出口链路
|
890
939
|
|
891
|
-
|
940
|
+
_context8.next = 12;
|
892
941
|
return deleteExLink(node);
|
893
942
|
|
894
943
|
case 12:
|
@@ -899,10 +948,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
899
948
|
|
900
949
|
case 13:
|
901
950
|
case "end":
|
902
|
-
return
|
951
|
+
return _context8.stop();
|
903
952
|
}
|
904
|
-
},
|
905
|
-
}))
|
953
|
+
}, _callee8);
|
954
|
+
}));
|
955
|
+
return _doBind.apply(this, arguments);
|
956
|
+
};
|
957
|
+
|
958
|
+
doBind = function _doBind2() {
|
959
|
+
return _doBind.apply(this, arguments);
|
906
960
|
};
|
907
961
|
|
908
962
|
topo.historyManager.beginTransaction();
|
@@ -938,22 +992,22 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
938
992
|
config.resources = replaceOrAddRes(config.resources, oldResId, newResId);
|
939
993
|
}
|
940
994
|
|
941
|
-
|
995
|
+
_context9.next = 13;
|
942
996
|
return resourceConfig.updateConfig(config);
|
943
997
|
|
944
|
-
case
|
945
|
-
|
998
|
+
case 13:
|
999
|
+
_context9.next = 15;
|
946
1000
|
return editDispatchers.fetchDataByConfig();
|
947
1001
|
|
948
|
-
case
|
949
|
-
_yield$
|
950
|
-
elements = _yield$
|
1002
|
+
case 15:
|
1003
|
+
_yield$editDispatcher = _context9.sent;
|
1004
|
+
elements = _yield$editDispatcher.elements;
|
951
1005
|
newData = elements.find(function (item) {
|
952
1006
|
return item.id === newResId;
|
953
1007
|
});
|
954
1008
|
|
955
1009
|
if (newData) {
|
956
|
-
|
1010
|
+
_context9.next = 23;
|
957
1011
|
break;
|
958
1012
|
}
|
959
1013
|
|
@@ -962,29 +1016,37 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
962
1016
|
_rlog["default"].warn("关联资源失败");
|
963
1017
|
|
964
1018
|
topo.historyManager.endTransaction();
|
965
|
-
return
|
1019
|
+
return _context9.abrupt("return", false);
|
966
1020
|
|
967
|
-
case
|
968
|
-
|
1021
|
+
case 23:
|
1022
|
+
_context9.next = 25;
|
969
1023
|
return doBind();
|
970
1024
|
|
971
|
-
case
|
1025
|
+
case 25:
|
972
1026
|
topo.historyManager.endTransaction();
|
973
1027
|
|
974
|
-
case
|
1028
|
+
case 26:
|
975
1029
|
case "end":
|
976
|
-
return
|
1030
|
+
return _context9.stop();
|
977
1031
|
}
|
978
|
-
},
|
979
|
-
}))
|
980
|
-
|
1032
|
+
}, _callee9);
|
1033
|
+
}));
|
1034
|
+
|
1035
|
+
return function bindNodeResource(_x14) {
|
1036
|
+
return _ref8.apply(this, arguments);
|
1037
|
+
};
|
1038
|
+
}();
|
981
1039
|
/**
|
982
1040
|
* 关联IP的图片节点
|
983
1041
|
*/
|
984
1042
|
|
985
1043
|
|
986
1044
|
function relateNodeIp(_x15, _x16) {
|
987
|
-
return
|
1045
|
+
return _relateNodeIp.apply(this, arguments);
|
1046
|
+
}
|
1047
|
+
|
1048
|
+
function _relateNodeIp() {
|
1049
|
+
_relateNodeIp = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(txtValue, nodeElement) {
|
988
1050
|
var dm, isUnique, ip, configObj, configData, _elements, newLinkElements, newLink, newLinkGroup, createElementsData, _htTopo;
|
989
1051
|
|
990
1052
|
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
@@ -1060,7 +1122,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1060
1122
|
return _context15.stop();
|
1061
1123
|
}
|
1062
1124
|
}, _callee15);
|
1063
|
-
}))
|
1125
|
+
}));
|
1126
|
+
return _relateNodeIp.apply(this, arguments);
|
1064
1127
|
}
|
1065
1128
|
|
1066
1129
|
var onEvent = function onEvent(e) {
|