@riil-frontend/component-topology 9.0.0-a.26 → 9.0.0-a.27
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/core/components/TopoView/GraphViewPanel.js +8 -3
- package/es/core/components/TopoView/TopoView.module.scss +17 -3
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +21 -5
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +5 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +31 -12
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +12 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +6 -0
- package/es/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +4 -3
- package/es/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +0 -8
- package/es/core/hooks/useCanvasTheme.js +1 -0
- package/es/core/hooks/useTopoEdit.js +15 -37
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/store/models/topoConfig.js +12 -11
- package/es/networkTopo/utils/exitLinkUtil.js +21 -6
- package/lib/core/components/TopoView/GraphViewPanel.js +9 -3
- package/lib/core/components/TopoView/TopoView.module.scss +17 -3
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +21 -4
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +5 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +31 -12
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +12 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +6 -0
- package/lib/core/editor/components/settings/propertyViews/group/DataTab/hoooks/useGroupRelateResource.js +3 -3
- package/lib/core/editor/components/settings/propertyViews/node/data/BindIpInput.js +0 -8
- package/lib/core/hooks/useCanvasTheme.js +1 -0
- package/lib/core/hooks/useTopoEdit.js +12 -35
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/store/models/topoConfig.js +13 -11
- package/lib/networkTopo/utils/exitLinkUtil.js +21 -6
- package/package.json +2 -2
@@ -5,6 +5,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
exports.__esModule = true;
|
6
6
|
exports["default"] = void 0;
|
7
7
|
|
8
|
+
var _checkbox = _interopRequireDefault(require("@alifd/next/lib/checkbox"));
|
9
|
+
|
8
10
|
var _field = _interopRequireDefault(require("@alifd/next/lib/field"));
|
9
11
|
|
10
12
|
var _select = _interopRequireDefault(require("@alifd/next/lib/select"));
|
@@ -94,10 +96,12 @@ function getValuesByEdges(topo) {
|
|
94
96
|
})[0] || 'nil';
|
95
97
|
}
|
96
98
|
|
97
|
-
function getEdgesValues(edges) {
|
99
|
+
function getEdgesValues(edges, topo) {
|
98
100
|
var edgeValues = [];
|
101
|
+
var htTopo = topo.getHtTopo();
|
99
102
|
edges.forEach(function (edge) {
|
100
103
|
edgeValues.push({
|
104
|
+
baseAgreement: htTopo.getEdgeMultarc(edges),
|
101
105
|
lineButton: edge.s('edge.type'),
|
102
106
|
startPoint: getStartPoint(edge),
|
103
107
|
endPoint: getEndPoint(edge),
|
@@ -108,8 +112,9 @@ function getValuesByEdges(topo) {
|
|
108
112
|
}
|
109
113
|
|
110
114
|
var selectionEdges = (0, _edgeTypeStyleUtil.getEdgesBySelection)(topo);
|
111
|
-
var edgeValues = getEdgesValues(selectionEdges);
|
115
|
+
var edgeValues = getEdgesValues(selectionEdges, topo);
|
112
116
|
var values = {
|
117
|
+
baseAgreement: false,
|
113
118
|
lineButton: undefined,
|
114
119
|
startPoint: undefined,
|
115
120
|
endPoint: undefined,
|
@@ -135,10 +140,18 @@ function EdgeType(props) {
|
|
135
140
|
selection = props.selection,
|
136
141
|
_onChange = props.onChange;
|
137
142
|
|
143
|
+
var _useState = (0, _react.useState)(false),
|
144
|
+
disable = _useState[0],
|
145
|
+
setDisabel = _useState[1];
|
146
|
+
|
138
147
|
var field = _field["default"].useField({
|
139
148
|
autoUnmount: false,
|
140
149
|
values: getValuesByEdges(topo),
|
141
150
|
onChange: function onChange(name, value) {
|
151
|
+
if (name == 'baseAgreement') {
|
152
|
+
setDisabel(value);
|
153
|
+
}
|
154
|
+
|
142
155
|
if (['startPoint', 'endPoint'].includes(name) && value === 'nil') {
|
143
156
|
_onChange(name, null);
|
144
157
|
} else {
|
@@ -157,8 +170,12 @@ function EdgeType(props) {
|
|
157
170
|
inline: true,
|
158
171
|
labelAlign: "top"
|
159
172
|
}, /*#__PURE__*/_react["default"].createElement(FormItem, null, /*#__PURE__*/_react["default"].createElement(_LineType["default"], {
|
160
|
-
name: "lineButton"
|
161
|
-
|
173
|
+
name: "lineButton",
|
174
|
+
disable: disable
|
175
|
+
})), /*#__PURE__*/_react["default"].createElement(FormItem, null, /*#__PURE__*/_react["default"].createElement(_checkbox["default"], {
|
176
|
+
name: "baseAgreement",
|
177
|
+
onChange: _onChange
|
178
|
+
}, "\u81EA\u52A8\u8C03\u6574")), /*#__PURE__*/_react["default"].createElement(FormItem, {
|
162
179
|
label: "\u8D77\u70B9"
|
163
180
|
}, /*#__PURE__*/_react["default"].createElement(_select["default"], {
|
164
181
|
name: "startPoint",
|
@@ -5,7 +5,6 @@
|
|
5
5
|
background: #FFFFFF;
|
6
6
|
border-radius: 4px;
|
7
7
|
margin-bottom: -7px;
|
8
|
-
|
9
8
|
:global {
|
10
9
|
.#{$css-prefix}form-item:first-child{
|
11
10
|
margin-top: 0;
|
@@ -15,6 +14,11 @@
|
|
15
14
|
margin-top: 7px;
|
16
15
|
margin-bottom: 7px;
|
17
16
|
}
|
17
|
+
.#{$css-prefix}form-item:nth-child(2){
|
18
|
+
display: block !important;
|
19
|
+
margin-top: 7px;
|
20
|
+
margin-bottom: 0px;
|
21
|
+
}
|
18
22
|
.#{$css-prefix}form.#{$css-prefix}inline .#{$css-prefix}form-item:not(:last-child) {
|
19
23
|
margin-right: 8px;
|
20
24
|
.#{$css-prefix}select-trigger {
|
@@ -36,29 +36,48 @@ var LINE_TYPE_OPTIONS = [{
|
|
36
36
|
value: 'ortho',
|
37
37
|
label: '双折线',
|
38
38
|
icon: 'topo_linear_icon_bilinear'
|
39
|
+
}, {
|
40
|
+
value: 'arc',
|
41
|
+
label: '单弧线',
|
42
|
+
icon: 'topo_linear_icon_arc_line'
|
39
43
|
}, {
|
40
44
|
value: 'doublearc',
|
41
45
|
label: '双弧线',
|
42
46
|
icon: 'topo_linear_icon_arcline'
|
47
|
+
}, {
|
48
|
+
value: 'points',
|
49
|
+
label: '自由线形',
|
50
|
+
icon: 'topo_linear_icon_pointsline'
|
43
51
|
}];
|
44
52
|
|
45
53
|
var LineType = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
46
54
|
var value = props.value,
|
47
|
-
onChange = props.onChange
|
55
|
+
onChange = props.onChange,
|
56
|
+
disable = props.disable;
|
48
57
|
|
49
58
|
function lineButton(item) {
|
50
|
-
|
59
|
+
if (disable) {
|
60
|
+
return /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
61
|
+
className: _LineTypeModule["default"].redioBtnDisable
|
62
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
63
|
+
src: "/img/topo/editor/lineType/" + item.icon + "_disable.svg",
|
64
|
+
alt: "",
|
65
|
+
className: _LineTypeModule["default"].iconImg
|
66
|
+
}));
|
67
|
+
} else {
|
68
|
+
var _classNames;
|
51
69
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
70
|
+
return /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
71
|
+
className: (0, _classnames["default"])(_LineTypeModule["default"].redioBtn, (_classNames = {}, _classNames[_LineTypeModule["default"].selected] = value === item.value, _classNames)),
|
72
|
+
onClick: function onClick() {
|
73
|
+
onChange(item.value);
|
74
|
+
}
|
75
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
76
|
+
src: "/img/topo/editor/lineType/" + item.icon + ".svg",
|
77
|
+
alt: "",
|
78
|
+
className: _LineTypeModule["default"].iconImg
|
79
|
+
}));
|
80
|
+
}
|
62
81
|
}
|
63
82
|
|
64
83
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
@@ -1,5 +1,15 @@
|
|
1
1
|
.lineType{
|
2
2
|
display:flex;
|
3
|
+
.redioBtnDisable {
|
4
|
+
width: 24px;
|
5
|
+
height: 24px;
|
6
|
+
border-radius: 4px;
|
7
|
+
border: none !important;
|
8
|
+
color: #4D6277;
|
9
|
+
padding: 0;
|
10
|
+
margin-right: 10px;
|
11
|
+
text-align: center;
|
12
|
+
}
|
3
13
|
.redioBtn {
|
4
14
|
width: 24px;
|
5
15
|
height: 24px;
|
@@ -7,9 +17,9 @@
|
|
7
17
|
border: none !important;
|
8
18
|
color: #4D6277;
|
9
19
|
padding: 0;
|
10
|
-
margin-right:
|
20
|
+
margin-right: 10px;
|
11
21
|
text-align: center;
|
12
|
-
|
22
|
+
|
13
23
|
.iconImg {
|
14
24
|
vertical-align: middle;
|
15
25
|
}
|
@@ -68,6 +68,12 @@ function EdgeTypeButton(props) {
|
|
68
68
|
return;
|
69
69
|
}
|
70
70
|
|
71
|
+
if (name == 'baseAgreement') {
|
72
|
+
/** TODO: 自动调整api调用*/
|
73
|
+
htTopo.setEdgeMultarc(edges, value);
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
|
71
77
|
(0, _edgeTypeStyleUtil.setEdgesAndChildren)(topo, edges, function (edge) {
|
72
78
|
if (name === 'startPoint') {
|
73
79
|
// 删除设置
|
@@ -11,8 +11,6 @@ var _componentTopologyGraph = require("@riil-frontend/component-topology-graph")
|
|
11
11
|
|
12
12
|
var _sortBy = _interopRequireDefault(require("lodash/sortBy"));
|
13
13
|
|
14
|
-
var _htElementDataUtil = require("../../../../../../../../utils/htElementDataUtil");
|
15
|
-
|
16
14
|
var _htElementUtils = require("../../../../../../../../utils/htElementUtils");
|
17
15
|
|
18
16
|
function sortResourcesByName(resources) {
|
@@ -30,7 +28,9 @@ function useGroupRelateResource(props) {
|
|
30
28
|
} : _props$useGroupSortRe; // const [resources, setResources] = useState([]);
|
31
29
|
// 过滤出资源
|
32
30
|
|
33
|
-
var resourceNodes = (0,
|
31
|
+
var resourceNodes = (0, _htElementUtils.getGroupChildren)(group).filter(function (item) {
|
32
|
+
return !!item.getTag();
|
33
|
+
}); // 资源按名称排序
|
34
34
|
|
35
35
|
var useSortNodes = useGroupSortResources || ((_topo$options$editor = topo.options.editor) === null || _topo$options$editor === void 0 ? void 0 : _topo$options$editor.sortResources) || sortResourcesByName;
|
36
36
|
var data = useSortNodes(resourceNodes.map(function (node) {
|
@@ -54,7 +54,6 @@ function BindIpInput(props) {
|
|
54
54
|
if (errors) {
|
55
55
|
console.error("saveIp-error", errors, vals);
|
56
56
|
} else {
|
57
|
-
// console.log("saveIp", txtValue);
|
58
57
|
setError("");
|
59
58
|
onChange(txtValue);
|
60
59
|
topoEditApi.relateNodeIp(txtValue, nodeElement);
|
@@ -74,13 +73,6 @@ function BindIpInput(props) {
|
|
74
73
|
|
75
74
|
var checkIp = function checkIp(rule, value, callback) {
|
76
75
|
var dm = topo.getDataModel();
|
77
|
-
var rex = /^((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))$/;
|
78
|
-
var reg = value.match(rex);
|
79
|
-
|
80
|
-
if (reg === null) {
|
81
|
-
return callback();
|
82
|
-
}
|
83
|
-
|
84
76
|
var isUnique = (0, _exitLinkUtil.isUniqueIp)(dm, value, nodeElement); // console.log("checkIp", isUnique);
|
85
77
|
|
86
78
|
if (!isUnique) {
|
@@ -74,6 +74,7 @@ function useCanvasTheme(props) {
|
|
74
74
|
if (graphLoaded) {
|
75
75
|
try {
|
76
76
|
topo.getHtTopo().getGraphView().dm().setBackground(canvasColor);
|
77
|
+
topo.getHtTopo().getGraphView().dm().setBackground(canvasbackgroundImage);
|
77
78
|
} catch (error) {
|
78
79
|
console.error('切换主题失败', error);
|
79
80
|
}
|
@@ -25,8 +25,6 @@ var _componentTopologyGraph = require("@riil-frontend/component-topology-graph")
|
|
25
25
|
|
26
26
|
var _template = require("../../utils/template");
|
27
27
|
|
28
|
-
var _topoPermissionUtil = _interopRequireDefault(require("../../utils/topoPermissionUtil"));
|
29
|
-
|
30
28
|
var _htElementUtils = require("../../utils/htElementUtils");
|
31
29
|
|
32
30
|
var _useResourceConfig = _interopRequireDefault(require("./useResourceConfig"));
|
@@ -253,7 +251,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
253
251
|
return;
|
254
252
|
}
|
255
253
|
|
256
|
-
if (!(0,
|
254
|
+
if (!(0, _htElementUtils.getGroupChildren)(group).filter(_htElementDataUtil.isResourceElement).length || (0, _clusterUtil.isClusterHtElement)(group)) {
|
257
255
|
doDelete();
|
258
256
|
return;
|
259
257
|
} // 有子节点时需要确认
|
@@ -1016,42 +1014,23 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1016
1014
|
|
1017
1015
|
function _relateNodeIp() {
|
1018
1016
|
_relateNodeIp = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(txtValue, nodeElement) {
|
1019
|
-
var dm, htTopo, elementNodes, isUnique,
|
1017
|
+
var dm, htTopo, elementNodes, isUnique, ip, configObj, configData, _elements, newLinkElements, createElementsData;
|
1020
1018
|
|
1021
1019
|
return _regenerator["default"].wrap(function _callee16$(_context16) {
|
1022
1020
|
while (1) {
|
1023
1021
|
switch (_context16.prev = _context16.next) {
|
1024
1022
|
case 0:
|
1025
|
-
// console.log("bindIPtoNode",
|
1023
|
+
// console.log("bindIPtoNode", txtValue, nodeElement);
|
1026
1024
|
// 根据配置查询拓扑数据
|
1027
1025
|
dm = topo.getDataModel();
|
1028
1026
|
htTopo = topo.getHtTopo();
|
1029
1027
|
elementNodes = (0, _htElementUtils.getNodes)(dm); // 执行唯一性验证
|
1030
1028
|
|
1031
1029
|
isUnique = (0, _exitLinkUtil.isUniqueIp)(dm, txtValue, nodeElement);
|
1032
|
-
|
1033
|
-
elementNodes.map(function (element) {
|
1034
|
-
if (element.getTag()) {
|
1035
|
-
ids.push(element.getTag());
|
1036
|
-
}
|
1037
|
-
});
|
1038
|
-
ip = {
|
1039
|
-
id: "ip:" + txtValue,
|
1040
|
-
name: txtValue,
|
1041
|
-
customName: null,
|
1042
|
-
bindType: "ip",
|
1043
|
-
// 'groupId': null,
|
1044
|
-
// 'groupTag': null,
|
1045
|
-
ipAddress: txtValue,
|
1046
|
-
// 'attributes': [],
|
1047
|
-
// 'metrics': [],
|
1048
|
-
type: "node",
|
1049
|
-
isbinding: true // 'dtype': 'device'
|
1050
|
-
|
1051
|
-
}; // 获取关联链路
|
1030
|
+
ip = (0, _exitLinkUtil.buildIpNode)(txtValue); // 获取关联链路
|
1052
1031
|
|
1053
1032
|
if (!isUnique) {
|
1054
|
-
_context16.next =
|
1033
|
+
_context16.next = 21;
|
1055
1034
|
break;
|
1056
1035
|
}
|
1057
1036
|
|
@@ -1060,19 +1039,17 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1060
1039
|
nodeElement.setName(txtValue);
|
1061
1040
|
nodeElement.setTag("ip:" + txtValue); // 获取配置
|
1062
1041
|
|
1063
|
-
configObj = topo.resourceConfig.getConfig();
|
1064
|
-
|
1065
|
-
// console.log("configObj---over", configObj);
|
1066
|
-
|
1067
|
-
_context16.next = 15;
|
1042
|
+
configObj = topo.resourceConfig.getConfig();
|
1043
|
+
_context16.next = 13;
|
1068
1044
|
return resourceConfig.updateConfig(configObj);
|
1069
1045
|
|
1070
|
-
case
|
1071
|
-
_context16.next =
|
1046
|
+
case 13:
|
1047
|
+
_context16.next = 15;
|
1072
1048
|
return editDispatchers.fetchDataByConfig();
|
1073
1049
|
|
1074
|
-
case
|
1050
|
+
case 15:
|
1075
1051
|
configData = _context16.sent;
|
1052
|
+
// console.log("configData", configData);
|
1076
1053
|
_elements = configData.elements;
|
1077
1054
|
newLinkElements = findUNExistedLinkElements(_elements);
|
1078
1055
|
createElementsData = {
|
@@ -1088,7 +1065,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1088
1065
|
console.log("createElementsData", createElementsData);
|
1089
1066
|
htTopo.createElements(createElementsData);
|
1090
1067
|
|
1091
|
-
case
|
1068
|
+
case 21:
|
1092
1069
|
case "end":
|
1093
1070
|
return _context16.stop();
|
1094
1071
|
}
|
@@ -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.27" === 'string' ? "9.0.0-a.27" : null;
|
60
60
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
61
61
|
/**
|
62
62
|
* 拓扑显示和编辑
|
@@ -274,6 +274,7 @@ function _default(topoApp) {
|
|
274
274
|
case 0:
|
275
275
|
editState = rootState.topoConfig;
|
276
276
|
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups, _editState$exportLink = editState.exportLinkIdList, exportLinkIdList = _editState$exportLink === void 0 ? [] : _editState$exportLink, _editState$ipNodes = editState.ipNodes, ipNodes = _editState$ipNodes === void 0 ? [] : _editState$ipNodes;
|
277
|
+
console.log("editState", editState);
|
277
278
|
query = {
|
278
279
|
id: rootState.topoMod.topoId,
|
279
280
|
resources: resources,
|
@@ -281,10 +282,10 @@ function _default(topoApp) {
|
|
281
282
|
exportLinkIdList: exportLinkIdList,
|
282
283
|
ipNodes: ipNodes
|
283
284
|
};
|
284
|
-
_context2.next =
|
285
|
+
_context2.next = 6;
|
285
286
|
return _this2.getTopoByConditions(query);
|
286
287
|
|
287
|
-
case
|
288
|
+
case 6:
|
288
289
|
data = _context2.sent;
|
289
290
|
|
290
291
|
_rlog["default"].debug("按配置查询拓扑数据", {
|
@@ -297,7 +298,7 @@ function _default(topoApp) {
|
|
297
298
|
|
298
299
|
return _context2.abrupt("return", data);
|
299
300
|
|
300
|
-
case
|
301
|
+
case 9:
|
301
302
|
case "end":
|
302
303
|
return _context2.stop();
|
303
304
|
}
|
@@ -339,7 +340,8 @@ function _default(topoApp) {
|
|
339
340
|
while (1) {
|
340
341
|
switch (_context4.prev = _context4.next) {
|
341
342
|
case 0:
|
342
|
-
|
343
|
+
_rlog["default"].debug("getTopoByConditions--------", params);
|
344
|
+
|
343
345
|
topoId = params.id, resources = params.resources, groups = params.groups, exportLinkIdList = params.exportLinkIdList, ipNodes = params.ipNodes;
|
344
346
|
viewConditions = (0, _topoData2.resToConditions)(resources);
|
345
347
|
groupInfo = (0, _utils.isAvailableArray)(groups) && groups.map(function (group) {
|
@@ -351,23 +353,23 @@ function _default(topoApp) {
|
|
351
353
|
|
352
354
|
_rlog["default"].debug("getTopoByConditions--------", viewConditions, groupInfo);
|
353
355
|
|
354
|
-
_context4.next =
|
356
|
+
_context4.next = 7;
|
355
357
|
return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo, exportLinkIdList, ipNodes);
|
356
358
|
|
357
|
-
case
|
359
|
+
case 7:
|
358
360
|
data = _context4.sent;
|
359
361
|
|
360
362
|
_rlog["default"].debug("getTopoByConditions--------data", data);
|
361
363
|
|
362
|
-
_context4.next =
|
364
|
+
_context4.next = 11;
|
363
365
|
return (0, _getTopoData.buildData)(data);
|
364
366
|
|
365
|
-
case
|
367
|
+
case 11:
|
366
368
|
data = _context4.sent;
|
367
|
-
_context4.next =
|
369
|
+
_context4.next = 14;
|
368
370
|
return Promise.all([(0, _getTopoData.addLinkData)(data), topoApp.ciTyeCache.getCiTypeMap((0, _topoData.getCiTypes)(data)), dispatch.customIcon.loadCustomIcons()]);
|
369
371
|
|
370
|
-
case
|
372
|
+
case 14:
|
371
373
|
_yield$Promise$all = _context4.sent;
|
372
374
|
dataWithLinkDetail = _yield$Promise$all[0];
|
373
375
|
_combTopoData = (0, _topoData.combTopoData)({
|
@@ -394,7 +396,7 @@ function _default(topoApp) {
|
|
394
396
|
topoDataTrans: topoDataTrans
|
395
397
|
});
|
396
398
|
|
397
|
-
case
|
399
|
+
case 22:
|
398
400
|
case "end":
|
399
401
|
return _context4.stop();
|
400
402
|
}
|
@@ -22,7 +22,7 @@ function isPingHtNode(node, ip) {
|
|
22
22
|
}
|
23
23
|
|
24
24
|
function isIpHtNode(node, ip) {
|
25
|
-
return node.a(
|
25
|
+
return node.a("bindType") === 'ip' && node.a("bindIp") === ip;
|
26
26
|
}
|
27
27
|
|
28
28
|
function buildIpNode(ip) {
|
@@ -59,11 +59,26 @@ function isExitLink(link) {
|
|
59
59
|
|
60
60
|
function isUniqueIp(dataModel, ip, nodeElement) {
|
61
61
|
var nodes = (0, _htElementUtils.getNodes)(dataModel);
|
62
|
-
var isUnique =
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
62
|
+
var isUnique = true;
|
63
|
+
console.log("nodes-nodeElement", nodes, nodeElement);
|
64
|
+
|
65
|
+
if (nodeElement) {
|
66
|
+
console.log("nodes-nodeElement---filter", nodes.filter(function (node) {
|
67
|
+
return node.getId() !== (nodeElement === null || nodeElement === void 0 ? void 0 : nodeElement.getId());
|
68
|
+
}));
|
69
|
+
var arr = nodes.filter(function (node) {
|
70
|
+
return node.getId() !== (nodeElement === null || nodeElement === void 0 ? void 0 : nodeElement.getId());
|
71
|
+
}).filter(function (node) {
|
72
|
+
return isPingHtNode(node, ip) || isIpHtNode(node, ip);
|
73
|
+
});
|
74
|
+
isUnique = arr.length === 0;
|
75
|
+
console.log("nodes-nodeElement---filter", arr, isUnique);
|
76
|
+
} else {
|
77
|
+
isUnique = nodes.filter(function (node) {
|
78
|
+
return node.a("ipAddress") === ip;
|
79
|
+
}).length === 0;
|
80
|
+
}
|
81
|
+
|
67
82
|
return isUnique;
|
68
83
|
}
|
69
84
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "9.0.0-a.
|
3
|
+
"version": "9.0.0-a.27",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -116,6 +116,6 @@
|
|
116
116
|
"access": "public"
|
117
117
|
},
|
118
118
|
"license": "MIT",
|
119
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.0-a.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.0-a.27/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|