@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
@@ -19,8 +19,6 @@ import { mergeExportLinkData } from "../models/utils/linkUtils";
|
|
19
19
|
import { isUniqueIp, buildIpNode } from "../../networkTopo/utils/exitLinkUtil";
|
20
20
|
|
21
21
|
var useTopoEdit = function useTopoEdit(params) {
|
22
|
-
var _ref2, _ref3, _ref4, _bindGroupResources, _addGroupResources, _bindViewResources, _addLayerResources, _addResourceToFirstLayer, _ref5, _ref6, _ref8, _relateNodeIp;
|
23
|
-
|
24
22
|
var topo = params.topo,
|
25
23
|
topoId = params.topoId,
|
26
24
|
isEditing = params.isEditing,
|
@@ -74,8 +72,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
74
72
|
setShowComboResDrawer(true);
|
75
73
|
};
|
76
74
|
|
77
|
-
var onLayerAdded = function
|
78
|
-
|
75
|
+
var onLayerAdded = /*#__PURE__*/function () {
|
76
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
79
77
|
var target, direction, config;
|
80
78
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
81
79
|
while (1) switch (_context.prev = _context.next) {
|
@@ -108,11 +106,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
108
106
|
return _context.stop();
|
109
107
|
}
|
110
108
|
}, _callee);
|
111
|
-
}))
|
112
|
-
|
109
|
+
}));
|
110
|
+
|
111
|
+
return function onLayerAdded(_x) {
|
112
|
+
return _ref2.apply(this, arguments);
|
113
|
+
};
|
114
|
+
}();
|
113
115
|
|
114
|
-
var deleteLayer = function
|
115
|
-
|
116
|
+
var deleteLayer = /*#__PURE__*/function () {
|
117
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(layerElement) {
|
116
118
|
var config;
|
117
119
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
118
120
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -149,12 +151,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
149
151
|
return _context2.stop();
|
150
152
|
}
|
151
153
|
}, _callee2);
|
152
|
-
}))
|
153
|
-
};
|
154
|
+
}));
|
154
155
|
|
155
|
-
|
156
|
-
|
156
|
+
return function deleteLayer(_x2) {
|
157
|
+
return _ref3.apply(this, arguments);
|
158
|
+
};
|
159
|
+
}();
|
157
160
|
|
161
|
+
var handleDeleteLayer = function handleDeleteLayer(layerElement) {
|
158
162
|
var hasChildren = !!layerElement.getChildren().toArray().length;
|
159
163
|
|
160
164
|
if (!hasChildren) {
|
@@ -172,8 +176,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
172
176
|
messageProps: {
|
173
177
|
type: "warning"
|
174
178
|
},
|
175
|
-
onOk: function
|
176
|
-
|
179
|
+
onOk: function () {
|
180
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
177
181
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
178
182
|
while (1) switch (_context3.prev = _context3.next) {
|
179
183
|
case 0:
|
@@ -184,8 +188,14 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
184
188
|
return _context3.stop();
|
185
189
|
}
|
186
190
|
}, _callee3);
|
187
|
-
}))
|
188
|
-
|
191
|
+
}));
|
192
|
+
|
193
|
+
function onOk() {
|
194
|
+
return _onOk.apply(this, arguments);
|
195
|
+
}
|
196
|
+
|
197
|
+
return onOk;
|
198
|
+
}()
|
189
199
|
});
|
190
200
|
}; // const deleteGroupFooterBtn = () => {
|
191
201
|
// return (
|
@@ -335,8 +345,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
335
345
|
}; // 删除关联在节点上的出口链路
|
336
346
|
|
337
347
|
|
338
|
-
var deleteExLink = function
|
339
|
-
|
348
|
+
var deleteExLink = /*#__PURE__*/function () {
|
349
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(node) {
|
340
350
|
var _node$getEdges$toArra, _node$getEdges;
|
341
351
|
|
342
352
|
var config, edges, exportLinkIdList;
|
@@ -370,8 +380,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
370
380
|
return _context4.stop();
|
371
381
|
}
|
372
382
|
}, _callee4);
|
373
|
-
}))
|
374
|
-
|
383
|
+
}));
|
384
|
+
|
385
|
+
return function deleteExLink(_x3) {
|
386
|
+
return _ref4.apply(this, arguments);
|
387
|
+
};
|
388
|
+
}();
|
375
389
|
|
376
390
|
var onDeleteElement = function onDeleteElement(data) {
|
377
391
|
var dtype = data.dtype;
|
@@ -446,25 +460,29 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
446
460
|
|
447
461
|
|
448
462
|
function bindGroupResources(_x4, _x5) {
|
449
|
-
return
|
450
|
-
|
463
|
+
return _bindGroupResources.apply(this, arguments);
|
464
|
+
}
|
451
465
|
|
452
|
-
|
453
|
-
|
466
|
+
function _bindGroupResources() {
|
467
|
+
_bindGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(group, resources) {
|
468
|
+
var id, tag, _yield$editDispatcher2, elements, nodeElements, newLinkElements, updateElements;
|
469
|
+
|
470
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
471
|
+
while (1) switch (_context10.prev = _context10.next) {
|
454
472
|
case 0:
|
455
473
|
id = group.id, tag = group.tag;
|
456
474
|
rlog.debug("bindGroupResources--id, tag", id, tag);
|
457
475
|
topo.historyManager.beginTransaction();
|
458
|
-
|
476
|
+
_context10.next = 5;
|
459
477
|
return resourceConfig.updateGroupResources(group, resources);
|
460
478
|
|
461
479
|
case 5:
|
462
|
-
|
480
|
+
_context10.next = 7;
|
463
481
|
return editDispatchers.fetchDataByConfig();
|
464
482
|
|
465
483
|
case 7:
|
466
|
-
_yield$
|
467
|
-
elements = _yield$
|
484
|
+
_yield$editDispatcher2 = _context10.sent;
|
485
|
+
elements = _yield$editDispatcher2.elements;
|
468
486
|
// 区域里的子区域及子区域的节点、新增的链路
|
469
487
|
nodeElements = findGroupChildren(elements, group);
|
470
488
|
newLinkElements = findUNExistedLinkElements(elements);
|
@@ -482,17 +500,26 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
482
500
|
|
483
501
|
case 14:
|
484
502
|
case "end":
|
485
|
-
return
|
503
|
+
return _context10.stop();
|
486
504
|
}
|
487
|
-
},
|
488
|
-
}))
|
505
|
+
}, _callee10);
|
506
|
+
}));
|
507
|
+
return _bindGroupResources.apply(this, arguments);
|
489
508
|
}
|
490
509
|
|
491
510
|
function addGroupResources(_x6, _x7) {
|
492
|
-
return
|
511
|
+
return _addGroupResources.apply(this, arguments);
|
512
|
+
}
|
513
|
+
/**
|
514
|
+
* 关联视图的资源
|
515
|
+
*/
|
516
|
+
|
517
|
+
|
518
|
+
function _addGroupResources() {
|
519
|
+
_addGroupResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(group, newResourceIds) {
|
493
520
|
var groupConfig, resources, groupData;
|
494
|
-
return _regeneratorRuntime.wrap(function
|
495
|
-
while (1) switch (
|
521
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
522
|
+
while (1) switch (_context11.prev = _context11.next) {
|
496
523
|
case 0:
|
497
524
|
groupConfig = resourceConfig.getGroupConfigByElement(group);
|
498
525
|
resources = {
|
@@ -502,41 +529,49 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
502
529
|
id: group.getTag(),
|
503
530
|
tag: group.a("tag")
|
504
531
|
};
|
505
|
-
|
532
|
+
_context11.next = 5;
|
506
533
|
return bindGroupResources(groupData, resources);
|
507
534
|
|
508
535
|
case 5:
|
509
536
|
case "end":
|
510
|
-
return
|
537
|
+
return _context11.stop();
|
511
538
|
}
|
512
|
-
},
|
513
|
-
}))
|
539
|
+
}, _callee11);
|
540
|
+
}));
|
541
|
+
return _addGroupResources.apply(this, arguments);
|
542
|
+
}
|
543
|
+
|
544
|
+
function bindViewResources(_x8) {
|
545
|
+
return _bindViewResources.apply(this, arguments);
|
514
546
|
}
|
515
547
|
/**
|
516
|
-
*
|
548
|
+
* 分层添加资源
|
549
|
+
* @param group
|
550
|
+
* @param newResourceIds 新增的资源id列表
|
551
|
+
* @return {Promise<void>}
|
517
552
|
*/
|
518
553
|
|
519
554
|
|
520
|
-
function
|
521
|
-
|
522
|
-
var config, _yield$
|
555
|
+
function _bindViewResources() {
|
556
|
+
_bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(data) {
|
557
|
+
var config, _yield$editDispatcher3, elements;
|
523
558
|
|
524
|
-
return _regeneratorRuntime.wrap(function
|
525
|
-
while (1) switch (
|
559
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
560
|
+
while (1) switch (_context12.prev = _context12.next) {
|
526
561
|
case 0:
|
527
562
|
// console.log("关联视图的资源", data);
|
528
563
|
config = resourceConfig.getConfig();
|
529
564
|
config.resources = data;
|
530
|
-
|
565
|
+
_context12.next = 4;
|
531
566
|
return resourceConfig.updateConfig(config);
|
532
567
|
|
533
568
|
case 4:
|
534
|
-
|
569
|
+
_context12.next = 6;
|
535
570
|
return editDispatchers.fetchDataByConfig();
|
536
571
|
|
537
572
|
case 6:
|
538
|
-
_yield$
|
539
|
-
elements = _yield$
|
573
|
+
_yield$editDispatcher3 = _context12.sent;
|
574
|
+
elements = _yield$editDispatcher3.elements;
|
540
575
|
saveBind(TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
|
541
576
|
|
542
577
|
if (topo.linkDynamicStyleExecutor) {
|
@@ -545,38 +580,36 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
545
580
|
|
546
581
|
case 10:
|
547
582
|
case "end":
|
548
|
-
return
|
583
|
+
return _context12.stop();
|
549
584
|
}
|
550
|
-
},
|
551
|
-
}))
|
585
|
+
}, _callee12);
|
586
|
+
}));
|
587
|
+
return _bindViewResources.apply(this, arguments);
|
552
588
|
}
|
553
|
-
/**
|
554
|
-
* 分层添加资源
|
555
|
-
* @param group
|
556
|
-
* @param newResourceIds 新增的资源id列表
|
557
|
-
* @return {Promise<void>}
|
558
|
-
*/
|
559
|
-
|
560
589
|
|
561
590
|
function addLayerResources(_x9, _x10) {
|
562
|
-
return
|
563
|
-
|
591
|
+
return _addLayerResources.apply(this, arguments);
|
592
|
+
}
|
593
|
+
|
594
|
+
function _addLayerResources() {
|
595
|
+
_addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(group, newResourceIds) {
|
596
|
+
var _yield$editDispatcher4, elements, newElements;
|
564
597
|
|
565
|
-
return _regeneratorRuntime.wrap(function
|
566
|
-
while (1) switch (
|
598
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
599
|
+
while (1) switch (_context13.prev = _context13.next) {
|
567
600
|
case 0:
|
568
601
|
topo.historyManager.beginTransaction(); // 构造新的配置
|
569
602
|
|
570
|
-
|
603
|
+
_context13.next = 3;
|
571
604
|
return resourceConfig.addLayerStaticResources(group, newResourceIds);
|
572
605
|
|
573
606
|
case 3:
|
574
|
-
|
607
|
+
_context13.next = 5;
|
575
608
|
return editDispatchers.fetchDataByConfig();
|
576
609
|
|
577
610
|
case 5:
|
578
|
-
_yield$
|
579
|
-
elements = _yield$
|
611
|
+
_yield$editDispatcher4 = _context13.sent;
|
612
|
+
elements = _yield$editDispatcher4.elements;
|
580
613
|
// 2022-11-10 修复 添加资源后分层重新布局问题,仅布局新增资源。替换api topo.updateElements(data)
|
581
614
|
newElements = findUNExistedElements(elements);
|
582
615
|
rlog.debug("添加分层资源", {
|
@@ -598,28 +631,34 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
598
631
|
|
599
632
|
case 14:
|
600
633
|
case "end":
|
601
|
-
return
|
634
|
+
return _context13.stop();
|
602
635
|
}
|
603
|
-
},
|
604
|
-
}))
|
636
|
+
}, _callee13);
|
637
|
+
}));
|
638
|
+
return _addLayerResources.apply(this, arguments);
|
605
639
|
}
|
606
640
|
|
607
641
|
function addResourceToFirstLayer(_x11) {
|
608
|
-
return
|
642
|
+
return _addResourceToFirstLayer.apply(this, arguments);
|
643
|
+
}
|
644
|
+
|
645
|
+
function _addResourceToFirstLayer() {
|
646
|
+
_addResourceToFirstLayer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(data) {
|
609
647
|
var group;
|
610
|
-
return _regeneratorRuntime.wrap(function
|
611
|
-
while (1) switch (
|
648
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
649
|
+
while (1) switch (_context14.prev = _context14.next) {
|
612
650
|
case 0:
|
613
651
|
group = resourceConfig.getGroups()[0];
|
614
|
-
|
652
|
+
_context14.next = 3;
|
615
653
|
return addLayerResources(group, data);
|
616
654
|
|
617
655
|
case 3:
|
618
656
|
case "end":
|
619
|
-
return
|
657
|
+
return _context14.stop();
|
620
658
|
}
|
621
|
-
},
|
622
|
-
}))
|
659
|
+
}, _callee14);
|
660
|
+
}));
|
661
|
+
return _addResourceToFirstLayer.apply(this, arguments);
|
623
662
|
}
|
624
663
|
|
625
664
|
function getAddResourceType() {
|
@@ -648,28 +687,28 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
648
687
|
*/
|
649
688
|
|
650
689
|
|
651
|
-
var onSaveComboRes = function
|
652
|
-
|
653
|
-
return _regeneratorRuntime.wrap(function
|
654
|
-
while (1) switch (
|
690
|
+
var onSaveComboRes = /*#__PURE__*/function () {
|
691
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data) {
|
692
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
693
|
+
while (1) switch (_context5.prev = _context5.next) {
|
655
694
|
case 0:
|
656
695
|
rlog.debug("关联资源-----onSaveComboRes", data);
|
657
696
|
topo.historyManager.beginTransaction();
|
658
697
|
|
659
698
|
if (!(getAddResourceType() === "addToFirstLayer")) {
|
660
|
-
|
699
|
+
_context5.next = 7;
|
661
700
|
break;
|
662
701
|
}
|
663
702
|
|
664
|
-
|
703
|
+
_context5.next = 5;
|
665
704
|
return addResourceToFirstLayer(data);
|
666
705
|
|
667
706
|
case 5:
|
668
|
-
|
707
|
+
_context5.next = 9;
|
669
708
|
break;
|
670
709
|
|
671
710
|
case 7:
|
672
|
-
|
711
|
+
_context5.next = 9;
|
673
712
|
return bindViewResources(data);
|
674
713
|
|
675
714
|
case 9:
|
@@ -681,30 +720,34 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
681
720
|
|
682
721
|
case 12:
|
683
722
|
case "end":
|
684
|
-
return
|
723
|
+
return _context5.stop();
|
685
724
|
}
|
686
|
-
},
|
687
|
-
}))
|
688
|
-
};
|
725
|
+
}, _callee5);
|
726
|
+
}));
|
689
727
|
|
690
|
-
|
691
|
-
|
692
|
-
|
728
|
+
return function onSaveComboRes(_x12) {
|
729
|
+
return _ref5.apply(this, arguments);
|
730
|
+
};
|
731
|
+
}();
|
693
732
|
|
694
|
-
|
695
|
-
|
733
|
+
var onSaveTopo = /*#__PURE__*/function () {
|
734
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
|
735
|
+
var id, config, serialize, _config$layout, template, layout, saveConfig;
|
736
|
+
|
737
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
738
|
+
while (1) switch (_context7.prev = _context7.next) {
|
696
739
|
case 0:
|
697
740
|
id = data.id, config = data.config, serialize = data.serialize;
|
698
741
|
_config$layout = config === null || config === void 0 ? void 0 : config.layout, template = _config$layout.type, layout = _config$layout.layout;
|
699
742
|
|
700
743
|
if (onSave) {
|
701
744
|
// 自定义保存
|
702
|
-
saveConfig = function
|
703
|
-
|
704
|
-
return _regeneratorRuntime.wrap(function
|
705
|
-
while (1) switch (
|
745
|
+
saveConfig = /*#__PURE__*/function () {
|
746
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
747
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
748
|
+
while (1) switch (_context6.prev = _context6.next) {
|
706
749
|
case 0:
|
707
|
-
|
750
|
+
_context6.next = 2;
|
708
751
|
return editDispatchers.saveTopo({
|
709
752
|
id: id,
|
710
753
|
layout: layout,
|
@@ -713,11 +756,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
713
756
|
|
714
757
|
case 2:
|
715
758
|
case "end":
|
716
|
-
return
|
759
|
+
return _context6.stop();
|
717
760
|
}
|
718
|
-
},
|
719
|
-
}))
|
720
|
-
|
761
|
+
}, _callee6);
|
762
|
+
}));
|
763
|
+
|
764
|
+
return function saveConfig() {
|
765
|
+
return _ref7.apply(this, arguments);
|
766
|
+
};
|
767
|
+
}();
|
721
768
|
|
722
769
|
onSave({
|
723
770
|
topo: topo,
|
@@ -728,11 +775,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
728
775
|
|
729
776
|
case 3:
|
730
777
|
case "end":
|
731
|
-
return
|
778
|
+
return _context7.stop();
|
732
779
|
}
|
733
|
-
},
|
734
|
-
}))
|
735
|
-
|
780
|
+
}, _callee7);
|
781
|
+
}));
|
782
|
+
|
783
|
+
return function onSaveTopo(_x13) {
|
784
|
+
return _ref6.apply(this, arguments);
|
785
|
+
};
|
786
|
+
}();
|
736
787
|
|
737
788
|
var saveBind = function saveBind(type, data) {
|
738
789
|
var eventData = {
|
@@ -755,14 +806,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
755
806
|
*/
|
756
807
|
|
757
808
|
|
758
|
-
var bindNodeResource = function
|
759
|
-
|
760
|
-
var _doBind;
|
809
|
+
var bindNodeResource = /*#__PURE__*/function () {
|
810
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(params) {
|
811
|
+
var id, oldResId, newResId, node, parentGroupElement, htTopo, config, groupId, groupTag, _yield$editDispatcher, elements, newData, doBind, _doBind, replaceOrAddRes;
|
761
812
|
|
762
|
-
|
763
|
-
|
764
|
-
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
765
|
-
while (1) switch (_context14.prev = _context14.next) {
|
813
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
814
|
+
while (1) switch (_context9.prev = _context9.next) {
|
766
815
|
case 0:
|
767
816
|
replaceOrAddRes = function _replaceOrAddRes(resources, oldResId, newResId) {
|
768
817
|
return _extends({}, resources, {
|
@@ -772,11 +821,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
772
821
|
});
|
773
822
|
};
|
774
823
|
|
775
|
-
|
776
|
-
|
824
|
+
_doBind = function _doBind3() {
|
825
|
+
_doBind = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
777
826
|
var dm, newLinkElements, createElementsData, groupChildren, newGroupChildren, existedGroupChildren, groupElement, newElement, sm;
|
778
|
-
return _regeneratorRuntime.wrap(function
|
779
|
-
while (1) switch (
|
827
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
828
|
+
while (1) switch (_context8.prev = _context8.next) {
|
780
829
|
case 0:
|
781
830
|
dm = htTopo.getGraphView().dm(); // 创建
|
782
831
|
|
@@ -845,7 +894,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
845
894
|
// node.a("customName", null);
|
846
895
|
// 删除关联在节点上的出口链路
|
847
896
|
|
848
|
-
|
897
|
+
_context8.next = 12;
|
849
898
|
return deleteExLink(node);
|
850
899
|
|
851
900
|
case 12:
|
@@ -856,10 +905,15 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
856
905
|
|
857
906
|
case 13:
|
858
907
|
case "end":
|
859
|
-
return
|
908
|
+
return _context8.stop();
|
860
909
|
}
|
861
|
-
},
|
862
|
-
}))
|
910
|
+
}, _callee8);
|
911
|
+
}));
|
912
|
+
return _doBind.apply(this, arguments);
|
913
|
+
};
|
914
|
+
|
915
|
+
doBind = function _doBind2() {
|
916
|
+
return _doBind.apply(this, arguments);
|
863
917
|
};
|
864
918
|
|
865
919
|
topo.historyManager.beginTransaction();
|
@@ -893,22 +947,22 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
893
947
|
config.resources = replaceOrAddRes(config.resources, oldResId, newResId);
|
894
948
|
}
|
895
949
|
|
896
|
-
|
950
|
+
_context9.next = 13;
|
897
951
|
return resourceConfig.updateConfig(config);
|
898
952
|
|
899
|
-
case
|
900
|
-
|
953
|
+
case 13:
|
954
|
+
_context9.next = 15;
|
901
955
|
return editDispatchers.fetchDataByConfig();
|
902
956
|
|
903
|
-
case
|
904
|
-
_yield$
|
905
|
-
elements = _yield$
|
957
|
+
case 15:
|
958
|
+
_yield$editDispatcher = _context9.sent;
|
959
|
+
elements = _yield$editDispatcher.elements;
|
906
960
|
newData = elements.find(function (item) {
|
907
961
|
return item.id === newResId;
|
908
962
|
});
|
909
963
|
|
910
964
|
if (newData) {
|
911
|
-
|
965
|
+
_context9.next = 23;
|
912
966
|
break;
|
913
967
|
}
|
914
968
|
|
@@ -916,29 +970,37 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
916
970
|
|
917
971
|
rlog.warn("关联资源失败");
|
918
972
|
topo.historyManager.endTransaction();
|
919
|
-
return
|
973
|
+
return _context9.abrupt("return", false);
|
920
974
|
|
921
|
-
case
|
922
|
-
|
975
|
+
case 23:
|
976
|
+
_context9.next = 25;
|
923
977
|
return doBind();
|
924
978
|
|
925
|
-
case
|
979
|
+
case 25:
|
926
980
|
topo.historyManager.endTransaction();
|
927
981
|
|
928
|
-
case
|
982
|
+
case 26:
|
929
983
|
case "end":
|
930
|
-
return
|
984
|
+
return _context9.stop();
|
931
985
|
}
|
932
|
-
},
|
933
|
-
}))
|
934
|
-
|
986
|
+
}, _callee9);
|
987
|
+
}));
|
988
|
+
|
989
|
+
return function bindNodeResource(_x14) {
|
990
|
+
return _ref8.apply(this, arguments);
|
991
|
+
};
|
992
|
+
}();
|
935
993
|
/**
|
936
994
|
* 关联IP的图片节点
|
937
995
|
*/
|
938
996
|
|
939
997
|
|
940
998
|
function relateNodeIp(_x15, _x16) {
|
941
|
-
return
|
999
|
+
return _relateNodeIp.apply(this, arguments);
|
1000
|
+
}
|
1001
|
+
|
1002
|
+
function _relateNodeIp() {
|
1003
|
+
_relateNodeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(txtValue, nodeElement) {
|
942
1004
|
var dm, isUnique, ip, configObj, configData, _elements, newLinkElements, newLink, newLinkGroup, createElementsData, _htTopo;
|
943
1005
|
|
944
1006
|
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
@@ -1014,7 +1076,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1014
1076
|
return _context15.stop();
|
1015
1077
|
}
|
1016
1078
|
}, _callee15);
|
1017
|
-
}))
|
1079
|
+
}));
|
1080
|
+
return _relateNodeIp.apply(this, arguments);
|
1018
1081
|
}
|
1019
1082
|
|
1020
1083
|
var onEvent = function onEvent(e) {
|