@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
@@ -64,58 +64,72 @@ export function isUniqueIp(dataModel, ip, nodeElement) {
|
|
64
64
|
|
65
65
|
export function processExitLink(topoData) {
|
66
66
|
var nodes = topoData.nodes,
|
67
|
-
links = topoData.links;
|
67
|
+
links = topoData.links; // 出口链路目的端设置为IP节点或者ping资源节点id
|
68
68
|
|
69
|
-
var
|
69
|
+
var newLinks = updateLinkTarget(links, nodes);
|
70
70
|
|
71
|
-
if (!serialize) {
|
72
|
-
return topoData
|
73
|
-
|
71
|
+
if (!topoData.serialize) {
|
72
|
+
return _extends({}, topoData, {
|
73
|
+
links: newLinks
|
74
|
+
});
|
75
|
+
}
|
76
|
+
|
77
|
+
var serialize = _extends({}, getHtSerialize(topoData.serialize)); // 历史数据升级
|
74
78
|
|
75
79
|
|
76
80
|
links.filter(isExitLink) // 升级V1.4前配置的出口链路目的端节点为IP节点
|
77
81
|
.forEach(function (link) {
|
78
|
-
return upgradeExitLinkTarget(link);
|
79
|
-
}); //
|
82
|
+
return upgradeExitLinkTarget(link, serialize);
|
83
|
+
}); // 历史数据适配:同IP节点关联多个不同IP的链路、分级拓扑。target匹配不到元素时,根据序列化匹配
|
80
84
|
|
81
|
-
|
82
|
-
if (!isExitLink(link) || link.target && nodes.find(function (node) {
|
83
|
-
return node.id === link.target;
|
84
|
-
})) {
|
85
|
-
return link;
|
86
|
-
}
|
85
|
+
newLinks = upgradeLinkTargetNotExisted(links); // IP节点构造为node。如果有相同ip的ping资源和图片节点,图片节点消失(不构造)
|
87
86
|
|
88
|
-
|
89
|
-
|
87
|
+
var ipNodes = getIpNodes(serialize, nodes);
|
88
|
+
return _extends({}, topoData, {
|
89
|
+
nodes: [].concat(nodes, ipNodes),
|
90
|
+
links: newLinks,
|
91
|
+
serialize: serialize
|
92
|
+
}); // 历史数据适配:同IP节点关联多个不同IP的链路、分级拓扑。target匹配不到元素时,根据序列化匹配
|
93
|
+
|
94
|
+
function upgradeLinkTargetNotExisted(links) {
|
95
|
+
newLinks = links.map(function (link) {
|
96
|
+
if (!isExitLink(link) || link.target && nodes.find(function (node) {
|
97
|
+
return node.id === link.target;
|
98
|
+
})) {
|
99
|
+
return link;
|
100
|
+
}
|
90
101
|
|
91
|
-
|
102
|
+
var destinationIp = link.attributes['network_link.destination_ipv4'];
|
103
|
+
var pingNode = findPingNode(nodes, destinationIp); // 出口链路目的端设置为IP节点或者ping资源节点id
|
92
104
|
|
93
|
-
|
105
|
+
var target = link.target; // 历史数据适配:同IP节点关联多个不同IP的链路、分级拓扑。target匹配不到元素时,根据序列化匹配
|
94
106
|
|
95
|
-
|
96
|
-
var linkSerialize = findElementSerializeById(serialize, link.id);
|
107
|
+
var targetSerialize = findElementSerializeById(serialize, target);
|
97
108
|
|
98
|
-
if (
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
109
|
+
if (!targetSerialize) {
|
110
|
+
var linkSerialize = findElementSerializeById(serialize, link.id);
|
111
|
+
|
112
|
+
if (linkSerialize) {
|
113
|
+
// 根据链路序列化数据找目的端节点
|
114
|
+
// eslint-disable-next-line no-underscore-dangle
|
115
|
+
var targetNodeSerialize = serialize.d.find(function (item) {
|
116
|
+
return item.i === linkSerialize.p.target.__i;
|
117
|
+
});
|
104
118
|
|
105
|
-
|
106
|
-
|
119
|
+
if (targetNodeSerialize) {
|
120
|
+
target = targetNodeSerialize.p.tag;
|
121
|
+
}
|
107
122
|
}
|
108
123
|
}
|
109
|
-
}
|
110
124
|
|
111
|
-
|
112
|
-
|
125
|
+
return _extends({}, link, {
|
126
|
+
target: target
|
127
|
+
});
|
113
128
|
});
|
114
|
-
|
115
|
-
|
116
|
-
var ipNodes = getIpNodes();
|
129
|
+
return newLinks;
|
130
|
+
}
|
117
131
|
|
118
|
-
function getIpNodes() {
|
132
|
+
function getIpNodes(serialize, nodes) {
|
119
133
|
// 从序列化获取关联的IP
|
120
134
|
var ips = serialize.d.filter(function (item) {
|
121
135
|
return item.a.bindType === 'ip';
|
@@ -123,10 +137,10 @@ export function processExitLink(topoData) {
|
|
123
137
|
return item.a.bindIp;
|
124
138
|
}).filter(function (item) {
|
125
139
|
return !!item;
|
126
|
-
})
|
140
|
+
}) // 过滤ping资源对应的ip
|
141
|
+
.filter(function (ip) {
|
127
142
|
return !findPingNode(nodes, ip);
|
128
|
-
});
|
129
|
-
|
143
|
+
});
|
130
144
|
return ips.map(buildIpNode);
|
131
145
|
}
|
132
146
|
|
@@ -147,7 +161,7 @@ export function processExitLink(topoData) {
|
|
147
161
|
*/
|
148
162
|
|
149
163
|
|
150
|
-
function upgradeExitLinkTarget(link) {
|
164
|
+
function upgradeExitLinkTarget(link, serialize) {
|
151
165
|
var destinationIp = link.attributes['network_link.destination_ipv4'];
|
152
166
|
var linkSerialize = findElementSerializeById(serialize, link.id);
|
153
167
|
|
@@ -166,42 +180,16 @@ export function processExitLink(topoData) {
|
|
166
180
|
}
|
167
181
|
}
|
168
182
|
}
|
169
|
-
|
170
|
-
return _extends({}, topoData, {
|
171
|
-
nodes: [].concat(nodes, ipNodes),
|
172
|
-
links: newLinks,
|
173
|
-
serialize: serialize
|
174
|
-
});
|
175
183
|
} // 从拓扑数据查找
|
176
184
|
|
177
185
|
function findPingNode(nodes, ip) {
|
178
186
|
return nodes.find(function (node) {
|
179
187
|
return node.ciType === "ping" && (node.ipAddress || node.attributes.ipv4_address) === ip;
|
180
188
|
});
|
181
|
-
}
|
182
|
-
/**
|
183
|
-
* 编辑模式按资源查询拓扑数据处理出口链路target
|
184
|
-
* FIXME 移到frontend 网络拓扑编辑
|
185
|
-
* @param {*} topoData
|
186
|
-
* @returns
|
187
|
-
*/
|
188
|
-
|
189
|
-
|
190
|
-
export function processByConditionResult(topoData) {
|
191
|
-
var nodes = topoData.nodes,
|
192
|
-
links = topoData.links;
|
193
|
-
var ipNodes = getIpNodes();
|
194
|
-
|
195
|
-
function getIpNodes() {
|
196
|
-
// 从序列化获取关联的IP
|
197
|
-
var ips = [].filter(function (ip) {
|
198
|
-
return !findPingNode(nodes, ip);
|
199
|
-
}); // TODO 过滤ping资源对应的ip
|
200
|
-
|
201
|
-
return ips.map(buildIpNode);
|
202
|
-
} // 出口链路目的端设置为IP节点或者ping资源节点id
|
189
|
+
} // 出口链路目的端设置为IP节点或者ping资源节点id
|
203
190
|
|
204
191
|
|
192
|
+
function updateLinkTarget(links, nodes) {
|
205
193
|
var newLinks = links.map(function (link) {
|
206
194
|
if (!isExitLink(link) || link.target && nodes.find(function (node) {
|
207
195
|
return node.id === link.target;
|
@@ -217,8 +205,38 @@ export function processByConditionResult(topoData) {
|
|
217
205
|
target: target
|
218
206
|
});
|
219
207
|
});
|
208
|
+
return newLinks;
|
209
|
+
}
|
210
|
+
/**
|
211
|
+
* 编辑模式按资源查询拓扑数据处理出口链路target
|
212
|
+
* 1. 出口链路目的端设置为IP节点或者ping资源节点id
|
213
|
+
* 2. IP构造为node节点
|
214
|
+
* FIXME 移到frontend 网络拓扑编辑
|
215
|
+
* @param {*} topoData
|
216
|
+
* @returns
|
217
|
+
*/
|
218
|
+
|
219
|
+
|
220
|
+
export function processByConditionResult(topoData, groupConfigs) {
|
221
|
+
var nodes = topoData.nodes,
|
222
|
+
links = topoData.links;
|
223
|
+
var ipNodes = getIpNodes(groupConfigs, nodes); // 出口链路目的端设置为IP节点或者ping资源节点id
|
224
|
+
|
225
|
+
var newLinks = updateLinkTarget(links, nodes);
|
220
226
|
return _extends({}, topoData, {
|
221
227
|
nodes: [].concat(nodes, ipNodes),
|
222
228
|
links: newLinks
|
223
229
|
});
|
230
|
+
|
231
|
+
function getIpNodes(groupConfigs, nodes) {
|
232
|
+
var ips = groupConfigs.map(function (g) {
|
233
|
+
return g.condition.linkIps;
|
234
|
+
}).reduce(function (result, groupIps) {
|
235
|
+
return [].concat(result, groupIps);
|
236
|
+
}, []) // 过滤ping资源对应的ip节点
|
237
|
+
.filter(function (ip) {
|
238
|
+
return !findPingNode(nodes, ip);
|
239
|
+
});
|
240
|
+
return ips.map(buildIpNode);
|
241
|
+
}
|
224
242
|
}
|
@@ -2,8 +2,7 @@ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
2
2
|
import sortBy from 'lodash/sortBy';
|
3
3
|
import { isExitLink } from "../core/models/utils/linkUtils";
|
4
4
|
import { isClusterHtElement } from "./clusterUtil";
|
5
|
-
import {
|
6
|
-
import { getEdges, getGroups, getLayers, getNodes } from "./htElementUtils";
|
5
|
+
import { getEdges, getGroupChildren, getGroups, getLayerChildren, getLayers, getNodes } from "./htElementUtils";
|
7
6
|
/**
|
8
7
|
* 从拓扑图解析出拓扑资源配置
|
9
8
|
*
|
@@ -104,7 +103,9 @@ function getLayerDatas(dataModel) {
|
|
104
103
|
name: layerElement.s('label'),
|
105
104
|
order: layerElement.a('order'),
|
106
105
|
resources: {
|
107
|
-
"static":
|
106
|
+
"static": getLayerChildren(layerElement).filter(function (item) {
|
107
|
+
return !!item.getTag();
|
108
|
+
}).map(function (node) {
|
108
109
|
return node.getTag();
|
109
110
|
})
|
110
111
|
}
|
@@ -133,7 +134,7 @@ function getGroupConfigByElement(groupElement) {
|
|
133
134
|
name: groupElement.a('name'),
|
134
135
|
order: groupElement.a('order'),
|
135
136
|
resources: {
|
136
|
-
"static":
|
137
|
+
"static": getGroupChildren(groupElement).filter(function (node) {
|
137
138
|
return !!node.getTag();
|
138
139
|
}).map(function (node) {
|
139
140
|
return node.getTag();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { getEdges
|
1
|
+
import { getEdges } from "./htElementUtils";
|
2
2
|
import * as htElementUtils from "./htElementUtils";
|
3
3
|
export function isLayer(element) {
|
4
4
|
return element.className === 'ht.Grid';
|
@@ -21,12 +21,6 @@ export function isResourceElement(element) {
|
|
21
21
|
export function isResourceNodeElement(element) {
|
22
22
|
return (htElementUtils.isGroup(element) || htElementUtils.isNode(element)) && isResourceElement(element);
|
23
23
|
}
|
24
|
-
export function getGroupChildrenResourceElements(element) {
|
25
|
-
return getGroupChildren(element).filter(isResourceElement);
|
26
|
-
}
|
27
|
-
export function getLayerChildrenResourceElements(layerElement) {
|
28
|
-
return getLayerChildren(layerElement).filter(isResourceElement);
|
29
|
-
}
|
30
24
|
export var getAllEdgeResourceIds = function getAllEdgeResourceIds(dm) {
|
31
25
|
return getEdges(dm).filter(function (node) {
|
32
26
|
return !!node.getTag();
|
@@ -33,7 +33,7 @@ function getTextStyle(element) {
|
|
33
33
|
color: (0, _colorUtil.parseColor)(element.s('group.title.color')),
|
34
34
|
underline: underline
|
35
35
|
}, _fontStyleUtil["default"].toMap(element.s('group.title.font')), {
|
36
|
-
fontSize: font.fontSize ||
|
36
|
+
fontSize: font.fontSize || 24,
|
37
37
|
fontFamily: font.fontFamily || '微软雅黑'
|
38
38
|
}, (0, _colorUtil.parseBackground)(element.s('group.title.background')));
|
39
39
|
}
|
@@ -54,7 +54,7 @@ function BindIpInput(props) {
|
|
54
54
|
if (errors) {
|
55
55
|
console.error("saveIp-error", errors, vals);
|
56
56
|
} else {
|
57
|
-
console.log("saveIp", txtValue);
|
57
|
+
// console.log("saveIp", txtValue);
|
58
58
|
setError("");
|
59
59
|
onChange(txtValue);
|
60
60
|
topoEditApi.relateNodeIp(txtValue, nodeElement);
|
@@ -81,8 +81,7 @@ function BindIpInput(props) {
|
|
81
81
|
return callback();
|
82
82
|
}
|
83
83
|
|
84
|
-
var isUnique = (0, _exitLinkUtil.isUniqueIp)(dm, value, nodeElement);
|
85
|
-
console.log("checkIp", isUnique);
|
84
|
+
var isUnique = (0, _exitLinkUtil.isUniqueIp)(dm, value, nodeElement); // console.log("checkIp", isUnique);
|
86
85
|
|
87
86
|
if (!isUnique) {
|
88
87
|
return callback("ip不能重复");
|
@@ -73,8 +73,7 @@ function Data(props) {
|
|
73
73
|
values: parseValues(values),
|
74
74
|
onChange: function onChange(name, value) {
|
75
75
|
field.validate(function (errors, vals) {
|
76
|
-
if (errors) {
|
77
|
-
console.error("field-Data", errors, vals);
|
76
|
+
if (errors) {// console.error("field-Data", errors, vals);
|
78
77
|
} else {
|
79
78
|
var newValues = field.getValues();
|
80
79
|
|
@@ -59,7 +59,8 @@ function _default(props) {
|
|
59
59
|
resources: config.resources,
|
60
60
|
groups: config.groups,
|
61
61
|
exportLinkIdList: config.exportLinkIdList,
|
62
|
-
relateTopoIdList: config.relateTopoIdList
|
62
|
+
relateTopoIdList: config.relateTopoIdList //linkIps: config.linkIps,
|
63
|
+
|
63
64
|
};
|
64
65
|
};
|
65
66
|
|
@@ -1016,9 +1016,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1016
1016
|
|
1017
1017
|
function _relateNodeIp() {
|
1018
1018
|
_relateNodeIp = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(txtValue, nodeElement) {
|
1019
|
-
var
|
1020
|
-
|
1021
|
-
var dm, htTopo, elements, configObj, _yield$editDispatcher5, elementDatas, isUnique, ids, ip, re, config, linksData, createElementsData;
|
1019
|
+
var dm, htTopo, elementNodes, isUnique, ids, ip, configObj, configData, _elements, newLinkElements, createElementsData;
|
1022
1020
|
|
1023
1021
|
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
1024
1022
|
while (1) {
|
@@ -1028,28 +1026,11 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1028
1026
|
// 根据配置查询拓扑数据
|
1029
1027
|
dm = topo.getDataModel();
|
1030
1028
|
htTopo = topo.getHtTopo();
|
1031
|
-
|
1032
|
-
|
1033
|
-
configObj = topo.resourceConfig.getConfig();
|
1034
|
-
console.log("configObj", configObj);
|
1035
|
-
configObj.linkIps = [].concat((_configObj$linkIps = configObj.linkIps) !== null && _configObj$linkIps !== void 0 ? _configObj$linkIps : [], [txtValue]);
|
1036
|
-
console.log("configObj---over", configObj);
|
1037
|
-
_context16.next = 9;
|
1038
|
-
return resourceConfig.updateConfig(configObj);
|
1039
|
-
|
1040
|
-
case 9:
|
1041
|
-
_context16.next = 11;
|
1042
|
-
return editDispatchers.fetchDataByConfig();
|
1043
|
-
|
1044
|
-
case 11:
|
1045
|
-
_yield$editDispatcher5 = _context16.sent;
|
1046
|
-
elementDatas = _yield$editDispatcher5.elementDatas;
|
1047
|
-
console.log("bindIPtoNode", txtValue, nodeElement, elements);
|
1048
|
-
console.log("elementDatas", elementDatas); // 执行唯一性验证
|
1029
|
+
elementNodes = (0, _htElementUtils.getNodes)(dm); // 执行唯一性验证
|
1049
1030
|
|
1050
1031
|
isUnique = (0, _exitLinkUtil.isUniqueIp)(dm, txtValue, nodeElement);
|
1051
1032
|
ids = [];
|
1052
|
-
|
1033
|
+
elementNodes.map(function (element) {
|
1053
1034
|
if (element.getTag()) {
|
1054
1035
|
ids.push(element.getTag());
|
1055
1036
|
}
|
@@ -1058,6 +1039,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1058
1039
|
id: "ip:" + txtValue,
|
1059
1040
|
name: txtValue,
|
1060
1041
|
customName: null,
|
1042
|
+
bindType: "ip",
|
1061
1043
|
// 'groupId': null,
|
1062
1044
|
// 'groupTag': null,
|
1063
1045
|
ipAddress: txtValue,
|
@@ -1069,54 +1051,44 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1069
1051
|
}; // 获取关联链路
|
1070
1052
|
|
1071
1053
|
if (!isUnique) {
|
1072
|
-
_context16.next =
|
1054
|
+
_context16.next = 23;
|
1073
1055
|
break;
|
1074
1056
|
}
|
1075
1057
|
|
1058
|
+
deleteExLink(nodeElement);
|
1076
1059
|
nodeElement.a(ip);
|
1077
|
-
nodeElement.setName(txtValue);
|
1078
|
-
|
1079
|
-
|
1080
|
-
nodeElement.setTag("ip:" + txtValue);
|
1081
|
-
_context16.next = 25;
|
1082
|
-
return editDispatchers.queryAllLinkByIp({
|
1083
|
-
ids: ids,
|
1084
|
-
ip: txtValue
|
1085
|
-
});
|
1060
|
+
nodeElement.setName(txtValue);
|
1061
|
+
nodeElement.setTag("ip:" + txtValue); // 获取配置
|
1086
1062
|
|
1087
|
-
|
1088
|
-
|
1089
|
-
console.log("
|
1090
|
-
config = resourceConfig.getConfig();
|
1091
|
-
console.log("resourceConfig.getConfig", config);
|
1092
|
-
|
1093
|
-
if (re && re.length > 0) {
|
1094
|
-
linksData = [];
|
1095
|
-
re.map(function (link) {
|
1096
|
-
var sourceId = link.attributes["network_link.source_device_id"];
|
1097
|
-
var source = dm.getDataByTag(sourceId);
|
1098
|
-
var target = nodeElement; // console.log("source, nodeElement, link", source, target, link);
|
1099
|
-
|
1100
|
-
if (source && target) {
|
1101
|
-
var linkData = (0, _linkUtils.mergeExportLinkData)({
|
1102
|
-
source: source,
|
1103
|
-
target: target,
|
1104
|
-
link: link
|
1105
|
-
});
|
1106
|
-
console.log("linkData", linkData);
|
1107
|
-
linksData.push(linkData); // htTopo.createEdge(source, target, link);
|
1108
|
-
}
|
1109
|
-
});
|
1110
|
-
createElementsData = {
|
1111
|
-
groups: [],
|
1112
|
-
nodes: [],
|
1113
|
-
links: [].concat(linksData),
|
1114
|
-
linkGroups: []
|
1115
|
-
};
|
1116
|
-
htTopo.createElements(createElementsData); // htTopo.addElements({ lines: [...re] });
|
1117
|
-
}
|
1063
|
+
configObj = topo.resourceConfig.getConfig(); // console.log("configObj", configObj);
|
1064
|
+
// configObj.linkIps = [...(configObj.linkIps ?? []), txtValue];
|
1065
|
+
// console.log("configObj---over", configObj);
|
1118
1066
|
|
1119
|
-
|
1067
|
+
_context16.next = 15;
|
1068
|
+
return resourceConfig.updateConfig(configObj);
|
1069
|
+
|
1070
|
+
case 15:
|
1071
|
+
_context16.next = 17;
|
1072
|
+
return editDispatchers.fetchDataByConfig();
|
1073
|
+
|
1074
|
+
case 17:
|
1075
|
+
configData = _context16.sent;
|
1076
|
+
_elements = configData.elements;
|
1077
|
+
newLinkElements = findUNExistedLinkElements(_elements);
|
1078
|
+
createElementsData = {
|
1079
|
+
groups: [],
|
1080
|
+
nodes: [],
|
1081
|
+
links: newLinkElements.filter(function (item) {
|
1082
|
+
return item.type === "link";
|
1083
|
+
}),
|
1084
|
+
linkGroups: newLinkElements.filter(function (item) {
|
1085
|
+
return item.type === "linkGroup";
|
1086
|
+
})
|
1087
|
+
};
|
1088
|
+
console.log("createElementsData", createElementsData);
|
1089
|
+
htTopo.createElements(createElementsData);
|
1090
|
+
|
1091
|
+
case 23:
|
1120
1092
|
case "end":
|
1121
1093
|
return _context16.stop();
|
1122
1094
|
}
|
@@ -56,7 +56,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
|
56
56
|
var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
|
57
57
|
|
58
58
|
// eslint-disable-next-line no-undef
|
59
|
-
var version = typeof "9.0.0-a.
|
59
|
+
var version = typeof "9.0.0-a.24" === 'string' ? "9.0.0-a.24" : null;
|
60
60
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
61
61
|
/**
|
62
62
|
* 拓扑显示和编辑
|
@@ -25,8 +25,8 @@ function getLayoutId(layout) {
|
|
25
25
|
|
26
26
|
if (typeof layout === "string") {
|
27
27
|
return {
|
28
|
-
v:
|
29
|
-
h:
|
28
|
+
v: "towardeast",
|
29
|
+
h: "towardsouth"
|
30
30
|
}[layout] || layout;
|
31
31
|
}
|
32
32
|
|
@@ -57,7 +57,7 @@ function saveTopo(_x) {
|
|
57
57
|
|
58
58
|
function _saveTopo() {
|
59
59
|
_saveTopo = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
|
60
|
-
var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources;
|
60
|
+
var topoService, topoId, template, layout, backgroundId, globalConfig, serialize, resources, groups, exportLinkIdList, relateTopoIdList, viewGroupId, groupInfo, viewResources, linkIps;
|
61
61
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
62
62
|
while (1) {
|
63
63
|
switch (_context.prev = _context.next) {
|
@@ -91,7 +91,7 @@ function _saveTopo() {
|
|
91
91
|
|
92
92
|
case 8:
|
93
93
|
if (!(resources || groups)) {
|
94
|
-
_context.next =
|
94
|
+
_context.next = 16;
|
95
95
|
break;
|
96
96
|
}
|
97
97
|
|
@@ -113,25 +113,32 @@ function _saveTopo() {
|
|
113
113
|
});
|
114
114
|
}
|
115
115
|
|
116
|
+
linkIps = []; // resources?.static.map((nodeId) => {
|
117
|
+
// if (nodeId.startsWith("ip_")) {
|
118
|
+
// linkIps.push(nodeId.replace("ip_", ""));
|
119
|
+
// }
|
120
|
+
// });
|
121
|
+
|
116
122
|
_rlog["default"].debug("saveTopo-groupInfo", groupInfo);
|
117
123
|
|
118
|
-
_context.next =
|
124
|
+
_context.next = 16;
|
119
125
|
return topoService.bindResourceToTopo(topoId, {
|
120
126
|
groups: groupInfo,
|
127
|
+
linkIps: linkIps,
|
121
128
|
exportLinkIdList: exportLinkIdList,
|
122
129
|
relateTopoIdList: relateTopoIdList
|
123
130
|
});
|
124
131
|
|
125
|
-
case
|
132
|
+
case 16:
|
126
133
|
if (!serialize) {
|
127
|
-
_context.next =
|
134
|
+
_context.next = 19;
|
128
135
|
break;
|
129
136
|
}
|
130
137
|
|
131
|
-
_context.next =
|
138
|
+
_context.next = 19;
|
132
139
|
return topoService.saveSerializeData(topoId, serialize);
|
133
140
|
|
134
|
-
case
|
141
|
+
case 19:
|
135
142
|
case "end":
|
136
143
|
return _context.stop();
|
137
144
|
}
|