@riil-frontend/component-topology 9.0.0-a.22 → 9.0.0-a.24
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/index.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +1 -1
- package/es/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +2 -3
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +1 -2
- package/es/core/hooks/useResourceConfig.js +2 -1
- package/es/core/hooks/useTopoEdit.js +36 -64
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +16 -9
- package/es/core/models/utils/linkUtils.js +35 -28
- package/es/core/store/models/topoConfig.js +10 -9
- package/es/networkTopo/getTopoData.js +2 -1
- package/es/networkTopo/services/topo/basic.js +8 -17
- package/es/networkTopo/utils/exitLinkUtil.js +84 -66
- package/es/utils/ResourceConfigUtil.js +5 -4
- package/es/utils/htElementDataUtil.js +1 -7
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +2 -3
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +1 -2
- package/lib/core/hooks/useResourceConfig.js +2 -1
- package/lib/core/hooks/useTopoEdit.js +36 -64
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +16 -9
- package/lib/core/models/utils/linkUtils.js +33 -26
- package/lib/core/store/models/topoConfig.js +13 -8
- package/lib/networkTopo/getTopoData.js +2 -1
- package/lib/networkTopo/services/topo/basic.js +8 -19
- package/lib/networkTopo/utils/exitLinkUtil.js +84 -66
- package/lib/utils/ResourceConfigUtil.js +4 -4
- package/lib/utils/htElementDataUtil.js +0 -10
- package/package.json +2 -2
@@ -15,7 +15,7 @@ export function getTextStyle(element) {
|
|
15
15
|
color: parseColor(element.s('group.title.color')),
|
16
16
|
underline: underline
|
17
17
|
}, fontStyleUtil.toMap(element.s('group.title.font')), {
|
18
|
-
fontSize: font.fontSize ||
|
18
|
+
fontSize: font.fontSize || 24,
|
19
19
|
fontFamily: font.fontFamily || '微软雅黑'
|
20
20
|
}, parseBackground(element.s('group.title.background')));
|
21
21
|
}
|
@@ -38,7 +38,7 @@ export default function BindIpInput(props) {
|
|
38
38
|
if (errors) {
|
39
39
|
console.error("saveIp-error", errors, vals);
|
40
40
|
} else {
|
41
|
-
console.log("saveIp", txtValue);
|
41
|
+
// console.log("saveIp", txtValue);
|
42
42
|
setError("");
|
43
43
|
onChange(txtValue);
|
44
44
|
topoEditApi.relateNodeIp(txtValue, nodeElement);
|
@@ -65,8 +65,7 @@ export default function BindIpInput(props) {
|
|
65
65
|
return callback();
|
66
66
|
}
|
67
67
|
|
68
|
-
var isUnique = isUniqueIp(dm, value, nodeElement);
|
69
|
-
console.log("checkIp", isUnique);
|
68
|
+
var isUnique = isUniqueIp(dm, value, nodeElement); // console.log("checkIp", isUnique);
|
70
69
|
|
71
70
|
if (!isUnique) {
|
72
71
|
return callback("ip不能重复");
|
@@ -49,8 +49,7 @@ export default function Data(props) {
|
|
49
49
|
values: parseValues(values),
|
50
50
|
onChange: function onChange(name, value) {
|
51
51
|
field.validate(function (errors, vals) {
|
52
|
-
if (errors) {
|
53
|
-
console.error("field-Data", errors, vals);
|
52
|
+
if (errors) {// console.error("field-Data", errors, vals);
|
54
53
|
} else {
|
55
54
|
var newValues = field.getValues();
|
56
55
|
|
@@ -45,7 +45,8 @@ export default function (props) {
|
|
45
45
|
resources: config.resources,
|
46
46
|
groups: config.groups,
|
47
47
|
exportLinkIdList: config.exportLinkIdList,
|
48
|
-
relateTopoIdList: config.relateTopoIdList
|
48
|
+
relateTopoIdList: config.relateTopoIdList //linkIps: config.linkIps,
|
49
|
+
|
49
50
|
};
|
50
51
|
};
|
51
52
|
|
@@ -974,9 +974,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
974
974
|
|
975
975
|
function _relateNodeIp() {
|
976
976
|
_relateNodeIp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(txtValue, nodeElement) {
|
977
|
-
var
|
978
|
-
|
979
|
-
var dm, htTopo, elements, configObj, _yield$editDispatcher5, elementDatas, isUnique, ids, ip, re, config, linksData, createElementsData;
|
977
|
+
var dm, htTopo, elementNodes, isUnique, ids, ip, configObj, configData, _elements, newLinkElements, createElementsData;
|
980
978
|
|
981
979
|
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
982
980
|
while (1) {
|
@@ -986,28 +984,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
986
984
|
// 根据配置查询拓扑数据
|
987
985
|
dm = topo.getDataModel();
|
988
986
|
htTopo = topo.getHtTopo();
|
989
|
-
|
990
|
-
|
991
|
-
configObj = topo.resourceConfig.getConfig();
|
992
|
-
console.log("configObj", configObj);
|
993
|
-
configObj.linkIps = [].concat((_configObj$linkIps = configObj.linkIps) !== null && _configObj$linkIps !== void 0 ? _configObj$linkIps : [], [txtValue]);
|
994
|
-
console.log("configObj---over", configObj);
|
995
|
-
_context16.next = 9;
|
996
|
-
return resourceConfig.updateConfig(configObj);
|
997
|
-
|
998
|
-
case 9:
|
999
|
-
_context16.next = 11;
|
1000
|
-
return editDispatchers.fetchDataByConfig();
|
1001
|
-
|
1002
|
-
case 11:
|
1003
|
-
_yield$editDispatcher5 = _context16.sent;
|
1004
|
-
elementDatas = _yield$editDispatcher5.elementDatas;
|
1005
|
-
console.log("bindIPtoNode", txtValue, nodeElement, elements);
|
1006
|
-
console.log("elementDatas", elementDatas); // 执行唯一性验证
|
987
|
+
elementNodes = getNodes(dm); // 执行唯一性验证
|
1007
988
|
|
1008
989
|
isUnique = isUniqueIp(dm, txtValue, nodeElement);
|
1009
990
|
ids = [];
|
1010
|
-
|
991
|
+
elementNodes.map(function (element) {
|
1011
992
|
if (element.getTag()) {
|
1012
993
|
ids.push(element.getTag());
|
1013
994
|
}
|
@@ -1016,6 +997,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1016
997
|
id: "ip:" + txtValue,
|
1017
998
|
name: txtValue,
|
1018
999
|
customName: null,
|
1000
|
+
bindType: "ip",
|
1019
1001
|
// 'groupId': null,
|
1020
1002
|
// 'groupTag': null,
|
1021
1003
|
ipAddress: txtValue,
|
@@ -1027,54 +1009,44 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1027
1009
|
}; // 获取关联链路
|
1028
1010
|
|
1029
1011
|
if (!isUnique) {
|
1030
|
-
_context16.next =
|
1012
|
+
_context16.next = 23;
|
1031
1013
|
break;
|
1032
1014
|
}
|
1033
1015
|
|
1016
|
+
deleteExLink(nodeElement);
|
1034
1017
|
nodeElement.a(ip);
|
1035
|
-
nodeElement.setName(txtValue);
|
1036
|
-
|
1037
|
-
|
1038
|
-
nodeElement.setTag("ip:" + txtValue);
|
1039
|
-
_context16.next = 25;
|
1040
|
-
return editDispatchers.queryAllLinkByIp({
|
1041
|
-
ids: ids,
|
1042
|
-
ip: txtValue
|
1043
|
-
});
|
1018
|
+
nodeElement.setName(txtValue);
|
1019
|
+
nodeElement.setTag("ip:" + txtValue); // 获取配置
|
1044
1020
|
|
1045
|
-
|
1046
|
-
|
1047
|
-
console.log("
|
1048
|
-
config = resourceConfig.getConfig();
|
1049
|
-
console.log("resourceConfig.getConfig", config);
|
1050
|
-
|
1051
|
-
if (re && re.length > 0) {
|
1052
|
-
linksData = [];
|
1053
|
-
re.map(function (link) {
|
1054
|
-
var sourceId = link.attributes["network_link.source_device_id"];
|
1055
|
-
var source = dm.getDataByTag(sourceId);
|
1056
|
-
var target = nodeElement; // console.log("source, nodeElement, link", source, target, link);
|
1057
|
-
|
1058
|
-
if (source && target) {
|
1059
|
-
var linkData = mergeExportLinkData({
|
1060
|
-
source: source,
|
1061
|
-
target: target,
|
1062
|
-
link: link
|
1063
|
-
});
|
1064
|
-
console.log("linkData", linkData);
|
1065
|
-
linksData.push(linkData); // htTopo.createEdge(source, target, link);
|
1066
|
-
}
|
1067
|
-
});
|
1068
|
-
createElementsData = {
|
1069
|
-
groups: [],
|
1070
|
-
nodes: [],
|
1071
|
-
links: [].concat(linksData),
|
1072
|
-
linkGroups: []
|
1073
|
-
};
|
1074
|
-
htTopo.createElements(createElementsData); // htTopo.addElements({ lines: [...re] });
|
1075
|
-
}
|
1021
|
+
configObj = topo.resourceConfig.getConfig(); // console.log("configObj", configObj);
|
1022
|
+
// configObj.linkIps = [...(configObj.linkIps ?? []), txtValue];
|
1023
|
+
// console.log("configObj---over", configObj);
|
1076
1024
|
|
1077
|
-
|
1025
|
+
_context16.next = 15;
|
1026
|
+
return resourceConfig.updateConfig(configObj);
|
1027
|
+
|
1028
|
+
case 15:
|
1029
|
+
_context16.next = 17;
|
1030
|
+
return editDispatchers.fetchDataByConfig();
|
1031
|
+
|
1032
|
+
case 17:
|
1033
|
+
configData = _context16.sent;
|
1034
|
+
_elements = configData.elements;
|
1035
|
+
newLinkElements = findUNExistedLinkElements(_elements);
|
1036
|
+
createElementsData = {
|
1037
|
+
groups: [],
|
1038
|
+
nodes: [],
|
1039
|
+
links: newLinkElements.filter(function (item) {
|
1040
|
+
return item.type === "link";
|
1041
|
+
}),
|
1042
|
+
linkGroups: newLinkElements.filter(function (item) {
|
1043
|
+
return item.type === "linkGroup";
|
1044
|
+
})
|
1045
|
+
};
|
1046
|
+
console.log("createElementsData", createElementsData);
|
1047
|
+
htTopo.createElements(createElementsData);
|
1048
|
+
|
1049
|
+
case 23:
|
1078
1050
|
case "end":
|
1079
1051
|
return _context16.stop();
|
1080
1052
|
}
|
@@ -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 "9.0.0-a.
|
27
|
+
var version = typeof "9.0.0-a.24" === 'string' ? "9.0.0-a.24" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
@@ -11,8 +11,8 @@ export function getLayoutId(layout) {
|
|
11
11
|
|
12
12
|
if (typeof layout === "string") {
|
13
13
|
return {
|
14
|
-
v:
|
15
|
-
h:
|
14
|
+
v: "towardeast",
|
15
|
+
h: "towardsouth"
|
16
16
|
}[layout] || layout;
|
17
17
|
}
|
18
18
|
|
@@ -41,7 +41,7 @@ export function saveTopo(_x) {
|
|
41
41
|
|
42
42
|
function _saveTopo() {
|
43
43
|
_saveTopo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
44
|
-
var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources;
|
44
|
+
var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources, linkIps;
|
45
45
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
46
46
|
while (1) {
|
47
47
|
switch (_context.prev = _context.next) {
|
@@ -73,7 +73,7 @@ function _saveTopo() {
|
|
73
73
|
|
74
74
|
case 8:
|
75
75
|
if (!(resources || groups)) {
|
76
|
-
_context.next =
|
76
|
+
_context.next = 16;
|
77
77
|
break;
|
78
78
|
}
|
79
79
|
|
@@ -95,24 +95,31 @@ function _saveTopo() {
|
|
95
95
|
});
|
96
96
|
}
|
97
97
|
|
98
|
+
linkIps = []; // resources?.static.map((nodeId) => {
|
99
|
+
// if (nodeId.startsWith("ip_")) {
|
100
|
+
// linkIps.push(nodeId.replace("ip_", ""));
|
101
|
+
// }
|
102
|
+
// });
|
103
|
+
|
98
104
|
rlog.debug("saveTopo-groupInfo", groupInfo);
|
99
|
-
_context.next =
|
105
|
+
_context.next = 16;
|
100
106
|
return topoService.bindResourceToTopo(topoId, {
|
101
107
|
groups: groupInfo,
|
108
|
+
linkIps: linkIps,
|
102
109
|
exportLinkIdList: exportLinkIdList,
|
103
110
|
relateTopoIdList: relateTopoIdList
|
104
111
|
});
|
105
112
|
|
106
|
-
case
|
113
|
+
case 16:
|
107
114
|
if (!serialize) {
|
108
|
-
_context.next =
|
115
|
+
_context.next = 19;
|
109
116
|
break;
|
110
117
|
}
|
111
118
|
|
112
|
-
_context.next =
|
119
|
+
_context.next = 19;
|
113
120
|
return topoService.saveSerializeData(topoId, serialize);
|
114
121
|
|
115
|
-
case
|
122
|
+
case 19:
|
116
123
|
case "end":
|
117
124
|
return _context.stop();
|
118
125
|
}
|
@@ -1,8 +1,8 @@
|
|
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 keyBy from
|
5
|
-
import _ from
|
4
|
+
import keyBy from "lodash/keyBy";
|
5
|
+
import _ from "lodash";
|
6
6
|
import { queryCisByIds, queryModelAsset } from "../../services"; // 查询所有连线
|
7
7
|
|
8
8
|
import { getEdges } from "../../../utils/htElementUtils";
|
@@ -18,24 +18,24 @@ import CiCache from "../cache/CiCache"; // const interfaceTypeMap = {
|
|
18
18
|
|
19
19
|
/**
|
20
20
|
* 是否关键链路
|
21
|
-
* @param {*} link
|
22
|
-
* @returns
|
21
|
+
* @param {*} link
|
22
|
+
* @returns
|
23
23
|
*/
|
24
24
|
|
25
25
|
export function isCrucialLink(link) {
|
26
|
-
return !!link.attributes[
|
26
|
+
return !!link.attributes["network_link.is_crucial"];
|
27
27
|
}
|
28
28
|
/**
|
29
29
|
* 是否出口链路
|
30
|
-
* @param {*} link
|
31
|
-
* @returns
|
30
|
+
* @param {*} link
|
31
|
+
* @returns
|
32
32
|
*/
|
33
33
|
|
34
34
|
export function isExitLink(link) {
|
35
|
-
return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes[
|
35
|
+
return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes["destination_id"]);
|
36
36
|
}
|
37
37
|
export function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
|
38
|
-
var linkCiMap = keyBy(links,
|
38
|
+
var linkCiMap = keyBy(links, "id");
|
39
39
|
return links.map(function (link) {
|
40
40
|
var _interfaceCiMap$attri, _interfaceCiMap$attri2;
|
41
41
|
|
@@ -44,19 +44,26 @@ export function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceD
|
|
44
44
|
var attributes = _extends({}, linkCi === null || linkCi === void 0 ? void 0 : linkCi.attributes);
|
45
45
|
|
46
46
|
var sourceNode = nodes.find(function (node) {
|
47
|
-
return node.id === attributes[
|
47
|
+
return node.id === attributes["network_link.source_device_id"];
|
48
48
|
});
|
49
49
|
var targetNode = nodes.find(function (node) {
|
50
|
-
return node.id === attributes[
|
51
|
-
});
|
50
|
+
return node.id === attributes["network_link.destination_device_id"];
|
51
|
+
});
|
52
|
+
var target = link.target; // 目的端为ip节点
|
53
|
+
|
54
|
+
if (attributes["destination_type"] === "ip") {
|
55
|
+
target = "ip:" + attributes["network_link.destination_ipv4"];
|
56
|
+
} // 翻译
|
57
|
+
|
52
58
|
|
53
59
|
return _extends({}, link, {
|
60
|
+
target: target,
|
54
61
|
attributes: _extends({}, attributes, {
|
55
62
|
// 源/目的设备
|
56
|
-
|
63
|
+
"network_link.source_device_id_object": {
|
57
64
|
displayName: sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.name
|
58
65
|
},
|
59
|
-
|
66
|
+
"network_link.destination_device_id_object": {
|
60
67
|
displayName: targetNode === null || targetNode === void 0 ? void 0 : targetNode.name
|
61
68
|
},
|
62
69
|
// 源/目的接口类型
|
@@ -64,10 +71,10 @@ export function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceD
|
|
64
71
|
destination_type_object: interfaceDoc[attributes.destination_type],
|
65
72
|
// 源/目的接口
|
66
73
|
source_id_object: {
|
67
|
-
displayName: (_interfaceCiMap$attri = interfaceCiMap[attributes.source_id]) === null || _interfaceCiMap$attri === void 0 ? void 0 : _interfaceCiMap$attri.attributes[
|
74
|
+
displayName: (_interfaceCiMap$attri = interfaceCiMap[attributes.source_id]) === null || _interfaceCiMap$attri === void 0 ? void 0 : _interfaceCiMap$attri.attributes["display_name"]
|
68
75
|
},
|
69
76
|
destination_id_object: {
|
70
|
-
displayName: (_interfaceCiMap$attri2 = interfaceCiMap[attributes.destination_id]) === null || _interfaceCiMap$attri2 === void 0 ? void 0 : _interfaceCiMap$attri2.attributes[
|
77
|
+
displayName: (_interfaceCiMap$attri2 = interfaceCiMap[attributes.destination_id]) === null || _interfaceCiMap$attri2 === void 0 ? void 0 : _interfaceCiMap$attri2.attributes["display_name"]
|
71
78
|
}
|
72
79
|
})
|
73
80
|
});
|
@@ -106,7 +113,7 @@ function _getLinksDetail() {
|
|
106
113
|
}), linkCis.map(function (item) {
|
107
114
|
return item.attributes.destination_type;
|
108
115
|
})))).filter(function (item) {
|
109
|
-
return item !==
|
116
|
+
return item !== "ip";
|
110
117
|
});
|
111
118
|
_context.next = 7;
|
112
119
|
return CiCache.load(interfaceIds);
|
@@ -147,10 +154,10 @@ export var compatibleWith = function compatibleWith(value) {
|
|
147
154
|
|
148
155
|
export var plurals = {
|
149
156
|
0: [],
|
150
|
-
1: [
|
151
|
-
2: [
|
152
|
-
3: [
|
153
|
-
4: [
|
157
|
+
1: ["phy"],
|
158
|
+
2: ["phy"],
|
159
|
+
3: ["agg"],
|
160
|
+
4: ["phy", "agg"]
|
154
161
|
};
|
155
162
|
export var showLinkByConfig = function showLinkByConfig(props) {
|
156
163
|
var _plurals$compatibleWi;
|
@@ -165,25 +172,25 @@ export var showLinkByConfig = function showLinkByConfig(props) {
|
|
165
172
|
var dm = gv.getDataModel();
|
166
173
|
var edges = getEdges(dm); // console.log("edges", edges);
|
167
174
|
|
168
|
-
var showPhy = types.indexOf(
|
169
|
-
var showAgg = types.indexOf(
|
175
|
+
var showPhy = types.indexOf("phy") >= 0;
|
176
|
+
var showAgg = types.indexOf("agg") >= 0; // console.log("edges----types",showType, types,showPhy, showAgg);
|
170
177
|
|
171
178
|
if (Array.isArray(edges) && edges.length > 0) {
|
172
179
|
edges.map(function (edge) {
|
173
180
|
if (showType === 1 || showType === true) {
|
174
181
|
// 单链路全部显示
|
175
182
|
// console.log("单链路全部显示", edge);
|
176
|
-
edge.s(
|
183
|
+
edge.s("2d.visible", true);
|
177
184
|
} else {
|
178
185
|
var _d$attributes, _d$attributes2;
|
179
186
|
|
180
187
|
var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
|
181
188
|
|
182
|
-
if ((d === null || d === void 0 ? void 0 : (_d$attributes = d.attributes) === null || _d$attributes === void 0 ? void 0 : _d$attributes.destination_type) ===
|
183
|
-
edge.s(
|
189
|
+
if ((d === null || d === void 0 ? void 0 : (_d$attributes = d.attributes) === null || _d$attributes === void 0 ? void 0 : _d$attributes.destination_type) === "network.agg_interface" && (d === null || d === void 0 ? void 0 : (_d$attributes2 = d.attributes) === null || _d$attributes2 === void 0 ? void 0 : _d$attributes2.source_type) === "network.agg_interface") {
|
190
|
+
edge.s("2d.visible", showAgg);
|
184
191
|
} else {
|
185
192
|
// console.log("edge", edge, d, showAgg);
|
186
|
-
edge.s(
|
193
|
+
edge.s("2d.visible", showPhy);
|
187
194
|
}
|
188
195
|
}
|
189
196
|
});
|
@@ -198,7 +205,7 @@ export var mergeExportLinkData = function mergeExportLinkData(props) {
|
|
198
205
|
var linkData = _extends({}, link, {
|
199
206
|
name: attrObj.name,
|
200
207
|
source: attrObj["network_link.source_device_id"],
|
201
|
-
target: attrObj.destination_type ===
|
208
|
+
target: attrObj.destination_type === "ip" ? target.getTag() : attrObj["network_link.destination_device_id"],
|
202
209
|
operation: attrObj.operation,
|
203
210
|
interfaceSource: attrObj["source_id"],
|
204
211
|
interfaceTarget: attrObj["destination_id"],
|
@@ -324,22 +324,23 @@ export default function (topoApp) {
|
|
324
324
|
layout: getLayoutId(group.layout),
|
325
325
|
resources: resToConditions(group.resources)
|
326
326
|
});
|
327
|
-
});
|
328
|
-
|
329
|
-
_context4.next =
|
327
|
+
});
|
328
|
+
rlog.debug("getTopoByConditions--------", viewConditions, groupInfo);
|
329
|
+
_context4.next = 6;
|
330
330
|
return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo, exportLinkIdList, ipNodes);
|
331
331
|
|
332
|
-
case
|
332
|
+
case 6:
|
333
333
|
data = _context4.sent;
|
334
|
-
|
334
|
+
rlog.debug("getTopoByConditions--------data", data);
|
335
|
+
_context4.next = 10;
|
335
336
|
return buildTopoData(data);
|
336
337
|
|
337
|
-
case
|
338
|
+
case 10:
|
338
339
|
data = _context4.sent;
|
339
|
-
_context4.next =
|
340
|
+
_context4.next = 13;
|
340
341
|
return Promise.all([addLinkData(data), topoApp.ciTyeCache.getCiTypeMap(getCiTypes(data)), dispatch.customIcon.loadCustomIcons()]);
|
341
342
|
|
342
|
-
case
|
343
|
+
case 13:
|
343
344
|
_yield$Promise$all = _context4.sent;
|
344
345
|
dataWithLinkDetail = _yield$Promise$all[0];
|
345
346
|
_combTopoData = combTopoData({
|
@@ -366,7 +367,7 @@ export default function (topoApp) {
|
|
366
367
|
topoDataTrans: topoDataTrans
|
367
368
|
});
|
368
369
|
|
369
|
-
case
|
370
|
+
case 21:
|
370
371
|
case "end":
|
371
372
|
return _context4.stop();
|
372
373
|
}
|
@@ -77,6 +77,7 @@ function _addLinkData() {
|
|
77
77
|
|
78
78
|
case 4:
|
79
79
|
networkLinks = _context.sent;
|
80
|
+
console.log("如果是网络链路,补充详情信息", networkLinks);
|
80
81
|
otherLinks = links.filter(function (link) {
|
81
82
|
return link.ciType !== 'network_link';
|
82
83
|
});
|
@@ -85,7 +86,7 @@ function _addLinkData() {
|
|
85
86
|
linkGroups: []
|
86
87
|
}));
|
87
88
|
|
88
|
-
case
|
89
|
+
case 8:
|
89
90
|
case "end":
|
90
91
|
return _context.stop();
|
91
92
|
}
|
@@ -408,17 +408,17 @@ export default _extends({
|
|
408
408
|
*/
|
409
409
|
getTopoData: function getTopoData(id) {
|
410
410
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
411
|
-
var _result$nodes, _result$links
|
411
|
+
var _result$nodes, _result$links;
|
412
412
|
|
413
|
+
var result;
|
413
414
|
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
414
415
|
while (1) {
|
415
416
|
switch (_context12.prev = _context12.next) {
|
416
417
|
case 0:
|
417
|
-
_context12.
|
418
|
-
_context12.next = 3;
|
418
|
+
_context12.next = 2;
|
419
419
|
return request.get(API_ROOT + "/structure/both/" + id);
|
420
420
|
|
421
|
-
case
|
421
|
+
case 2:
|
422
422
|
result = _context12.sent;
|
423
423
|
return _context12.abrupt("return", processExitLink(_extends({}, result, {
|
424
424
|
nodes: (_result$nodes = result.nodes) !== null && _result$nodes !== void 0 ? _result$nodes : [],
|
@@ -429,18 +429,12 @@ export default _extends({
|
|
429
429
|
})
|
430
430
|
})));
|
431
431
|
|
432
|
-
case
|
433
|
-
_context12.prev = 7;
|
434
|
-
_context12.t0 = _context12["catch"](0);
|
435
|
-
rlog.debug('getTopoData-error', _context12.t0);
|
436
|
-
return _context12.abrupt("return", null);
|
437
|
-
|
438
|
-
case 11:
|
432
|
+
case 4:
|
439
433
|
case "end":
|
440
434
|
return _context12.stop();
|
441
435
|
}
|
442
436
|
}
|
443
|
-
}, _callee12
|
437
|
+
}, _callee12);
|
444
438
|
}))();
|
445
439
|
},
|
446
440
|
|
@@ -483,7 +477,7 @@ export default _extends({
|
|
483
477
|
ciType: 'network_link'
|
484
478
|
});
|
485
479
|
})
|
486
|
-
})));
|
480
|
+
}), obj.groups));
|
487
481
|
|
488
482
|
case 7:
|
489
483
|
case "end":
|
@@ -522,10 +516,7 @@ export default _extends({
|
|
522
516
|
|
523
517
|
obj = prepareGroupParams(newGroups);
|
524
518
|
_context14.next = 6;
|
525
|
-
return request.post(API_ROOT + "/resource/" + id, _extends({}, otherConfig, obj
|
526
|
-
exportLinkIdList: [] // 传空数组清空
|
527
|
-
|
528
|
-
}));
|
519
|
+
return request.post(API_ROOT + "/resource/" + id, _extends({}, otherConfig, obj));
|
529
520
|
|
530
521
|
case 6:
|
531
522
|
return _context14.abrupt("return", _context14.sent);
|