@riil-frontend/component-topology 3.3.0 → 3.4.0
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 +5 -5
- package/es/components/MultiResourceDrawer/index.js +2 -2
- package/es/components/NetworkTopoResourceSelectDrawer/NetworkTopoResourceSelectDrawer.js +9 -0
- package/es/components/NetworkTopoResourceSelectDrawer/index.js +2 -0
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -3
- package/es/components/ResourceSelectDrawer/ResourceSelectList.js +9 -6
- package/es/components/SingleResourceDrawer/SelectDrawer.js +1 -1
- package/es/constants/ResourceTypeLimit.js +12 -1
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +1 -1
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +29 -16
- package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +0 -1
- package/es/core/editor/components/settings/propertyViews/index.js +1 -5
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +1 -1
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +2 -1
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/utils/linkUtils.js +15 -16
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +15 -11
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +5 -4
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +39 -36
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +19 -15
- package/es/topoCenter/services/link.js +22 -14
- package/es/topoCenter/utils/linPermissionUtil.js +3 -4
- package/lib/components/MultiResourceDrawer/index.js +2 -2
- package/lib/components/NetworkTopoResourceSelectDrawer/NetworkTopoResourceSelectDrawer.js +20 -0
- package/lib/components/NetworkTopoResourceSelectDrawer/index.js +11 -0
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +8 -3
- package/lib/components/ResourceSelectDrawer/ResourceSelectList.js +10 -5
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +2 -2
- package/lib/constants/ResourceTypeLimit.js +19 -2
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +2 -2
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +30 -15
- package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +0 -1
- package/lib/core/editor/components/settings/propertyViews/index.js +1 -5
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +2 -2
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +3 -2
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/utils/linkUtils.js +13 -14
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +20 -13
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +5 -4
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +39 -36
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +17 -16
- package/lib/topoCenter/services/link.js +22 -14
- package/lib/topoCenter/utils/linPermissionUtil.js +3 -4
- package/package.json +2 -2
package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js
CHANGED
|
@@ -63,8 +63,8 @@ export default function EditLinkInfo(props) {
|
|
|
63
63
|
setConnectEnable = _useState4[1];
|
|
64
64
|
|
|
65
65
|
var fieldOnChange = function fieldOnChange(name, value) {
|
|
66
|
-
var newValues = field.getValues();
|
|
67
|
-
|
|
66
|
+
var newValues = field.getValues(); // rlog.debug("Field-onChange", newValues, name, value);
|
|
67
|
+
|
|
68
68
|
setValus(newValues);
|
|
69
69
|
};
|
|
70
70
|
|
|
@@ -111,7 +111,6 @@ export default function EditLinkInfo(props) {
|
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
var connectHandleChange = function connectHandleChange(v) {
|
|
114
|
-
console.log("connectHandleChange", v);
|
|
115
114
|
field.setValue("connect_type", v);
|
|
116
115
|
};
|
|
117
116
|
|
|
@@ -129,9 +128,9 @@ export default function EditLinkInfo(props) {
|
|
|
129
128
|
actualBandwidth = Math.min(sourceRb, targetRb);
|
|
130
129
|
} else {
|
|
131
130
|
actualBandwidth = sourceRb || targetRb;
|
|
132
|
-
}
|
|
131
|
+
} // rlog.debug("network_link.actual_bandwidth", actualBandwidth);
|
|
132
|
+
|
|
133
133
|
|
|
134
|
-
rlog.debug("network_link.actual_bandwidth", actualBandwidth);
|
|
135
134
|
field.setValue("network_link.actual_bandwidth", actualBandwidth);
|
|
136
135
|
};
|
|
137
136
|
|
|
@@ -140,14 +139,15 @@ export default function EditLinkInfo(props) {
|
|
|
140
139
|
if (errors) {
|
|
141
140
|
rlog.debug("saveHandleChange-error", errors, values);
|
|
142
141
|
} else {
|
|
143
|
-
var _valus$destination_id, _sourceValue$portsDoc3, _sourceValue$portsDoc4, _targetValue$portsDoc3, _targetValue$portsDoc4,
|
|
142
|
+
var _valus$destination_id, _sourceValue$portsDoc3, _sourceValue$portsDoc4, _targetValue$portsDoc3, _targetValue$portsDoc4, _targetValue$ipAddres, _sourceValue$ipAddres, _targetValue$id;
|
|
144
143
|
|
|
145
144
|
rlog.debug("saveHandleChange", valus, source, target);
|
|
146
145
|
var sourceId = valus["source_id"];
|
|
147
146
|
var destinationId = (_valus$destination_id = valus["destination_id"]) !== null && _valus$destination_id !== void 0 ? _valus$destination_id : "";
|
|
148
147
|
var sourceType = (_sourceValue$portsDoc3 = (_sourceValue$portsDoc4 = sourceValue.portsDoc[sourceId]) === null || _sourceValue$portsDoc4 === void 0 ? void 0 : _sourceValue$portsDoc4.type) !== null && _sourceValue$portsDoc3 !== void 0 ? _sourceValue$portsDoc3 : "";
|
|
149
148
|
var destinationType = (_targetValue$portsDoc3 = (_targetValue$portsDoc4 = targetValue.portsDoc[destinationId]) === null || _targetValue$portsDoc4 === void 0 ? void 0 : _targetValue$portsDoc4.type) !== null && _targetValue$portsDoc3 !== void 0 ? _targetValue$portsDoc3 : "";
|
|
150
|
-
var typeJudge = linkTypeJudge(sourceType, destinationType, valus["connect_type"]);
|
|
149
|
+
var typeJudge = linkTypeJudge(sourceType, destinationType, valus["network_link.connect_type"]);
|
|
150
|
+
var destination_ipv4 = valus["network_link.connect_type"] !== "exit" ? (_targetValue$ipAddres = targetValue.ipAddress) !== null && _targetValue$ipAddres !== void 0 ? _targetValue$ipAddres : valus["network_link.destination_ipv4"] : valus["network_link.destination_ipv4"];
|
|
151
151
|
var obj = {
|
|
152
152
|
display_name: valus["display_name"],
|
|
153
153
|
// 链路名称
|
|
@@ -155,7 +155,7 @@ export default function EditLinkInfo(props) {
|
|
|
155
155
|
// 链路名称
|
|
156
156
|
"network_link.source_ipv4": (_sourceValue$ipAddres = sourceValue.ipAddress) !== null && _sourceValue$ipAddres !== void 0 ? _sourceValue$ipAddres : valus["network_link.source_ipv4"],
|
|
157
157
|
// 源IP
|
|
158
|
-
"network_link.destination_ipv4":
|
|
158
|
+
"network_link.destination_ipv4": destination_ipv4,
|
|
159
159
|
// 目的IP
|
|
160
160
|
// source_id, // 源端口
|
|
161
161
|
// destination_id, // 目的端口
|
|
@@ -224,6 +224,16 @@ export default function EditLinkInfo(props) {
|
|
|
224
224
|
});
|
|
225
225
|
};
|
|
226
226
|
|
|
227
|
+
var targetIpComp = function targetIpComp(targetValue) {
|
|
228
|
+
return targetValue.ipAddress && targetValue.ciType !== "customNode" ? /*#__PURE__*/React.createElement("div", {
|
|
229
|
+
className: styles.label
|
|
230
|
+
}, targetValue.ipAddress) : /*#__PURE__*/React.createElement(_Input, {
|
|
231
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
232
|
+
name: "network_link.destination_ipv4",
|
|
233
|
+
maxLength: 128
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
|
|
227
237
|
return /*#__PURE__*/React.createElement("div", {
|
|
228
238
|
className: styles.editForm
|
|
229
239
|
}, /*#__PURE__*/React.createElement(_Form, {
|
|
@@ -262,13 +272,7 @@ export default function EditLinkInfo(props) {
|
|
|
262
272
|
}, /*#__PURE__*/React.createElement(FormItem, _extends({}, formItemLayout, {
|
|
263
273
|
labelAlign: labelAlign,
|
|
264
274
|
label: "\u76EE\u7684\u8282\u70B9IP"
|
|
265
|
-
}),
|
|
266
|
-
className: styles.label
|
|
267
|
-
}, targetValue.ipAddress) : /*#__PURE__*/React.createElement(_Input, {
|
|
268
|
-
placeholder: "\u8BF7\u8F93\u5165",
|
|
269
|
-
name: "network_link.destination_ipv4",
|
|
270
|
-
maxLength: 128
|
|
271
|
-
})))), /*#__PURE__*/React.createElement(Row, {
|
|
275
|
+
}), targetIpComp(target)))), /*#__PURE__*/React.createElement(Row, {
|
|
272
276
|
gutter: "16"
|
|
273
277
|
}, /*#__PURE__*/React.createElement(Col, {
|
|
274
278
|
span: "12"
|
|
@@ -146,41 +146,49 @@ export default {
|
|
|
146
146
|
*
|
|
147
147
|
* @param {array} ciIds
|
|
148
148
|
*/
|
|
149
|
-
queryAssociatedlinks: function queryAssociatedlinks(ids) {
|
|
149
|
+
queryAssociatedlinks: function queryAssociatedlinks(ids, type) {
|
|
150
150
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
151
|
-
var
|
|
151
|
+
var stag, ttag, condition, parm, jsonParm, result;
|
|
152
152
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
153
153
|
while (1) {
|
|
154
154
|
switch (_context5.prev = _context5.next) {
|
|
155
155
|
case 0:
|
|
156
|
-
idtxt =
|
|
156
|
+
// const idtxt = `'${ids[0]}','${ids[1]}'`;
|
|
157
|
+
stag = ids[0];
|
|
158
|
+
ttag = ids[1];
|
|
159
|
+
condition = "type('network_link') && network_link.connect_type = 'exit' && network_link.source_device_id ='" + stag + "'";
|
|
160
|
+
|
|
161
|
+
if (ttag) {
|
|
162
|
+
condition = "type('network_link') && network_link.connect_type = 'exit' && network_link.source_device_id ='" + stag + "' && network_link.destination_device_id='" + ttag + "'";
|
|
163
|
+
}
|
|
164
|
+
|
|
157
165
|
parm = {
|
|
158
|
-
condition:
|
|
166
|
+
condition: condition,
|
|
159
167
|
sort: "name asc",
|
|
160
168
|
currentPage: 1,
|
|
161
|
-
pageSize:
|
|
169
|
+
pageSize: 99
|
|
162
170
|
};
|
|
163
171
|
jsonParm = JSON.stringify(parm);
|
|
164
|
-
console.log("queryAssociatedlinks", ids,
|
|
165
|
-
_context5.prev =
|
|
166
|
-
_context5.next =
|
|
172
|
+
console.log("queryAssociatedlinks", ids, parm, jsonParm);
|
|
173
|
+
_context5.prev = 7;
|
|
174
|
+
_context5.next = 10;
|
|
167
175
|
return getRequest().post("/mdc/v1/api/cmdb/commonQueryCiData", jsonParm);
|
|
168
176
|
|
|
169
|
-
case
|
|
177
|
+
case 10:
|
|
170
178
|
result = _context5.sent;
|
|
171
179
|
return _context5.abrupt("return", result);
|
|
172
180
|
|
|
173
|
-
case
|
|
174
|
-
_context5.prev =
|
|
175
|
-
_context5.t0 = _context5["catch"](
|
|
181
|
+
case 14:
|
|
182
|
+
_context5.prev = 14;
|
|
183
|
+
_context5.t0 = _context5["catch"](7);
|
|
176
184
|
rlog.error("查询可关联链路", _context5.t0);
|
|
177
185
|
|
|
178
|
-
case
|
|
186
|
+
case 17:
|
|
179
187
|
case "end":
|
|
180
188
|
return _context5.stop();
|
|
181
189
|
}
|
|
182
190
|
}
|
|
183
|
-
}, _callee5, null, [[
|
|
191
|
+
}, _callee5, null, [[7, 14]]);
|
|
184
192
|
}))();
|
|
185
193
|
}
|
|
186
194
|
};
|
|
@@ -18,14 +18,13 @@ var isWriteable = function isWriteable(link, source, target, linkType) {
|
|
|
18
18
|
|
|
19
19
|
export function getLinkPermission(edge, nodes, link) {
|
|
20
20
|
var source = nodes.find(function (node) {
|
|
21
|
-
return node.id === edge.
|
|
21
|
+
return node.id === edge.getSource().getTag();
|
|
22
22
|
});
|
|
23
23
|
var target = nodes.find(function (node) {
|
|
24
|
-
return node.id === edge.
|
|
24
|
+
return node.id === edge.getTarget().getTag();
|
|
25
25
|
}); // console.log("getLinkPermission", edge, source, target, link);
|
|
26
26
|
|
|
27
|
-
var linkType = link.attributes["network_link.connect_type"]
|
|
28
|
-
|
|
27
|
+
var linkType = link ? link.attributes["network_link.connect_type"] : edge.a("network_link.connect_type");
|
|
29
28
|
return {
|
|
30
29
|
readable: (source === null || source === void 0 ? void 0 : source.operation) || (target === null || target === void 0 ? void 0 : target.operation),
|
|
31
30
|
writeable: isWriteable(edge, source, target, linkType),
|
|
@@ -11,7 +11,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _NetworkTopoResourceSelectDrawer = _interopRequireDefault(require("../NetworkTopoResourceSelectDrawer"));
|
|
15
15
|
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
17
|
|
|
@@ -56,7 +56,7 @@ var MultiResourceDrawer = function MultiResourceDrawer(props) {
|
|
|
56
56
|
};
|
|
57
57
|
}();
|
|
58
58
|
|
|
59
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
59
|
+
return /*#__PURE__*/_react["default"].createElement(_NetworkTopoResourceSelectDrawer["default"], {
|
|
60
60
|
visible: visible,
|
|
61
61
|
getExcludeIds: getExcludeIds,
|
|
62
62
|
onOk: onDrawerSave,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports["default"] = NetworkTopoResourceSelectDrawer;
|
|
7
|
+
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _ResourceTypeLimit = require("../../constants/ResourceTypeLimit");
|
|
13
|
+
|
|
14
|
+
var _ResourceSelectDrawer = _interopRequireDefault(require("../ResourceSelectDrawer/ResourceSelectDrawer"));
|
|
15
|
+
|
|
16
|
+
function NetworkTopoResourceSelectDrawer(props) {
|
|
17
|
+
return /*#__PURE__*/_react["default"].createElement(_ResourceSelectDrawer["default"], (0, _extends2["default"])({
|
|
18
|
+
commonResListProps: (0, _ResourceTypeLimit.getNetworkTopoCommonResListProps)()
|
|
19
|
+
}, props));
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _NetworkTopoResourceSelectDrawer = _interopRequireDefault(require("./NetworkTopoResourceSelectDrawer"));
|
|
9
|
+
|
|
10
|
+
var _default = _NetworkTopoResourceSelectDrawer["default"];
|
|
11
|
+
exports["default"] = _default;
|
|
@@ -32,12 +32,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
32
32
|
*/
|
|
33
33
|
function ResourceSelectDrawer(props) {
|
|
34
34
|
var visible = props.visible,
|
|
35
|
+
title = props.title,
|
|
35
36
|
selectionMode = props.selectionMode,
|
|
36
37
|
limitTypes = props.limitTypes,
|
|
37
38
|
excludeIds = props.excludeIds,
|
|
38
39
|
getExcludeIds = props.getExcludeIds,
|
|
39
40
|
onOk = props.onOk,
|
|
40
|
-
onClose = props.onClose
|
|
41
|
+
onClose = props.onClose,
|
|
42
|
+
commonResListProps = props.commonResListProps;
|
|
41
43
|
var resourceSelectRef = (0, _react.useRef)();
|
|
42
44
|
|
|
43
45
|
var _useState = (0, _react.useState)(false),
|
|
@@ -101,7 +103,7 @@ function ResourceSelectDrawer(props) {
|
|
|
101
103
|
}
|
|
102
104
|
|
|
103
105
|
return /*#__PURE__*/_react["default"].createElement(_Drawer["default"], {
|
|
104
|
-
title:
|
|
106
|
+
title: title,
|
|
105
107
|
visible: visible,
|
|
106
108
|
loading: loading,
|
|
107
109
|
onSave: handleOk,
|
|
@@ -115,12 +117,14 @@ function ResourceSelectDrawer(props) {
|
|
|
115
117
|
ref: resourceSelectRef,
|
|
116
118
|
selectionMode: selectionMode,
|
|
117
119
|
limitTypes: limitTypes,
|
|
118
|
-
excludeIds: finalExcludeIds
|
|
120
|
+
excludeIds: finalExcludeIds,
|
|
121
|
+
commonResListProps: commonResListProps
|
|
119
122
|
}));
|
|
120
123
|
}
|
|
121
124
|
|
|
122
125
|
ResourceSelectDrawer.propTypes = {
|
|
123
126
|
visible: _propTypes["default"].bool,
|
|
127
|
+
title: _propTypes["default"].string,
|
|
124
128
|
limitTypes: _propTypes["default"].array,
|
|
125
129
|
excludeIds: _propTypes["default"].array,
|
|
126
130
|
selectionMode: _propTypes["default"].any,
|
|
@@ -129,6 +133,7 @@ ResourceSelectDrawer.propTypes = {
|
|
|
129
133
|
};
|
|
130
134
|
ResourceSelectDrawer.defaultProps = {
|
|
131
135
|
visible: true,
|
|
136
|
+
title: '添加资源',
|
|
132
137
|
excludeIds: [],
|
|
133
138
|
onOk: function onOk() {},
|
|
134
139
|
onClose: function onClose() {}
|
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
+
|
|
10
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
13
|
|
|
12
14
|
var _componentTopologyCommon = require("@riil-frontend/component-topology-common");
|
|
@@ -17,6 +19,8 @@ var _componentNoDataPage = _interopRequireDefault(require("@riil-frontend/compon
|
|
|
17
19
|
|
|
18
20
|
var _ResourceTypeLimit = require("../../constants/ResourceTypeLimit");
|
|
19
21
|
|
|
22
|
+
var _excluded = ["selectionMode", "limitTypes", "excludeIds", "commonResListProps"];
|
|
23
|
+
|
|
20
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
25
|
|
|
22
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -24,7 +28,9 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
24
28
|
function ResourceSelectList(props, ref) {
|
|
25
29
|
var selectionMode = props.selectionMode,
|
|
26
30
|
limitTypes = props.limitTypes,
|
|
27
|
-
excludeIds = props.excludeIds
|
|
31
|
+
excludeIds = props.excludeIds,
|
|
32
|
+
commonResListProps = props.commonResListProps,
|
|
33
|
+
otherProps = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
|
|
28
34
|
var tableProps = (0, _extends2["default"])({}, selectionMode ? {
|
|
29
35
|
rowSelection: {
|
|
30
36
|
mode: selectionMode
|
|
@@ -32,17 +38,16 @@ function ResourceSelectList(props, ref) {
|
|
|
32
38
|
} : {}, {
|
|
33
39
|
emptyContent: /*#__PURE__*/_react["default"].createElement(_componentNoDataPage["default"], null)
|
|
34
40
|
});
|
|
35
|
-
return /*#__PURE__*/_react["default"].createElement(_componentCommonResList["default"], {
|
|
41
|
+
return /*#__PURE__*/_react["default"].createElement(_componentCommonResList["default"], (0, _extends2["default"])({
|
|
36
42
|
ref: ref,
|
|
37
|
-
|
|
38
|
-
limitTypes: limitTypes || _ResourceTypeLimit.RESOURCE_LIMIT_TYPES,
|
|
43
|
+
limitTypes: limitTypes,
|
|
39
44
|
defaultCondition: excludeIds.length ? "!id('" + excludeIds.join('\',\'') + "')" : undefined,
|
|
40
45
|
request: (0, _componentTopologyCommon.getRequest)(),
|
|
41
46
|
tableProps: tableProps,
|
|
42
47
|
paginationProps: {
|
|
43
48
|
type: 'simple'
|
|
44
49
|
}
|
|
45
|
-
});
|
|
50
|
+
}, otherProps, commonResListProps || {}));
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
var _default = /*#__PURE__*/_react["default"].forwardRef(ResourceSelectList);
|
|
@@ -13,7 +13,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _NetworkTopoResourceSelectDrawer = _interopRequireDefault(require("../NetworkTopoResourceSelectDrawer"));
|
|
17
17
|
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
19
|
|
|
@@ -57,7 +57,7 @@ var SingleSelectDrawer = function SingleSelectDrawer(props) {
|
|
|
57
57
|
};
|
|
58
58
|
}();
|
|
59
59
|
|
|
60
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
60
|
+
return /*#__PURE__*/_react["default"].createElement(_NetworkTopoResourceSelectDrawer["default"], {
|
|
61
61
|
visible: visible,
|
|
62
62
|
excludeIds: totalSelection,
|
|
63
63
|
selectionMode: "single",
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.RESOURCE_LIMIT_TYPES = void 0;
|
|
5
|
-
|
|
4
|
+
exports.getNetworkTopoCommonResListProps = exports.filterCiTypes = exports.RESOURCE_LIMIT_TYPES = void 0;
|
|
5
|
+
|
|
6
|
+
var filterCiTypes = function filterCiTypes(tree) {
|
|
7
|
+
return tree.filter(function (item) {
|
|
8
|
+
return item.value !== 'data_center';
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.filterCiTypes = filterCiTypes;
|
|
13
|
+
|
|
14
|
+
var getNetworkTopoCommonResListProps = function getNetworkTopoCommonResListProps() {
|
|
15
|
+
return {
|
|
16
|
+
innerTreeFilters: ['monitorable', 'discoverable'],
|
|
17
|
+
filterCiRes: filterCiTypes
|
|
18
|
+
};
|
|
19
|
+
}; // 拓扑中心资源类型限制
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
exports.getNetworkTopoCommonResListProps = getNetworkTopoCommonResListProps;
|
|
6
23
|
var RESOURCE_LIMIT_TYPES = [// 网络设备
|
|
7
24
|
'common_network', 'switch', 'switch_cluster', 'router', // 操作系统
|
|
8
25
|
'linux', 'windows', // 数据库
|
|
@@ -11,7 +11,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _NetworkTopoResourceSelectDrawer = _interopRequireDefault(require("../../../../components/NetworkTopoResourceSelectDrawer"));
|
|
15
15
|
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
17
|
|
|
@@ -45,7 +45,7 @@ var GroupAddResourceDrawer = function GroupAddResourceDrawer(props) {
|
|
|
45
45
|
};
|
|
46
46
|
}();
|
|
47
47
|
|
|
48
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
48
|
+
return /*#__PURE__*/_react["default"].createElement(_NetworkTopoResourceSelectDrawer["default"], {
|
|
49
49
|
visible: visible,
|
|
50
50
|
getExcludeIds: topoEdit.getAllNodeResourceIds,
|
|
51
51
|
onOk: onOk,
|
|
@@ -64,7 +64,7 @@ function CommonEdgePropertyView(props) {
|
|
|
64
64
|
|
|
65
65
|
var getLinkByNodes = /*#__PURE__*/function () {
|
|
66
66
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(id) {
|
|
67
|
-
var result;
|
|
67
|
+
var result, hasLinkIds, axlink;
|
|
68
68
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
69
69
|
while (1) {
|
|
70
70
|
switch (_context.prev = _context.next) {
|
|
@@ -74,13 +74,21 @@ function CommonEdgePropertyView(props) {
|
|
|
74
74
|
|
|
75
75
|
case 2:
|
|
76
76
|
result = _context.sent;
|
|
77
|
+
hasLinkIds = topo.getLines().map(function (line) {
|
|
78
|
+
return line.id;
|
|
79
|
+
});
|
|
80
|
+
axlink = [];
|
|
81
|
+
result.data.map(function (exLink) {
|
|
82
|
+
if (hasLinkIds.indexOf(exLink.id) < 0) {
|
|
83
|
+
axlink.push(exLink);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
77
86
|
|
|
78
|
-
_rlog["default"].debug("出口链路列表", result.data);
|
|
87
|
+
_rlog["default"].debug("出口链路列表", result.data, axlink);
|
|
79
88
|
|
|
89
|
+
setAssociatedlinks(axlink);
|
|
80
90
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
case 5:
|
|
91
|
+
case 8:
|
|
84
92
|
case "end":
|
|
85
93
|
return _context.stop();
|
|
86
94
|
}
|
|
@@ -97,6 +105,8 @@ function CommonEdgePropertyView(props) {
|
|
|
97
105
|
autoUnmount: false,
|
|
98
106
|
values: parseValues(values, edge),
|
|
99
107
|
onChange: function onChange(name, value) {
|
|
108
|
+
_rlog["default"].debug("CommonEdgePropertyView", name, value);
|
|
109
|
+
|
|
100
110
|
var newValues = field.getValues();
|
|
101
111
|
|
|
102
112
|
_onChange(name, value, newValues);
|
|
@@ -121,14 +131,18 @@ function CommonEdgePropertyView(props) {
|
|
|
121
131
|
};
|
|
122
132
|
|
|
123
133
|
var bindExitLink = /*#__PURE__*/function () {
|
|
124
|
-
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(
|
|
125
|
-
var exitLink, aobj, config, exconfig, exportLinkIdList, _yield$editDispatcher, elements;
|
|
134
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(value) {
|
|
135
|
+
var data, exitLink, aobj, config, exconfig, exportLinkIdList, _yield$editDispatcher, elements;
|
|
126
136
|
|
|
127
137
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
128
138
|
while (1) {
|
|
129
139
|
switch (_context2.prev = _context2.next) {
|
|
130
140
|
case 0:
|
|
131
|
-
|
|
141
|
+
data = associatedlinks.find(function (link) {
|
|
142
|
+
return link.id === value;
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
_rlog["default"].debug("bindExitLink--- v, edge", data, edge);
|
|
132
146
|
|
|
133
147
|
exitLink = {
|
|
134
148
|
attributes: [],
|
|
@@ -160,16 +174,16 @@ function CommonEdgePropertyView(props) {
|
|
|
160
174
|
topo.resourceConfig.updateConfig((0, _extends2["default"])({}, config, {
|
|
161
175
|
exportLinkIdList: exportLinkIdList
|
|
162
176
|
}));
|
|
163
|
-
_context2.next =
|
|
177
|
+
_context2.next = 14;
|
|
164
178
|
return editDispatchers.fetchDataByConfig();
|
|
165
179
|
|
|
166
|
-
case
|
|
180
|
+
case 14:
|
|
167
181
|
_yield$editDispatcher = _context2.sent;
|
|
168
182
|
elements = _yield$editDispatcher.elements;
|
|
169
183
|
|
|
170
|
-
_rlog["default"].debug(
|
|
184
|
+
_rlog["default"].debug("fetchDataByConfig", elements);
|
|
171
185
|
|
|
172
|
-
case
|
|
186
|
+
case 17:
|
|
173
187
|
case "end":
|
|
174
188
|
return _context2.stop();
|
|
175
189
|
}
|
|
@@ -242,13 +256,14 @@ function CommonEdgePropertyView(props) {
|
|
|
242
256
|
style: {
|
|
243
257
|
width: 232
|
|
244
258
|
},
|
|
259
|
+
disabled: associatedlinks.length < 1,
|
|
245
260
|
onChange: function onChange(v) {
|
|
246
261
|
bindExitLink(v);
|
|
247
262
|
}
|
|
248
|
-
}, associatedlinks.map(function (
|
|
263
|
+
}, associatedlinks.map(function (item, index) {
|
|
249
264
|
return /*#__PURE__*/_react["default"].createElement(_select["default"].Option, {
|
|
250
|
-
value:
|
|
265
|
+
value: item.id,
|
|
251
266
|
key: index
|
|
252
|
-
},
|
|
267
|
+
}, item.attributes.display_name);
|
|
253
268
|
}))))))));
|
|
254
269
|
}
|
|
@@ -29,11 +29,7 @@ var propertyPanelMap = {
|
|
|
29
29
|
multiple: _MultipleElementPropertyView["default"]
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
if (localStorage.getItem('topo.debug') === 'true') {
|
|
33
|
-
Object.assign(propertyPanelMap, {
|
|
34
|
-
view: _ViewPropertyView["default"]
|
|
35
|
-
});
|
|
36
|
-
}
|
|
32
|
+
if (localStorage.getItem('topo.debug') === 'true') {}
|
|
37
33
|
|
|
38
34
|
var _default = propertyPanelMap;
|
|
39
35
|
exports["default"] = _default;
|
package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js
CHANGED
|
@@ -11,7 +11,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _NetworkTopoResourceSelectDrawer = _interopRequireDefault(require("../../../../../../../components/NetworkTopoResourceSelectDrawer"));
|
|
15
15
|
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
17
|
|
|
@@ -51,7 +51,7 @@ var LayerAddResourceDrawer = function LayerAddResourceDrawer(props) {
|
|
|
51
51
|
};
|
|
52
52
|
}();
|
|
53
53
|
|
|
54
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
54
|
+
return /*#__PURE__*/_react["default"].createElement(_NetworkTopoResourceSelectDrawer["default"], {
|
|
55
55
|
visible: visible,
|
|
56
56
|
getExcludeIds: topoEdit.getAllNodeResourceIds,
|
|
57
57
|
onOk: onOk,
|
|
@@ -13,7 +13,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _NetworkTopoResourceSelectDrawer = _interopRequireDefault(require("../../../../../../../components/NetworkTopoResourceSelectDrawer"));
|
|
17
17
|
|
|
18
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
19
|
|
|
@@ -73,8 +73,9 @@ var BindResourceDrawer = function BindResourceDrawer(props) {
|
|
|
73
73
|
};
|
|
74
74
|
}();
|
|
75
75
|
|
|
76
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
76
|
+
return /*#__PURE__*/_react["default"].createElement(_NetworkTopoResourceSelectDrawer["default"], {
|
|
77
77
|
visible: visible,
|
|
78
|
+
title: "\u5173\u8054\u8D44\u6E90",
|
|
78
79
|
getExcludeIds: topoEditApi.getAllNodeResourceIds,
|
|
79
80
|
selectionMode: "single",
|
|
80
81
|
onOk: handleSave,
|
|
@@ -48,7 +48,7 @@ var _PluginManager = _interopRequireDefault(require("./PluginManager"));
|
|
|
48
48
|
var _topoFactory = _interopRequireDefault(require("./topoFactory"));
|
|
49
49
|
|
|
50
50
|
// eslint-disable-next-line no-undef
|
|
51
|
-
var version = typeof "3.
|
|
51
|
+
var version = typeof "3.4.0" === 'string' ? "3.4.0" : null;
|
|
52
52
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
53
53
|
/**
|
|
54
54
|
* 拓扑显示和编辑
|
|
@@ -21,26 +21,25 @@ var _keyBy = _interopRequireDefault(require("lodash/keyBy"));
|
|
|
21
21
|
var _services = require("../../services");
|
|
22
22
|
|
|
23
23
|
var interfaceTypeMap = {
|
|
24
|
-
|
|
25
|
-
displayName:
|
|
24
|
+
"network.interface": {
|
|
25
|
+
displayName: "网络接口"
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
displayName:
|
|
27
|
+
"network.agg_interface": {
|
|
28
|
+
displayName: "聚合接口"
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
function isAggLink(link) {
|
|
33
|
-
return link.attributes[
|
|
33
|
+
return link.attributes["network_link.connect_type"] === "agg";
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function mergeLinksData(links, linkCis, nodes, interfaceCis) {
|
|
37
|
-
var linkCiMap = (0, _keyBy["default"])(linkCis,
|
|
37
|
+
var linkCiMap = (0, _keyBy["default"])(linkCis, "id");
|
|
38
38
|
return links.map(function (link) {
|
|
39
39
|
var _nodes$find, _nodes$find2, _interfaceCis$find, _interfaceCis$find2;
|
|
40
40
|
|
|
41
41
|
var linkCi = linkCiMap[link.id];
|
|
42
|
-
var attributes = (0, _extends2["default"])({}, linkCi === null || linkCi === void 0 ? void 0 : linkCi.attributes);
|
|
43
|
-
console.log('mergeLinksData', link, attributes); // 翻译
|
|
42
|
+
var attributes = (0, _extends2["default"])({}, linkCi === null || linkCi === void 0 ? void 0 : linkCi.attributes); // 翻译
|
|
44
43
|
|
|
45
44
|
return (0, _extends2["default"])({}, link, {
|
|
46
45
|
id: linkCi.id,
|
|
@@ -48,14 +47,14 @@ function mergeLinksData(links, linkCis, nodes, interfaceCis) {
|
|
|
48
47
|
name: linkCi === null || linkCi === void 0 ? void 0 : linkCi.attributes.name,
|
|
49
48
|
attributes: (0, _extends2["default"])({}, attributes, {
|
|
50
49
|
// 源/目的设备
|
|
51
|
-
|
|
50
|
+
"network_link.source_device_id_object": {
|
|
52
51
|
displayName: (_nodes$find = nodes.find(function (node) {
|
|
53
|
-
return node.id === attributes[
|
|
52
|
+
return node.id === attributes["network_link.source_device_id"];
|
|
54
53
|
})) === null || _nodes$find === void 0 ? void 0 : _nodes$find.name
|
|
55
54
|
},
|
|
56
|
-
|
|
55
|
+
"network_link.destination_device_id_object": {
|
|
57
56
|
displayName: (_nodes$find2 = nodes.find(function (node) {
|
|
58
|
-
return node.id === attributes[
|
|
57
|
+
return node.id === attributes["network_link.destination_device_id"];
|
|
59
58
|
})) === null || _nodes$find2 === void 0 ? void 0 : _nodes$find2.name
|
|
60
59
|
},
|
|
61
60
|
// 源/目的接口类型
|
|
@@ -65,12 +64,12 @@ function mergeLinksData(links, linkCis, nodes, interfaceCis) {
|
|
|
65
64
|
source_id_object: {
|
|
66
65
|
displayName: (_interfaceCis$find = interfaceCis.find(function (node) {
|
|
67
66
|
return node.id === attributes.source_id;
|
|
68
|
-
})) === null || _interfaceCis$find === void 0 ? void 0 : _interfaceCis$find.attributes[
|
|
67
|
+
})) === null || _interfaceCis$find === void 0 ? void 0 : _interfaceCis$find.attributes["display_name"]
|
|
69
68
|
},
|
|
70
69
|
destination_id_object: {
|
|
71
70
|
displayName: (_interfaceCis$find2 = interfaceCis.find(function (node) {
|
|
72
71
|
return node.id === attributes.destination_id;
|
|
73
|
-
})) === null || _interfaceCis$find2 === void 0 ? void 0 : _interfaceCis$find2.attributes[
|
|
72
|
+
})) === null || _interfaceCis$find2 === void 0 ? void 0 : _interfaceCis$find2.attributes["display_name"]
|
|
74
73
|
}
|
|
75
74
|
})
|
|
76
75
|
});
|