@riil-frontend/component-topology 12.0.0-dev.1 → 12.0.0-dev.10
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.js +14 -14
- 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/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/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 +24 -9
- package/es/core/hooks/__tests__/useCiAttributeChange.test.js +0 -0
- package/es/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -1
- package/es/core/hooks/useCiAttributeChange.js +35 -16
- 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 +48 -52
- package/es/core/models/Alarm.js +1 -1
- package/es/core/models/AttributeMetricDisplay.js +6 -3
- 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/commonTransform.js +0 -5
- package/es/core/models/attributeFormatter/formatter/graphTransform.js +1 -1
- package/es/core/models/attributeFormatter/index.js +1 -1
- 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 +1 -1
- 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 +2 -1
- package/es/core/utils/metricUtil.js +8 -1
- 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 +12 -13
- 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/WebConsole/WebConsoleForm/hooks/useWebConsole.js +1 -1
- package/es/networkTopo/components/Link/index.js +1 -1
- 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 +1 -1
- package/es/networkTopo/store/topoTreeMod.js +1 -1
- package/es/networkTopo/utils/exportData.js +1 -1
- package/es/style.js +1 -1
- package/es/utils/ResourceConfigUtil.js +4 -37
- package/es/utils/ciRefAttributeTranslateUtil.d.ts +12 -0
- package/es/utils/ciRefAttributeTranslateUtil.js +156 -0
- package/es/utils/clipboardUtil.d.ts +7 -0
- package/es/utils/clipboardUtil.js +104 -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/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/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 +29 -9
- package/lib/core/hooks/__tests__/useCiAttributeChange.test.js +1 -0
- package/lib/core/hooks/ht/useHtDataPropertyChangeListener.js +1 -3
- package/lib/core/hooks/useCiAttributeChange.js +34 -15
- 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 +47 -51
- package/lib/core/models/Alarm.js +10 -10
- package/lib/core/models/AttributeMetricDisplay.js +8 -4
- 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/commonTransform.js +0 -5
- package/lib/core/models/attributeFormatter/formatter/graphTransform.js +2 -4
- package/lib/core/models/attributeFormatter/index.js +1 -1
- 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 +9 -9
- 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 +2 -1
- package/lib/core/utils/metricUtil.js +8 -1
- 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 +12 -13
- 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/WebConsole/WebConsoleForm/hooks/useWebConsole.js +2 -2
- package/lib/networkTopo/components/Link/index.js +2 -2
- 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 +1 -1
- package/lib/networkTopo/store/topoTreeMod.js +5 -5
- package/lib/networkTopo/utils/exportData.js +1 -3
- package/lib/style.js +1 -1
- package/lib/utils/ResourceConfigUtil.js +4 -39
- package/lib/utils/ciRefAttributeTranslateUtil.d.ts +12 -0
- package/lib/utils/ciRefAttributeTranslateUtil.js +169 -0
- package/lib/utils/clipboardUtil.d.ts +7 -0
- package/lib/utils/clipboardUtil.js +113 -0
- package/lib/utils/format.js +1 -1
- package/lib/utils/topoData.js +4 -2
- package/package.json +4 -4
@@ -15,7 +15,7 @@ import useGroupAddResource from "./useGroupAddResource";
|
|
15
15
|
import { findGroupChildren } from "../../utils/topoData";
|
16
16
|
import { isResourceElement } from "../../utils/htElementDataUtil";
|
17
17
|
import { isClusterHtElement, isClusterMemberHtElement } from "../../utils/clusterUtil";
|
18
|
-
import { mergeExportLinkData } from "../models/utils/linkUtils";
|
18
|
+
import { isExitLink, mergeExportLinkData } from "../models/utils/linkUtils";
|
19
19
|
import { isUniqueIp, buildIpNode } from "../../networkTopo/utils/exitLinkUtil";
|
20
20
|
|
21
21
|
var useTopoEdit = function useTopoEdit(params) {
|
@@ -349,33 +349,26 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
349
349
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(node) {
|
350
350
|
var _node$getEdges$toArra, _node$getEdges;
|
351
351
|
|
352
|
-
var
|
352
|
+
var edges;
|
353
353
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
354
354
|
while (1) switch (_context4.prev = _context4.next) {
|
355
355
|
case 0:
|
356
|
-
|
356
|
+
// console.log("删除关联在节点上的出口链路- node, config", node, config);
|
357
|
+
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 : [];
|
357
358
|
|
358
|
-
|
359
|
+
if (edges.length > 0) {
|
360
|
+
edges.map(function (edge) {
|
361
|
+
if (edge.getTag()) {
|
362
|
+
var link = topo.dataModel.getDataById(edge.getTag());
|
359
363
|
|
360
|
-
|
361
|
-
|
362
|
-
|
364
|
+
if (link && isExitLink(link)) {
|
365
|
+
topo.getGraphView().dm().remove(edge);
|
366
|
+
}
|
367
|
+
}
|
368
|
+
});
|
363
369
|
}
|
364
370
|
|
365
|
-
|
366
|
-
|
367
|
-
edges.map(function (edge) {
|
368
|
-
if (edge.a("dtype") === "link" && exportLinkIdList.indexOf(edge.getTag()) >= 0) {
|
369
|
-
// exLink.push(edge);
|
370
|
-
topo.getGraphView().dm().remove(edge);
|
371
|
-
exportLinkIdList.splice(config.exportLinkIdList.indexOf(edge.getTag()), 1);
|
372
|
-
}
|
373
|
-
});
|
374
|
-
config.exportLinkIdList = exportLinkIdList;
|
375
|
-
_context4.next = 8;
|
376
|
-
return resourceConfig.updateConfig(config);
|
377
|
-
|
378
|
-
case 8:
|
371
|
+
case 2:
|
379
372
|
case "end":
|
380
373
|
return _context4.stop();
|
381
374
|
}
|
@@ -554,7 +547,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
554
547
|
|
555
548
|
function _bindViewResources() {
|
556
549
|
_bindViewResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(data) {
|
557
|
-
var config,
|
550
|
+
var config, result, _elements;
|
558
551
|
|
559
552
|
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
560
553
|
while (1) switch (_context12.prev = _context12.next) {
|
@@ -570,15 +563,19 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
570
563
|
return editDispatchers.fetchDataByConfig();
|
571
564
|
|
572
565
|
case 6:
|
573
|
-
|
574
|
-
|
575
|
-
saveBind(TopoEvent.DATA_TYPE_RESOURCE_COMBO, elements); // 临时放这里,仅拓扑中心有
|
566
|
+
result = _context12.sent;
|
567
|
+
console.log("fetchDataByConfig", result);
|
576
568
|
|
577
|
-
if (
|
578
|
-
|
569
|
+
if (result) {
|
570
|
+
_elements = result.elements;
|
571
|
+
saveBind(TopoEvent.DATA_TYPE_RESOURCE_COMBO, _elements); // 临时放这里,仅拓扑中心有
|
572
|
+
|
573
|
+
if (topo.linkDynamicStyleExecutor) {
|
574
|
+
topo.linkDynamicStyleExecutor.execute();
|
575
|
+
}
|
579
576
|
}
|
580
577
|
|
581
|
-
case
|
578
|
+
case 9:
|
582
579
|
case "end":
|
583
580
|
return _context12.stop();
|
584
581
|
}
|
@@ -593,7 +590,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
593
590
|
|
594
591
|
function _addLayerResources() {
|
595
592
|
_addLayerResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(group, newResourceIds) {
|
596
|
-
var _yield$
|
593
|
+
var _yield$editDispatcher3, elements, newElements;
|
597
594
|
|
598
595
|
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
599
596
|
while (1) switch (_context13.prev = _context13.next) {
|
@@ -608,8 +605,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
608
605
|
return editDispatchers.fetchDataByConfig();
|
609
606
|
|
610
607
|
case 5:
|
611
|
-
_yield$
|
612
|
-
elements = _yield$
|
608
|
+
_yield$editDispatcher3 = _context13.sent;
|
609
|
+
elements = _yield$editDispatcher3.elements;
|
613
610
|
// 2022-11-10 修复 添加资源后分层重新布局问题,仅布局新增资源。替换api topo.updateElements(data)
|
614
611
|
newElements = findUNExistedElements(elements);
|
615
612
|
rlog.debug("添加分层资源", {
|
@@ -827,7 +824,9 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
827
824
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
828
825
|
while (1) switch (_context8.prev = _context8.next) {
|
829
826
|
case 0:
|
830
|
-
dm = htTopo.getGraphView().dm(); //
|
827
|
+
dm = htTopo.getGraphView().dm(); // 移除旧节点。先删除后创建,解决ip节点替换ping资源后链路丢失问题
|
828
|
+
|
829
|
+
dm.remove(node); // 创建
|
831
830
|
|
832
831
|
newLinkElements = findUNExistedLinkElements(elements);
|
833
832
|
createElementsData = null;
|
@@ -888,22 +887,13 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
888
887
|
|
889
888
|
|
890
889
|
sm = htTopo.getGraphView().sm();
|
891
|
-
sm.setSelection([newElement]); //
|
892
|
-
|
893
|
-
dm.remove(node); // saveBind(TopoEvent.DATA_TYPE_RESOURCE_SINGLE, newDatas);
|
894
|
-
// node.a("customName", null);
|
895
|
-
// 删除关联在节点上的出口链路
|
896
|
-
|
897
|
-
_context8.next = 12;
|
898
|
-
return deleteExLink(node);
|
890
|
+
sm.setSelection([newElement]); // 临时放这里,仅拓扑中心有
|
899
891
|
|
900
|
-
case 12:
|
901
|
-
// 临时放这里,仅拓扑中心有
|
902
892
|
if (topo.linkDynamicStyleExecutor) {
|
903
893
|
topo.linkDynamicStyleExecutor.execute();
|
904
894
|
}
|
905
895
|
|
906
|
-
case
|
896
|
+
case 11:
|
907
897
|
case "end":
|
908
898
|
return _context8.stop();
|
909
899
|
}
|
@@ -1001,7 +991,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1001
991
|
|
1002
992
|
function _relateNodeIp() {
|
1003
993
|
_relateNodeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(txtValue, nodeElement) {
|
1004
|
-
var dm, isUnique,
|
994
|
+
var dm, isUnique, ipNodeData, configObj, configData, _elements2, newLinkElements, newLink, newLinkGroup, createElementsData, _htTopo;
|
1005
995
|
|
1006
996
|
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
1007
997
|
while (1) switch (_context15.prev = _context15.next) {
|
@@ -1023,16 +1013,16 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1023
1013
|
isUnique = isUniqueIp(dm, txtValue, nodeElement); // 获取关联链路
|
1024
1014
|
|
1025
1015
|
if (!isUnique) {
|
1026
|
-
_context15.next =
|
1016
|
+
_context15.next = 24;
|
1027
1017
|
break;
|
1028
1018
|
}
|
1029
1019
|
|
1030
|
-
|
1020
|
+
ipNodeData = buildIpNode(txtValue);
|
1031
1021
|
_context15.next = 8;
|
1032
1022
|
return deleteExLink(nodeElement);
|
1033
1023
|
|
1034
1024
|
case 8:
|
1035
|
-
nodeElement.a(
|
1025
|
+
nodeElement.a(ipNodeData);
|
1036
1026
|
nodeElement.setName(txtValue);
|
1037
1027
|
nodeElement.setTag("ip:" + txtValue); // 获取配置
|
1038
1028
|
|
@@ -1047,8 +1037,8 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1047
1037
|
case 16:
|
1048
1038
|
configData = _context15.sent;
|
1049
1039
|
// console.log("configData",configObj, configData);
|
1050
|
-
|
1051
|
-
newLinkElements = findUNExistedLinkElements(
|
1040
|
+
_elements2 = configData.elements;
|
1041
|
+
newLinkElements = findUNExistedLinkElements(_elements2); // console.log("configData", configData, newLinkElements);
|
1052
1042
|
|
1053
1043
|
newLink = newLinkElements.filter(function (item) {
|
1054
1044
|
return item.type === "link";
|
@@ -1063,15 +1053,21 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1063
1053
|
nodes: [],
|
1064
1054
|
links: newLink,
|
1065
1055
|
linkGroups: newLinkGroup
|
1066
|
-
};
|
1056
|
+
};
|
1057
|
+
console.log("createElementsData", createElementsData);
|
1067
1058
|
|
1068
1059
|
if ([].concat(newLink, newLinkGroup).length > 0) {
|
1069
1060
|
_htTopo = topo.getHtTopo();
|
1070
1061
|
|
1071
|
-
_htTopo.createElements(createElementsData);
|
1062
|
+
_htTopo.createElements(createElementsData); // 临时放这里,仅拓扑中心有
|
1063
|
+
|
1064
|
+
|
1065
|
+
if (topo.linkDynamicStyleExecutor) {
|
1066
|
+
topo.linkDynamicStyleExecutor.execute();
|
1067
|
+
}
|
1072
1068
|
}
|
1073
1069
|
|
1074
|
-
case
|
1070
|
+
case 24:
|
1075
1071
|
case "end":
|
1076
1072
|
return _context15.stop();
|
1077
1073
|
}
|
package/es/core/models/Alarm.js
CHANGED
@@ -2,7 +2,7 @@ import _Dialog from "@alifd/next/es/dialog";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
import { isAvailableArray } from '@riil-frontend/utils';
|
7
7
|
|
8
8
|
var Alarm = /*#__PURE__*/function () {
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
-
import rlog from '@riil-frontend/component-topology-utils
|
4
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
5
5
|
import { DEFAULT_NODE_TAG_COMMON_CONFIG, DEFAULT_TIP_COMMON_CONFIG } from "../../constants/ResourceInfoDisplay";
|
6
6
|
import { isMonitoring } from "../utils/manageStatusUtil";
|
7
7
|
import AttributeFormatter from "./attributeFormatter";
|
8
8
|
import DictCache from "./cache/DictCache";
|
9
9
|
import { getNodesNameVisible as _getNodesNameVisible, updateNodesNameVisible as _updateNodesNameVisible } from "./utils/nodeNameVisibleUtil";
|
10
|
+
import { translateCisRefAttributeName } from "../../utils/ciRefAttributeTranslateUtil";
|
10
11
|
|
11
12
|
function isGraphField(item) {
|
12
13
|
return item.type === 'graph';
|
@@ -331,7 +332,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
331
332
|
}); // 翻译引用属性
|
332
333
|
|
333
334
|
_context.next = 4;
|
334
|
-
return
|
335
|
+
return translateCisRefAttributeName(ciDatas);
|
335
336
|
|
336
337
|
case 4:
|
337
338
|
ciDatas = _context.sent;
|
@@ -461,8 +462,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
461
462
|
var refCi = refCiMap[refAttrs.id];
|
462
463
|
|
463
464
|
if (refCi) {
|
465
|
+
// 引用ci名称获取规则:如果ci是树形结构(例如区域),取 tree_name_path;非树形,取display_name
|
466
|
+
var displayName = refCi.attributes.tree_name_path || refCi.attributes.display_name;
|
464
467
|
attributeMap[refAttrs.attrCode + "_object"] = {
|
465
|
-
displayName:
|
468
|
+
displayName: displayName
|
466
469
|
};
|
467
470
|
}
|
468
471
|
});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import rlog from '@riil-frontend/component-topology-utils
|
2
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
3
3
|
import useHtElements from "../common/hooks/useHtElements";
|
4
4
|
import ignoreList from "./selection/ignoreList";
|
5
5
|
|
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import { setRequest } from '@riil-frontend/component-topology-utils';
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
import { cloneDeep } from 'lodash';
|
7
7
|
import topoService from "../services/topo";
|
8
8
|
import CiTypeCache from "./cache/CiTypeCache";
|
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
|
24
24
|
import SelectionModel from "./SelectionModel";
|
25
25
|
import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
|
26
26
|
|
27
|
-
var version = typeof "12.0.0-dev.
|
27
|
+
var version = typeof "12.0.0-dev.10" === 'string' ? "12.0.0-dev.10" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
@@ -13,11 +13,6 @@ export default function commonTransform(options) {
|
|
13
13
|
if (ciData[attrType + "Map"][fieldCode + "_object"]) {
|
14
14
|
fieldValue = ciData[attrType + "Map"][fieldCode + "_object"].displayName;
|
15
15
|
}
|
16
|
-
} // 分级字典特殊处理
|
17
|
-
|
18
|
-
|
19
|
-
if (fieldMeta.dict) {
|
20
|
-
fieldValue = fieldMeta.dict[fieldValue];
|
21
16
|
}
|
22
17
|
|
23
18
|
return {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import rlog from '@riil-frontend/component-topology-utils
|
1
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
2
2
|
import attributeTransform from "./formatter/attributeTransform";
|
3
3
|
import metricTransform from "./formatter/metricTransform";
|
4
4
|
import ciTypeAttrTransform from "./formatter/ciTypeAttrTransform";
|
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
5
5
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import keyBy from 'lodash/keyBy';
|
8
8
|
/**
|
9
9
|
* Ci类型属性、指标缓存
|
@@ -106,6 +106,10 @@ var CiTypeCache = /*#__PURE__*/function () {
|
|
106
106
|
this.ciTypeMap = cache;
|
107
107
|
};
|
108
108
|
|
109
|
+
_proto.getCiTypeMap = function getCiTypeMap() {
|
110
|
+
return this.ciTypeMap;
|
111
|
+
};
|
112
|
+
|
109
113
|
_proto.getCiType = function getCiType(typeCode) {
|
110
114
|
return this.ciTypeMap[typeCode];
|
111
115
|
};
|
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
3
|
import { dictFormat } from '@riil-frontend/utils';
|
4
4
|
import * as modelService from '@riil-frontend/component-topology-common/es/services/model';
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
/**
|
7
7
|
* 数据字典缓存
|
8
8
|
*/
|
@@ -2,7 +2,7 @@ import _Message from "@alifd/next/es/message";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
export default function (topo) {
|
7
7
|
var resourceUrlMap = {};
|
8
8
|
var currentId = null;
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import keyBy from 'lodash/keyBy';
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
import { getLinkMtCodes, getMtCodeCiTypeMap, getNodeMtCodes } from "./utils";
|
7
7
|
import { getMetricsByMonitorTemplateCodes } from "../../services/topo/tagtip";
|
8
8
|
/**
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
export default {
|
7
7
|
/**
|
8
8
|
* 查询告警列表,包含主资源和子组件告警
|
@@ -104,7 +104,7 @@ export default {
|
|
104
104
|
* @param {Array} groups
|
105
105
|
* @returns
|
106
106
|
*/
|
107
|
-
getTopoDataByResource: function getTopoDataByResource(id, resources, groups
|
107
|
+
getTopoDataByResource: function getTopoDataByResource(id, resources, groups) {
|
108
108
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
109
109
|
var data, obj;
|
110
110
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
@@ -123,7 +123,7 @@ export default {
|
|
123
123
|
obj = prepareGroupParams(data);
|
124
124
|
_context.next = 5;
|
125
125
|
return request.post(API_ROOT + "/structure/byCondition/" + id, _extends({}, obj, {
|
126
|
-
exportLinkIdList:
|
126
|
+
exportLinkIdList: []
|
127
127
|
}));
|
128
128
|
|
129
129
|
case 5:
|
@@ -7,7 +7,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
7
|
/**
|
8
8
|
* 图标管理 Model
|
9
9
|
*/
|
10
|
-
import rlog from '@riil-frontend/component-topology-utils
|
10
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
11
11
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
12
12
|
import { iconFactory } from '@riil-frontend/component-topology-graph';
|
13
13
|
import { getCustomIconHtId, getCustomIconIdFromHtId, getEditorIcons, transformCustomIcon2HtIcon, transformCustomIcons2HtIcons } from "../../common/icons/icon";
|
@@ -6,7 +6,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
* 动态设置链路样式 Model
|
7
7
|
*/
|
8
8
|
// import _ from 'lodash';
|
9
|
-
import rlog from '@riil-frontend/component-topology-utils
|
9
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
10
10
|
export default function (topo) {
|
11
11
|
return {
|
12
12
|
// 定义 model 的初始 state
|
@@ -5,7 +5,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
/**
|
6
6
|
* 拓扑图 Model
|
7
7
|
*/
|
8
|
-
import rlog from '@riil-frontend/component-topology-utils
|
8
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
9
9
|
export default {
|
10
10
|
// 定义 model 的初始 state
|
11
11
|
state: {
|
@@ -5,7 +5,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
/**
|
6
6
|
* 拓扑图 基本信息-概览
|
7
7
|
*/
|
8
|
-
import rlog from '@riil-frontend/component-topology-utils
|
8
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
9
9
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
10
10
|
export default {
|
11
11
|
// 定义 model 的初始 state
|
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import topoServer from '@riil-frontend/component-topology-common/es/services/topo';
|
5
|
-
import rlog from '@riil-frontend/component-topology-utils
|
5
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
6
6
|
export default function (engine) {
|
7
7
|
return {
|
8
8
|
state: {
|
@@ -35,7 +35,6 @@ var initialState = {
|
|
35
35
|
"static": []
|
36
36
|
},
|
37
37
|
groups: [],
|
38
|
-
exportLinkIdList: [],
|
39
38
|
// config: {
|
40
39
|
// view: null,
|
41
40
|
// groups: [],
|
@@ -243,18 +242,17 @@ export default function (topoApp) {
|
|
243
242
|
var _this2 = this;
|
244
243
|
|
245
244
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
246
|
-
var editState, resources, _editState$groups, groups,
|
245
|
+
var editState, resources, _editState$groups, groups, query, data;
|
247
246
|
|
248
247
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
249
248
|
while (1) switch (_context2.prev = _context2.next) {
|
250
249
|
case 0:
|
251
250
|
editState = rootState.topoConfig;
|
252
|
-
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups
|
251
|
+
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups;
|
253
252
|
query = {
|
254
253
|
id: rootState.topoMod.topoId,
|
255
254
|
resources: resources,
|
256
|
-
groups: groups
|
257
|
-
ipNodes: ipNodes
|
255
|
+
groups: groups
|
258
256
|
};
|
259
257
|
_context2.next = 5;
|
260
258
|
return _this2.getTopoByConditions(query);
|
@@ -303,13 +301,13 @@ export default function (topoApp) {
|
|
303
301
|
var _this4 = this;
|
304
302
|
|
305
303
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
306
|
-
var topoId, resources, groups,
|
304
|
+
var topoId, resources, groups, viewConditions, groupInfo, data, _yield$Promise$all, dataWithLinkDetail, _combTopoData, topoData, resAndMetrics, topoDataTrans;
|
307
305
|
|
308
306
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
309
307
|
while (1) switch (_context4.prev = _context4.next) {
|
310
308
|
case 0:
|
311
309
|
rlog.debug("getTopoByConditions--------", params);
|
312
|
-
topoId = params.id, resources = params.resources, groups = params.groups
|
310
|
+
topoId = params.id, resources = params.resources, groups = params.groups;
|
313
311
|
viewConditions = resToConditions(resources);
|
314
312
|
groupInfo = isAvailableArray(groups) && groups.map(function (group) {
|
315
313
|
return _extends({}, group, {
|
@@ -319,7 +317,7 @@ export default function (topoApp) {
|
|
319
317
|
});
|
320
318
|
rlog.debug("getTopoByConditions--------", viewConditions, groupInfo);
|
321
319
|
_context4.next = 7;
|
322
|
-
return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo
|
320
|
+
return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo);
|
323
321
|
|
324
322
|
case 7:
|
325
323
|
data = _context4.sent;
|
@@ -458,8 +456,7 @@ export default function (topoApp) {
|
|
458
456
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
459
457
|
while (1) switch (_context8.prev = _context8.next) {
|
460
458
|
case 0:
|
461
|
-
ids = data.ids, ip = data.ip;
|
462
|
-
|
459
|
+
ids = data.ids, ip = data.ip;
|
463
460
|
_context8.next = 3;
|
464
461
|
return networkLinkServer.queryLinksByIp(ids, ip);
|
465
462
|
|
@@ -5,7 +5,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
/**
|
6
6
|
* 拓扑图 Model
|
7
7
|
*/
|
8
|
-
import rlog from '@riil-frontend/component-topology-utils
|
8
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
9
9
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
10
10
|
export default {
|
11
11
|
// 定义 model 的初始 state
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import moment from 'moment';
|
5
5
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import { combTopoData, getCiTypes, parseTopoData } from "../../../utils/topoData";
|
8
8
|
import { loopTreeByKey } from "../../../utils/tree";
|
9
9
|
import topoPermissonUtil from "../../../utils/topoPermissionUtil";
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
/**
|
4
4
|
* 资源web控制台url配置 Model
|
5
5
|
*/
|
6
|
-
import rlog from '@riil-frontend/component-topology-utils
|
6
|
+
import { rlog } from '@riil-frontend/component-topology-utils';
|
7
7
|
import topoService from '@riil-frontend/component-topology-common/es/services/topo';
|
8
8
|
export default {
|
9
9
|
// 定义 model 的初始 state
|
@@ -36,7 +36,8 @@ export var updateEdgeExpanded = function updateEdgeExpanded(topo) {
|
|
36
36
|
htTopo.expandAllEdgeGroups();
|
37
37
|
showLinkByConfig({
|
38
38
|
topo: topo,
|
39
|
-
showType:
|
39
|
+
showType: expandAllEdges,
|
40
|
+
isEditMode: isEditMode
|
40
41
|
});
|
41
42
|
rlog.debug("updateEdgeExpanded 展开-isEditMode", isEditMode);
|
42
43
|
}
|
@@ -13,6 +13,13 @@ export function formatMetric(val, metricModel) {
|
|
13
13
|
}
|
14
14
|
|
15
15
|
if (metricModel) {
|
16
|
+
var _result$value;
|
17
|
+
|
18
|
+
// 分级字典特殊处理
|
19
|
+
if (metricModel.dict && !DictCache.getDictObject()[metricModel.code]) {
|
20
|
+
val = metricModel.dict[val];
|
21
|
+
}
|
22
|
+
|
16
23
|
var result = metricValueFormat({
|
17
24
|
value: val,
|
18
25
|
dataType: metricModel.dataType,
|
@@ -21,7 +28,7 @@ export function formatMetric(val, metricModel) {
|
|
21
28
|
unit: metricModel.unit,
|
22
29
|
code: metricModel.code
|
23
30
|
});
|
24
|
-
return result.value + " " + (result.value === '-' ? '' : result.unit);
|
31
|
+
return ((_result$value = result.value) !== null && _result$value !== void 0 ? _result$value : '') + " " + (result.value === '-' ? '' : result.unit);
|
25
32
|
} else {
|
26
33
|
return "" + val;
|
27
34
|
}
|
@@ -46,6 +46,7 @@ export default function ResourceDetail(props) {
|
|
46
46
|
|
47
47
|
if (tabBodys.length === 1) {
|
48
48
|
return /*#__PURE__*/React.createElement(ResourceOverview, _extends({}, props, activeData, {
|
49
|
+
resourceDetailProps: viewerProps === null || viewerProps === void 0 ? void 0 : viewerProps.resourceDetailProps,
|
49
50
|
userId: userId,
|
50
51
|
style: {
|
51
52
|
overflowY: 'auto',
|