@riil-frontend/component-topology 12.0.0-dev.4 → 12.0.0-dev.41
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 +1 -1
- package/build/index.css +1 -1
- package/build/index.js +13 -13
- package/es/components/BatchAttrMetric/setting.js +1 -1
- package/es/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +1 -1
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +1 -1
- package/es/components/TemplateButton/index.module.scss +1 -1
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +59 -4
- package/es/core/components/AlarmListPanel/index.js +1 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +1 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
- package/es/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +1 -1
- package/es/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +1 -1
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +1 -1
- package/es/core/components/TopoView/topoView.js +6 -2
- package/es/core/editor/components/BackgroundView/index.js +1 -1
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +1 -1
- package/es/core/editor/components/EditorPlugin.js +1 -1
- package/es/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +1 -1
- package/es/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +5 -12
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -10
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +9 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +17 -3
- package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +1 -1
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
- package/es/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +1 -1
- package/es/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +1 -1
- package/es/core/editor/hooks/useKeyboardShortcut.js +3 -1
- package/es/core/editor/store/background.js +1 -1
- package/es/core/editor/store/historyManager.js +1 -1
- package/es/core/editor/store/topoEdit.js +1 -1
- package/es/core/editor/utils/copyElementUtil.js +12 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +8 -7
- package/es/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -1
- package/es/core/hooks/useAlarm.js +131 -81
- package/es/core/hooks/useCiAttributeChange.js +1 -1
- package/es/core/hooks/useCmpLinkAlarm.js +153 -0
- package/es/core/hooks/useEventData.js +1 -2
- package/es/core/hooks/useGraphAlarmDisplay.js +91 -56
- package/es/core/hooks/useManageStatus.js +1 -1
- package/es/core/hooks/usePolling.js +1 -1
- package/es/core/hooks/useResourceConfig.js +1 -3
- package/es/core/hooks/useTopoEdit.js +51 -54
- package/es/core/models/Alarm.js +69 -143
- package/es/core/models/AttributeMetricDisplay.js +15 -6
- package/es/core/models/HistoryManager.js +1 -1
- package/es/core/models/SelectionModel.js +1 -1
- package/es/core/models/TopoApp.js +2 -2
- package/es/core/models/attributeFormatter/formatter/graphTransform.js +1 -1
- package/es/core/models/attributeFormatter/index.js +1 -1
- package/es/core/models/cache/CiCache.d.ts +1 -1
- package/es/core/models/cache/CiCache.js +3 -3
- package/es/core/models/cache/CiTypeCache.js +5 -1
- package/es/core/models/cache/DictCache.js +1 -1
- package/es/core/models/plugins/resourceWebControllUrl.js +1 -1
- package/es/core/models/tagstips/ElementTagTipConfig.js +1 -1
- package/es/core/models/topoData.js +0 -1
- package/es/core/services/alarm.js +1 -1
- package/es/core/services/index.js +1 -1
- package/es/core/services/topo/basic.js +2 -2
- package/es/core/store/models/customIcon.js +1 -1
- package/es/core/store/models/displayConfig.js +1 -1
- package/es/core/store/models/selection.js +1 -1
- package/es/core/store/models/topoBaseInfoOverview.js +1 -1
- package/es/core/store/models/topoBizMod.js +1 -1
- package/es/core/store/models/topoConfig.js +7 -10
- package/es/core/store/models/topoGraphView.js +1 -1
- package/es/core/store/models/topoMod.js +82 -135
- package/es/core/store/models/viewer/lock.js +1 -1
- package/es/core/store/models/viewer/resourceDetail.js +1 -1
- package/es/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
- package/es/core/utils/edgeUtil.js +10 -1
- package/es/core/utils/metricUtil.js +8 -4
- package/es/core/utils/showGraphManageStatusUtil.js +3 -2
- package/es/core/utils/showMessage.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +46 -21
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +4 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +8 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +1 -1
- package/es/core/viewer/components/plugins/ViewerPlugin.js +3 -1
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
- package/es/networkTopo/components/Link/index.js +1 -1
- package/es/networkTopo/components/TopoView.js +6 -11
- package/es/networkTopo/hooks/useEdgeExpand.js +2 -3
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +1 -1
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +1 -1
- package/es/networkTopo/models/LinkTagsTipsBuilder.js +1 -1
- package/es/networkTopo/models/TopoCenter.js +1 -1
- package/es/networkTopo/services/model.js +1 -1
- package/es/networkTopo/services/topo/basic.js +4 -4
- package/es/networkTopo/services/topo/ciInfo.js +1 -1
- package/es/networkTopo/store/functionAuth.js +1 -1
- package/es/networkTopo/store/topoCenter.js +261 -224
- package/es/networkTopo/store/topoTreeMod.js +1 -1
- package/es/networkTopo/utils/exportData.js +1 -1
- package/es/style.js +2 -2
- package/es/utils/ResourceConfigUtil.js +4 -37
- package/es/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
- package/es/utils/ciRefAttributeTranslateUtil.js +155 -0
- package/es/utils/format.js +1 -1
- package/es/utils/topoData.js +4 -2
- package/lib/components/BatchAttrMetric/setting.js +2 -2
- package/lib/components/ModelAttrSelectDrawer/components/MultipleTypeAttributeSelectDrawer.js +2 -2
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +2 -2
- package/lib/components/TemplateButton/index.module.scss +1 -1
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +61 -4
- package/lib/core/components/AlarmListPanel/index.js +1 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -2
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +2 -2
- package/lib/core/components/DisplaySettingDrawer/ResourceDisplay/BasicConfig.js +3 -3
- package/lib/core/components/DisplaySettingDrawer/components/NodeAttrSettingDrawer.js +2 -2
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +2 -2
- package/lib/core/components/TopoView/topoView.js +14 -10
- package/lib/core/editor/components/BackgroundView/index.js +3 -3
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +2 -2
- package/lib/core/editor/components/EditorPlugin.js +3 -3
- package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +2 -4
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +2 -4
- package/lib/core/editor/components/Sidebar/views/LinkPanel.js +2 -4
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +6 -12
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -9
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
- package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +5 -5
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/BasicSetting.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/layer/SettingTab/Setting.js +3 -3
- package/lib/core/editor/components/settings/propertyViews/view/hooks/useBackgroundSizeConfig.js +2 -2
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
- package/lib/core/editor/store/background.js +1 -1
- package/lib/core/editor/store/historyManager.js +1 -1
- package/lib/core/editor/store/topoEdit.js +1 -1
- package/lib/core/editor/utils/copyElementUtil.js +15 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +8 -6
- package/lib/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -3
- package/lib/core/hooks/useAlarm.js +130 -79
- package/lib/core/hooks/useCiAttributeChange.js +1 -1
- package/lib/core/hooks/useCmpLinkAlarm.js +166 -0
- package/lib/core/hooks/useEventData.js +1 -2
- package/lib/core/hooks/useGraphAlarmDisplay.js +91 -55
- package/lib/core/hooks/useManageStatus.js +1 -1
- package/lib/core/hooks/usePolling.js +3 -3
- package/lib/core/hooks/useResourceConfig.js +1 -3
- package/lib/core/hooks/useTopoEdit.js +50 -53
- package/lib/core/models/Alarm.js +76 -152
- package/lib/core/models/AttributeMetricDisplay.js +18 -6
- package/lib/core/models/HistoryManager.js +8 -8
- package/lib/core/models/SelectionModel.js +5 -5
- package/lib/core/models/TopoApp.js +4 -6
- package/lib/core/models/attributeFormatter/formatter/graphTransform.js +2 -4
- package/lib/core/models/attributeFormatter/index.js +1 -1
- package/lib/core/models/cache/CiCache.d.ts +1 -1
- package/lib/core/models/cache/CiCache.js +3 -3
- package/lib/core/models/cache/CiTypeCache.js +6 -2
- package/lib/core/models/cache/DictCache.js +2 -2
- package/lib/core/models/plugins/resourceWebControllUrl.js +2 -2
- package/lib/core/models/tagstips/ElementTagTipConfig.js +2 -2
- package/lib/core/models/topoData.js +0 -1
- package/lib/core/services/alarm.js +2 -2
- package/lib/core/services/index.js +1 -1
- package/lib/core/services/topo/basic.js +2 -2
- package/lib/core/store/models/customIcon.js +3 -3
- package/lib/core/store/models/displayConfig.js +1 -1
- package/lib/core/store/models/selection.js +1 -1
- package/lib/core/store/models/topoBaseInfoOverview.js +1 -1
- package/lib/core/store/models/topoBizMod.js +1 -1
- package/lib/core/store/models/topoConfig.js +7 -10
- package/lib/core/store/models/topoGraphView.js +1 -1
- package/lib/core/store/models/topoMod.js +89 -142
- package/lib/core/store/models/viewer/lock.js +1 -1
- package/lib/core/store/models/viewer/resourceDetail.js +1 -1
- package/lib/core/store/models/viewer/resourceWebControllUrlSetting.js +1 -1
- package/lib/core/utils/edgeUtil.js +12 -1
- package/lib/core/utils/metricUtil.js +8 -4
- package/lib/core/utils/showGraphManageStatusUtil.js +3 -2
- package/lib/core/utils/showMessage.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +1 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +48 -21
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +3 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +4 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +6 -6
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +3 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +8 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +2 -2
- package/lib/core/viewer/components/plugins/ViewerPlugin.js +3 -1
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
- package/lib/networkTopo/components/Link/index.js +2 -2
- package/lib/networkTopo/components/TopoView.js +5 -14
- package/lib/networkTopo/hooks/useEdgeExpand.js +2 -3
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +4 -4
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +3 -5
- package/lib/networkTopo/models/LinkTagsTipsBuilder.js +3 -3
- package/lib/networkTopo/models/TopoCenter.js +1 -1
- package/lib/networkTopo/services/model.js +1 -3
- package/lib/networkTopo/services/topo/basic.js +4 -6
- package/lib/networkTopo/services/topo/ciInfo.js +0 -2
- package/lib/networkTopo/store/functionAuth.js +1 -1
- package/lib/networkTopo/store/topoCenter.js +263 -226
- package/lib/networkTopo/store/topoTreeMod.js +5 -5
- package/lib/networkTopo/utils/exportData.js +1 -3
- package/lib/style.js +2 -2
- package/lib/utils/ResourceConfigUtil.js +4 -39
- package/lib/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
- package/lib/utils/ciRefAttributeTranslateUtil.js +168 -0
- package/lib/utils/format.js +1 -1
- package/lib/utils/topoData.js +4 -2
- package/package.json +4 -4
@@ -17,7 +17,7 @@ var _ahooks = require("ahooks");
|
|
17
17
|
|
18
18
|
var _lodash = _interopRequireDefault(require("lodash"));
|
19
19
|
|
20
|
-
var
|
20
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
21
21
|
|
22
22
|
var _componentRiilEventEmitter = require("@riil-frontend/component-riil-event-emitter");
|
23
23
|
|
@@ -227,7 +227,7 @@ var usePolling = function usePolling(props) {
|
|
227
227
|
|
228
228
|
(0, _react.useEffect)(function () {
|
229
229
|
if (topo.options.enableDefaultMetricLoader) {
|
230
|
-
|
230
|
+
_componentTopologyUtils.rlog.debug('usePolling.useEffect: 开始轮询', {
|
231
231
|
pollingSwitch: pollingSwitch,
|
232
232
|
resIdsList: resIdsList,
|
233
233
|
resourceOverviewState: resourceOverviewState,
|
@@ -239,7 +239,7 @@ var usePolling = function usePolling(props) {
|
|
239
239
|
|
240
240
|
return function () {
|
241
241
|
if (loading) {
|
242
|
-
|
242
|
+
_componentTopologyUtils.rlog.debug('usePolling.useEffect: 结束轮询', resAndMetrics);
|
243
243
|
|
244
244
|
stopPoll();
|
245
245
|
}
|
@@ -56,9 +56,7 @@ function _default(props) {
|
|
56
56
|
return {
|
57
57
|
resources: config.resources,
|
58
58
|
groups: config.groups,
|
59
|
-
|
60
|
-
relateTopoIdList: config.relateTopoIdList //linkIps: config.linkIps,
|
61
|
-
|
59
|
+
relateTopoIdList: config.relateTopoIdList
|
62
60
|
};
|
63
61
|
};
|
64
62
|
|
@@ -383,33 +383,26 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
383
383
|
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(node) {
|
384
384
|
var _node$getEdges$toArra, _node$getEdges;
|
385
385
|
|
386
|
-
var
|
386
|
+
var edges;
|
387
387
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
388
388
|
while (1) switch (_context4.prev = _context4.next) {
|
389
389
|
case 0:
|
390
|
-
|
390
|
+
// console.log("删除关联在节点上的出口链路- node, config", node, config);
|
391
|
+
edges = (_node$getEdges$toArra = (_node$getEdges = node.getEdges()) === null || _node$getEdges === void 0 ? void 0 : _node$getEdges.toArray()) !== null && _node$getEdges$toArra !== void 0 ? _node$getEdges$toArra : [];
|
391
392
|
|
392
|
-
|
393
|
+
if (edges.length > 0) {
|
394
|
+
edges.map(function (edge) {
|
395
|
+
if (edge.getTag()) {
|
396
|
+
var link = topo.dataModel.getDataById(edge.getTag());
|
393
397
|
|
394
|
-
|
395
|
-
|
396
|
-
|
398
|
+
if (link && (0, _linkUtils.isExitLink)(link)) {
|
399
|
+
topo.getGraphView().dm().remove(edge);
|
400
|
+
}
|
401
|
+
}
|
402
|
+
});
|
397
403
|
}
|
398
404
|
|
399
|
-
|
400
|
-
|
401
|
-
edges.map(function (edge) {
|
402
|
-
if (edge.a("dtype") === "link" && exportLinkIdList.indexOf(edge.getTag()) >= 0) {
|
403
|
-
// exLink.push(edge);
|
404
|
-
topo.getGraphView().dm().remove(edge);
|
405
|
-
exportLinkIdList.splice(config.exportLinkIdList.indexOf(edge.getTag()), 1);
|
406
|
-
}
|
407
|
-
});
|
408
|
-
config.exportLinkIdList = exportLinkIdList;
|
409
|
-
_context4.next = 8;
|
410
|
-
return resourceConfig.updateConfig(config);
|
411
|
-
|
412
|
-
case 8:
|
405
|
+
case 2:
|
413
406
|
case "end":
|
414
407
|
return _context4.stop();
|
415
408
|
}
|
@@ -591,7 +584,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
591
584
|
|
592
585
|
function _bindViewResources() {
|
593
586
|
_bindViewResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(data) {
|
594
|
-
var config,
|
587
|
+
var config, result, _elements;
|
595
588
|
|
596
589
|
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
597
590
|
while (1) switch (_context12.prev = _context12.next) {
|
@@ -607,15 +600,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
607
600
|
return editDispatchers.fetchDataByConfig();
|
608
601
|
|
609
602
|
case 6:
|
610
|
-
|
611
|
-
|
612
|
-
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
|
603
|
+
result = _context12.sent;
|
604
|
+
console.log("fetchDataByConfig", result);
|
613
605
|
|
614
|
-
if (
|
615
|
-
|
606
|
+
if (result) {
|
607
|
+
_elements = result.elements;
|
608
|
+
saveBind(_componentTopologyGraph.TopoEvent.DATA_TYPE_RESOURCE_COMBO, _elements); // 临时放这里,仅拓扑中心有
|
609
|
+
|
610
|
+
if (topo.linkDynamicStyleExecutor) {
|
611
|
+
topo.linkDynamicStyleExecutor.execute();
|
612
|
+
}
|
616
613
|
}
|
617
614
|
|
618
|
-
case
|
615
|
+
case 9:
|
619
616
|
case "end":
|
620
617
|
return _context12.stop();
|
621
618
|
}
|
@@ -630,7 +627,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
630
627
|
|
631
628
|
function _addLayerResources() {
|
632
629
|
_addLayerResources = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(group, newResourceIds) {
|
633
|
-
var _yield$
|
630
|
+
var _yield$editDispatcher3, elements, newElements;
|
634
631
|
|
635
632
|
return _regenerator["default"].wrap(function _callee13$(_context13) {
|
636
633
|
while (1) switch (_context13.prev = _context13.next) {
|
@@ -645,8 +642,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
645
642
|
return editDispatchers.fetchDataByConfig();
|
646
643
|
|
647
644
|
case 5:
|
648
|
-
_yield$
|
649
|
-
elements = _yield$
|
645
|
+
_yield$editDispatcher3 = _context13.sent;
|
646
|
+
elements = _yield$editDispatcher3.elements;
|
650
647
|
// 2022-11-10 修复 添加资源后分层重新布局问题,仅布局新增资源。替换api topo.updateElements(data)
|
651
648
|
newElements = findUNExistedElements(elements);
|
652
649
|
|
@@ -869,7 +866,9 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
869
866
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
870
867
|
while (1) switch (_context8.prev = _context8.next) {
|
871
868
|
case 0:
|
872
|
-
dm = htTopo.getGraphView().dm(); //
|
869
|
+
dm = htTopo.getGraphView().dm(); // 移除旧节点。先删除后创建,解决ip节点替换ping资源后链路丢失问题
|
870
|
+
|
871
|
+
dm.remove(node); // 创建
|
873
872
|
|
874
873
|
newLinkElements = findUNExistedLinkElements(elements);
|
875
874
|
createElementsData = null;
|
@@ -931,22 +930,13 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
931
930
|
|
932
931
|
|
933
932
|
sm = htTopo.getGraphView().sm();
|
934
|
-
sm.setSelection([newElement]); //
|
933
|
+
sm.setSelection([newElement]); // 临时放这里,仅拓扑中心有
|
935
934
|
|
936
|
-
dm.remove(node); // saveBind(TopoEvent.DATA_TYPE_RESOURCE_SINGLE, newDatas);
|
937
|
-
// node.a("customName", null);
|
938
|
-
// 删除关联在节点上的出口链路
|
939
|
-
|
940
|
-
_context8.next = 12;
|
941
|
-
return deleteExLink(node);
|
942
|
-
|
943
|
-
case 12:
|
944
|
-
// 临时放这里,仅拓扑中心有
|
945
935
|
if (topo.linkDynamicStyleExecutor) {
|
946
936
|
topo.linkDynamicStyleExecutor.execute();
|
947
937
|
}
|
948
938
|
|
949
|
-
case
|
939
|
+
case 11:
|
950
940
|
case "end":
|
951
941
|
return _context8.stop();
|
952
942
|
}
|
@@ -1011,11 +1001,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1011
1001
|
break;
|
1012
1002
|
}
|
1013
1003
|
|
1004
|
+
topo.historyManager.endTransaction();
|
1005
|
+
|
1014
1006
|
_message["default"].error("关联资源失败");
|
1015
1007
|
|
1016
|
-
_rlog["default"].
|
1008
|
+
_rlog["default"].error("关联资源失败");
|
1017
1009
|
|
1018
|
-
topo.historyManager.endTransaction();
|
1019
1010
|
return _context9.abrupt("return", false);
|
1020
1011
|
|
1021
1012
|
case 23:
|
@@ -1047,7 +1038,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1047
1038
|
|
1048
1039
|
function _relateNodeIp() {
|
1049
1040
|
_relateNodeIp = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(txtValue, nodeElement) {
|
1050
|
-
var dm, isUnique,
|
1041
|
+
var dm, isUnique, ipNodeData, configObj, configData, _elements2, newLinkElements, newLink, newLinkGroup, createElementsData, _htTopo;
|
1051
1042
|
|
1052
1043
|
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
1053
1044
|
while (1) switch (_context15.prev = _context15.next) {
|
@@ -1069,16 +1060,16 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1069
1060
|
isUnique = (0, _exitLinkUtil.isUniqueIp)(dm, txtValue, nodeElement); // 获取关联链路
|
1070
1061
|
|
1071
1062
|
if (!isUnique) {
|
1072
|
-
_context15.next =
|
1063
|
+
_context15.next = 24;
|
1073
1064
|
break;
|
1074
1065
|
}
|
1075
1066
|
|
1076
|
-
|
1067
|
+
ipNodeData = (0, _exitLinkUtil.buildIpNode)(txtValue);
|
1077
1068
|
_context15.next = 8;
|
1078
1069
|
return deleteExLink(nodeElement);
|
1079
1070
|
|
1080
1071
|
case 8:
|
1081
|
-
nodeElement.a(
|
1072
|
+
nodeElement.a(ipNodeData);
|
1082
1073
|
nodeElement.setName(txtValue);
|
1083
1074
|
nodeElement.setTag("ip:" + txtValue); // 获取配置
|
1084
1075
|
|
@@ -1093,8 +1084,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1093
1084
|
case 16:
|
1094
1085
|
configData = _context15.sent;
|
1095
1086
|
// console.log("configData",configObj, configData);
|
1096
|
-
|
1097
|
-
newLinkElements = findUNExistedLinkElements(
|
1087
|
+
_elements2 = configData.elements;
|
1088
|
+
newLinkElements = findUNExistedLinkElements(_elements2); // console.log("configData", configData, newLinkElements);
|
1098
1089
|
|
1099
1090
|
newLink = newLinkElements.filter(function (item) {
|
1100
1091
|
return item.type === "link";
|
@@ -1109,15 +1100,21 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1109
1100
|
nodes: [],
|
1110
1101
|
links: newLink,
|
1111
1102
|
linkGroups: newLinkGroup
|
1112
|
-
};
|
1103
|
+
};
|
1104
|
+
console.log("createElementsData", createElementsData);
|
1113
1105
|
|
1114
1106
|
if ([].concat(newLink, newLinkGroup).length > 0) {
|
1115
1107
|
_htTopo = topo.getHtTopo();
|
1116
1108
|
|
1117
|
-
_htTopo.createElements(createElementsData);
|
1109
|
+
_htTopo.createElements(createElementsData); // 临时放这里,仅拓扑中心有
|
1110
|
+
|
1111
|
+
|
1112
|
+
if (topo.linkDynamicStyleExecutor) {
|
1113
|
+
topo.linkDynamicStyleExecutor.execute();
|
1114
|
+
}
|
1118
1115
|
}
|
1119
1116
|
|
1120
|
-
case
|
1117
|
+
case 24:
|
1121
1118
|
case "end":
|
1122
1119
|
return _context15.stop();
|
1123
1120
|
}
|