@riil-frontend/component-topology 3.5.0-a.9 → 3.5.2
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 +12 -12
- package/es/components/index.module.scss +3 -114
- package/es/core/components/AlarmListPanel/index.js +7 -12
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +8 -5
- package/es/core/components/DisplaySettingDrawer/NodeTag.js +10 -5
- package/es/core/components/DisplaySettingDrawer/NodeTip.js +10 -5
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +3 -21
- package/es/core/components/TopoView/topoView.js +1 -0
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -140
- package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +1 -1
- package/es/core/editor/components/settings/propertyViews/node/Setting/Setting.js +1 -1
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +18 -17
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +62 -18
- package/es/core/models/Alarm.js +206 -120
- package/es/core/models/DataModel.js +15 -1
- package/es/core/models/TopoApp.js +4 -6
- package/es/core/models/cache/CiTyeCache.js +4 -0
- package/es/core/models/utils/linkUtils.js +87 -42
- package/es/core/services/index.js +28 -0
- package/es/core/utils/saveSerialize.js +34 -0
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +0 -37
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +31 -28
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +44 -43
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +39 -26
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useCiData.js +0 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +143 -0
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +37 -0
- package/es/core/viewer/components/titlebar/BasicTools.js +11 -1
- package/es/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +21 -13
- package/es/hooks/useGraphAlarmDisplay.js +3 -4
- package/es/hooks/useManageStatus.js +1 -1
- package/es/hooks/useTopoEdit.js +200 -144
- package/es/hooks/useTopoEventListener.js +13 -6
- package/es/index.js +3 -2
- package/es/models/topoConfig.js +0 -1
- package/es/models/topoMod.js +15 -10
- package/es/topoCenter/components/Topo404.js +3 -1
- package/es/topoCenter/components/TopoNoPermission.js +3 -1
- package/es/topoCenter/components/TopoView.js +77 -32
- package/es/topoCenter/components/Topology.js +2 -0
- package/es/topoCenter/components/editor/propertyViews/edge/EdgePropertyView.js +10 -0
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +5 -20
- package/es/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +12 -6
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +84 -43
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +60 -34
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +9 -0
- package/es/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/server.js +62 -19
- package/es/topoCenter/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +157 -0
- package/es/topoCenter/components/editor/propertyViews/edge/link/LinkInfoPreview.js +1 -2
- package/es/topoCenter/hooks/editor/useDeleteEdges.js +2 -3
- package/es/topoCenter/utils/resourcePermissionUtil.js +18 -12
- package/es/utils/topoData.js +15 -13
- package/lib/components/index.module.scss +3 -114
- package/lib/core/components/AlarmListPanel/index.js +7 -12
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +9 -5
- package/lib/core/components/DisplaySettingDrawer/NodeTag.js +11 -5
- package/lib/core/components/DisplaySettingDrawer/NodeTip.js +12 -5
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +3 -21
- package/lib/core/components/TopoView/topoView.js +1 -0
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -151
- package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +2 -2
- package/lib/core/editor/components/settings/propertyViews/node/Setting/Setting.js +1 -1
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -16
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +66 -20
- package/lib/core/models/Alarm.js +206 -121
- package/lib/core/models/DataModel.js +15 -1
- package/lib/core/models/TopoApp.js +4 -6
- package/lib/core/models/cache/CiTyeCache.js +4 -0
- package/lib/core/models/utils/linkUtils.js +92 -43
- package/lib/core/services/index.js +29 -0
- package/lib/core/utils/saveSerialize.js +43 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetail.js +0 -37
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/BaseInfo.js +29 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +45 -43
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverviewMetric.js +38 -24
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useCiData.js +1 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +155 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +47 -0
- package/lib/core/viewer/components/titlebar/BasicTools.js +11 -1
- package/lib/core/viewer/components/titlebar/widgets/AlarmListShowButton.js +22 -15
- package/lib/hooks/useGraphAlarmDisplay.js +3 -5
- package/lib/hooks/useManageStatus.js +1 -1
- package/lib/hooks/useTopoEdit.js +197 -141
- package/lib/hooks/useTopoEventListener.js +13 -6
- package/lib/index.js +5 -0
- package/lib/models/topoConfig.js +0 -1
- package/lib/models/topoMod.js +15 -10
- package/lib/topoCenter/components/Topo404.js +4 -1
- package/lib/topoCenter/components/TopoNoPermission.js +4 -1
- package/lib/topoCenter/components/TopoView.js +78 -33
- package/lib/topoCenter/components/Topology.js +3 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/EdgePropertyView.js +22 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +5 -21
- package/lib/topoCenter/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +13 -8
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +87 -42
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +61 -37
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +9 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/addLinkDrawer/server.js +62 -18
- package/lib/topoCenter/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +183 -0
- package/lib/topoCenter/components/editor/propertyViews/edge/link/LinkInfoPreview.js +1 -2
- package/lib/topoCenter/hooks/editor/useDeleteEdges.js +2 -3
- package/lib/topoCenter/utils/resourcePermissionUtil.js +20 -12
- package/lib/utils/topoData.js +15 -13
- package/package.json +5 -5
|
@@ -91,46 +91,55 @@ var _default = {
|
|
|
91
91
|
},
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
94
|
+
* 查询当前节点关联的链路
|
|
95
95
|
*
|
|
96
|
-
* @param {array}
|
|
96
|
+
* @param {array} ciId
|
|
97
97
|
*/
|
|
98
|
-
|
|
98
|
+
queryLinksByNodeId: function queryLinksByNodeId(ciId) {
|
|
99
99
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
100
|
-
var result;
|
|
100
|
+
var condition, parm, jsonParm, result;
|
|
101
101
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
102
102
|
while (1) {
|
|
103
103
|
switch (_context3.prev = _context3.next) {
|
|
104
104
|
case 0:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
condition = "type('network_link') && (network_link.source_device_id='" + ciId + "' || network_link.destination_device_id='" + ciId + "')";
|
|
106
|
+
parm = {
|
|
107
|
+
condition: condition,
|
|
108
|
+
sort: "name asc",
|
|
109
|
+
currentPage: 1,
|
|
110
|
+
pageSize: 9999
|
|
111
|
+
};
|
|
112
|
+
jsonParm = JSON.stringify(parm);
|
|
113
|
+
console.log("查询当前节点关联的链路", parm, jsonParm);
|
|
114
|
+
_context3.prev = 4;
|
|
115
|
+
_context3.next = 7;
|
|
116
|
+
return _componentTopologyUtils.request.post("/mdc/v1/api/cmdb/commonQueryCiData", jsonParm);
|
|
108
117
|
|
|
109
|
-
case
|
|
118
|
+
case 7:
|
|
110
119
|
result = _context3.sent;
|
|
111
120
|
return _context3.abrupt("return", result);
|
|
112
121
|
|
|
113
|
-
case
|
|
114
|
-
_context3.prev =
|
|
115
|
-
_context3.t0 = _context3["catch"](
|
|
122
|
+
case 11:
|
|
123
|
+
_context3.prev = 11;
|
|
124
|
+
_context3.t0 = _context3["catch"](4);
|
|
116
125
|
|
|
117
|
-
_rlog["default"].error("
|
|
126
|
+
_rlog["default"].error("查询可关联链路", _context3.t0);
|
|
118
127
|
|
|
119
|
-
case
|
|
128
|
+
case 14:
|
|
120
129
|
case "end":
|
|
121
130
|
return _context3.stop();
|
|
122
131
|
}
|
|
123
132
|
}
|
|
124
|
-
}, _callee3, null, [[
|
|
133
|
+
}, _callee3, null, [[4, 11]]);
|
|
125
134
|
}))();
|
|
126
135
|
},
|
|
127
136
|
|
|
128
137
|
/**
|
|
129
|
-
*
|
|
138
|
+
* 新建/编辑链路
|
|
130
139
|
*
|
|
131
140
|
* @param {array} ciIds
|
|
132
141
|
*/
|
|
133
|
-
|
|
142
|
+
editLink: function editLink(parm) {
|
|
134
143
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
135
144
|
var result;
|
|
136
145
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
@@ -139,7 +148,7 @@ var _default = {
|
|
|
139
148
|
case 0:
|
|
140
149
|
_context4.prev = 0;
|
|
141
150
|
_context4.next = 3;
|
|
142
|
-
return _componentTopologyUtils.request
|
|
151
|
+
return _componentTopologyUtils.request.put("/topo/v1/api/networkLink", parm);
|
|
143
152
|
|
|
144
153
|
case 3:
|
|
145
154
|
result = _context4.sent;
|
|
@@ -149,7 +158,7 @@ var _default = {
|
|
|
149
158
|
_context4.prev = 7;
|
|
150
159
|
_context4.t0 = _context4["catch"](0);
|
|
151
160
|
|
|
152
|
-
_rlog["default"].error("
|
|
161
|
+
_rlog["default"].error("编辑链路", _context4.t0);
|
|
153
162
|
|
|
154
163
|
case 10:
|
|
155
164
|
case "end":
|
|
@@ -158,6 +167,41 @@ var _default = {
|
|
|
158
167
|
}
|
|
159
168
|
}, _callee4, null, [[0, 7]]);
|
|
160
169
|
}))();
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 删除链路
|
|
174
|
+
*
|
|
175
|
+
* @param {array} ciIds
|
|
176
|
+
*/
|
|
177
|
+
deleteLink: function deleteLink(id) {
|
|
178
|
+
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
179
|
+
var result;
|
|
180
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
181
|
+
while (1) {
|
|
182
|
+
switch (_context5.prev = _context5.next) {
|
|
183
|
+
case 0:
|
|
184
|
+
_context5.prev = 0;
|
|
185
|
+
_context5.next = 3;
|
|
186
|
+
return _componentTopologyUtils.request["delete"]("/topo/v1/api/networkLink/{" + id + "}");
|
|
187
|
+
|
|
188
|
+
case 3:
|
|
189
|
+
result = _context5.sent;
|
|
190
|
+
return _context5.abrupt("return", result);
|
|
191
|
+
|
|
192
|
+
case 7:
|
|
193
|
+
_context5.prev = 7;
|
|
194
|
+
_context5.t0 = _context5["catch"](0);
|
|
195
|
+
|
|
196
|
+
_rlog["default"].error("删除链路", _context5.t0);
|
|
197
|
+
|
|
198
|
+
case 10:
|
|
199
|
+
case "end":
|
|
200
|
+
return _context5.stop();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}, _callee5, null, [[0, 7]]);
|
|
204
|
+
}))();
|
|
161
205
|
}
|
|
162
206
|
};
|
|
163
207
|
exports["default"] = _default;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
exports["default"] = BindExitLinkSelect;
|
|
7
|
+
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
|
|
10
|
+
var _form = _interopRequireDefault(require("@alifd/next/lib/form"));
|
|
11
|
+
|
|
12
|
+
var _select = _interopRequireDefault(require("@alifd/next/lib/select"));
|
|
13
|
+
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
|
|
16
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
|
+
|
|
18
|
+
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
|
19
|
+
|
|
20
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
+
|
|
22
|
+
var _link = _interopRequireDefault(require("../../../../../../topoCenter/services/link"));
|
|
23
|
+
|
|
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); }
|
|
25
|
+
|
|
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; }
|
|
27
|
+
|
|
28
|
+
function BindExitLinkSelect(props) {
|
|
29
|
+
var topo = props.topo,
|
|
30
|
+
edge = props.edge,
|
|
31
|
+
values = props.values,
|
|
32
|
+
onChange = props.onChange,
|
|
33
|
+
editorProps = props.editorProps;
|
|
34
|
+
var store = topo.store;
|
|
35
|
+
|
|
36
|
+
var _store$useModel = store.useModel("topoConfig"),
|
|
37
|
+
editState = _store$useModel[0],
|
|
38
|
+
editDispatchers = _store$useModel[1]; // 可关联出口链路
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
var _useState = (0, _react.useState)([]),
|
|
42
|
+
associatedlinks = _useState[0],
|
|
43
|
+
setAssociatedlinks = _useState[1]; // const [isLine, setIsLine] = useState(false);
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
var getLinkByNodes = /*#__PURE__*/function () {
|
|
47
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(id) {
|
|
48
|
+
var result, hasLinkIds, axlink;
|
|
49
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
50
|
+
while (1) {
|
|
51
|
+
switch (_context.prev = _context.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
_context.next = 2;
|
|
54
|
+
return _link["default"].queryAssociatedlinks(id);
|
|
55
|
+
|
|
56
|
+
case 2:
|
|
57
|
+
result = _context.sent;
|
|
58
|
+
hasLinkIds = topo.getLines().map(function (line) {
|
|
59
|
+
return line.id;
|
|
60
|
+
});
|
|
61
|
+
axlink = [];
|
|
62
|
+
result.data.map(function (exLink) {
|
|
63
|
+
if (hasLinkIds.indexOf(exLink.id) < 0) {
|
|
64
|
+
axlink.push(exLink);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
_rlog["default"].debug("出口链路列表", result.data, axlink);
|
|
69
|
+
|
|
70
|
+
setAssociatedlinks(axlink);
|
|
71
|
+
|
|
72
|
+
case 8:
|
|
73
|
+
case "end":
|
|
74
|
+
return _context.stop();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}, _callee);
|
|
78
|
+
}));
|
|
79
|
+
|
|
80
|
+
return function getLinkByNodes(_x) {
|
|
81
|
+
return _ref.apply(this, arguments);
|
|
82
|
+
};
|
|
83
|
+
}();
|
|
84
|
+
|
|
85
|
+
(0, _react.useEffect)(function () {
|
|
86
|
+
console.log("CommonEdgePropertyView-edge", edge, edge.getSource().getTag(), edge.getTarget());
|
|
87
|
+
var ids = [edge.getSource().getTag(), edge.getTarget().getTag()];
|
|
88
|
+
getLinkByNodes(ids);
|
|
89
|
+
}, [edge]);
|
|
90
|
+
|
|
91
|
+
var bindExitLink = /*#__PURE__*/function () {
|
|
92
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(value) {
|
|
93
|
+
var data, exitLink, config, exconfig, exportLinkIdList, _yield$editDispatcher, elements, target, aobj;
|
|
94
|
+
|
|
95
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
96
|
+
while (1) {
|
|
97
|
+
switch (_context2.prev = _context2.next) {
|
|
98
|
+
case 0:
|
|
99
|
+
data = associatedlinks.find(function (link) {
|
|
100
|
+
return link.id === value;
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
_rlog["default"].debug("bindExitLink--- v, edge", data, edge);
|
|
104
|
+
|
|
105
|
+
exitLink = {
|
|
106
|
+
attributes: [],
|
|
107
|
+
ciType: "network_link",
|
|
108
|
+
dtype: "link",
|
|
109
|
+
id: data.id,
|
|
110
|
+
interfaceSource: data["network_link.source_device_id"],
|
|
111
|
+
interfaceTarget: data.attributes["network_link.destination_device_id"],
|
|
112
|
+
metrics: [],
|
|
113
|
+
name: data.attributes.name,
|
|
114
|
+
"network_link.connect_type": "exit",
|
|
115
|
+
"network_link.destination_ipv4": data.attributes["network_link.destination_ipv4"],
|
|
116
|
+
operation: "delete",
|
|
117
|
+
connect_type: "exit",
|
|
118
|
+
source: data.attributes.source_id,
|
|
119
|
+
target: data.attributes.destination_id,
|
|
120
|
+
type: "link"
|
|
121
|
+
};
|
|
122
|
+
config = topo.resourceConfig.getConfigFromHt();
|
|
123
|
+
|
|
124
|
+
_rlog["default"].debug("getConfigFromHt", config, topo.resourceConfig);
|
|
125
|
+
|
|
126
|
+
exconfig = (0, _extends2["default"])({}, config);
|
|
127
|
+
exportLinkIdList = config.exportLinkIdList;
|
|
128
|
+
exportLinkIdList.push(data.id);
|
|
129
|
+
topo.resourceConfig.updateConfig((0, _extends2["default"])({}, config, {
|
|
130
|
+
exportLinkIdList: exportLinkIdList
|
|
131
|
+
}));
|
|
132
|
+
_context2.next = 11;
|
|
133
|
+
return editDispatchers.fetchDataByConfig();
|
|
134
|
+
|
|
135
|
+
case 11:
|
|
136
|
+
_yield$editDispatcher = _context2.sent;
|
|
137
|
+
elements = _yield$editDispatcher.elements;
|
|
138
|
+
target = edge.getTarget();
|
|
139
|
+
|
|
140
|
+
if (target.getTag() === undefined) {
|
|
141
|
+
target.a("name", exitLink["network_link.destination_ipv4"]);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
aobj = edge.getAttrObject();
|
|
145
|
+
edge.setAttrObject((0, _extends2["default"])({}, aobj, exitLink));
|
|
146
|
+
edge.setTag(data.id);
|
|
147
|
+
console.log("bindExitLink------------", target, target.getTag(), data["network_link.destination_ipv4"], exitLink);
|
|
148
|
+
|
|
149
|
+
_rlog["default"].debug("fetchDataByConfig", elements);
|
|
150
|
+
|
|
151
|
+
case 20:
|
|
152
|
+
case "end":
|
|
153
|
+
return _context2.stop();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}, _callee2);
|
|
157
|
+
}));
|
|
158
|
+
|
|
159
|
+
return function bindExitLink(_x2) {
|
|
160
|
+
return _ref2.apply(this, arguments);
|
|
161
|
+
};
|
|
162
|
+
}();
|
|
163
|
+
|
|
164
|
+
return /*#__PURE__*/_react["default"].createElement(_form["default"].Item, {
|
|
165
|
+
label: "\u5173\u8054\u51FA\u53E3\u94FE\u8DEF",
|
|
166
|
+
style: {
|
|
167
|
+
marginBottom: 0
|
|
168
|
+
}
|
|
169
|
+
}, /*#__PURE__*/_react["default"].createElement(_select["default"], {
|
|
170
|
+
style: {
|
|
171
|
+
width: 232
|
|
172
|
+
},
|
|
173
|
+
disabled: associatedlinks.length < 1,
|
|
174
|
+
onChange: function onChange(v) {
|
|
175
|
+
bindExitLink(v);
|
|
176
|
+
}
|
|
177
|
+
}, associatedlinks.map(function (item, index) {
|
|
178
|
+
return /*#__PURE__*/_react["default"].createElement(_select["default"].Option, {
|
|
179
|
+
value: item.id,
|
|
180
|
+
key: index
|
|
181
|
+
}, item.attributes.display_name);
|
|
182
|
+
})));
|
|
183
|
+
}
|
|
@@ -62,8 +62,7 @@ function LindInfoPreview(props) {
|
|
|
62
62
|
}];
|
|
63
63
|
|
|
64
64
|
var getValue = function getValue(name) {
|
|
65
|
-
var value;
|
|
66
|
-
console.log('LindInfoPreview-getValue', data, name);
|
|
65
|
+
var value; // console.log('LindInfoPreview-getValue',data,name)
|
|
67
66
|
|
|
68
67
|
if (data) {
|
|
69
68
|
if (data.attributes[name + "_object"]) {
|
|
@@ -21,7 +21,7 @@ var _linkUtils = require("../../../core/models/utils/linkUtils");
|
|
|
21
21
|
|
|
22
22
|
var _link = _interopRequireDefault(require("../../services/link"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _resourcePermissionUtil = require("../../utils/resourcePermissionUtil");
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* 删除连线
|
|
@@ -44,8 +44,7 @@ var _default = function _default(_ref) {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
function checkLinkDeleteable(link) {
|
|
47
|
-
var
|
|
48
|
-
deleteable = _getLinkPermission.deleteable;
|
|
47
|
+
var deleteable = link.permission.deleteable;
|
|
49
48
|
|
|
50
49
|
if (deleteable) {
|
|
51
50
|
return deleteable;
|
|
@@ -7,14 +7,19 @@ exports.addTopoDataResourcePermission = addTopoDataResourcePermission;
|
|
|
7
7
|
exports.getLinkPermission = getLinkPermission;
|
|
8
8
|
exports.getLinkPermissionByConnectType = getLinkPermissionByConnectType;
|
|
9
9
|
exports.getNodePermission = getNodePermission;
|
|
10
|
+
exports.parseBasicPermission = parseBasicPermission;
|
|
10
11
|
|
|
11
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
13
|
|
|
13
14
|
function getNodePermission(node) {
|
|
15
|
+
return parseBasicPermission(node === null || node === void 0 ? void 0 : node.operation);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function parseBasicPermission(operation) {
|
|
14
19
|
return {
|
|
15
|
-
readable: !!
|
|
16
|
-
writeable: ['write', 'delete'].includes(
|
|
17
|
-
deleteable: ['delete'].includes(
|
|
20
|
+
readable: !!operation,
|
|
21
|
+
writeable: ['write', 'delete'].includes(operation),
|
|
22
|
+
deleteable: ['delete'].includes(operation)
|
|
18
23
|
};
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
@@ -28,16 +33,16 @@ function getNodePermission(node) {
|
|
|
28
33
|
|
|
29
34
|
|
|
30
35
|
function getLinkPermission(link, source, target) {
|
|
31
|
-
var linkType = link.attributes['network_link.connect_type'];
|
|
36
|
+
var linkType = link.attributes['network_link.connect_type']; // 出口链路使用权限中心配置
|
|
37
|
+
|
|
38
|
+
if (linkType === 'exit') {
|
|
39
|
+
return parseBasicPermission(link === null || link === void 0 ? void 0 : link.operation);
|
|
40
|
+
}
|
|
32
41
|
|
|
33
42
|
var isWriteable = function isWriteable() {
|
|
34
|
-
|
|
35
|
-
return ['write', 'delete'].indexOf(
|
|
36
|
-
}
|
|
37
|
-
return [source, target].filter(function (node) {
|
|
38
|
-
return ['write', 'delete'].indexOf(node === null || node === void 0 ? void 0 : node.operation) !== -1;
|
|
39
|
-
}).length === 2;
|
|
40
|
-
}
|
|
43
|
+
return [source, target].filter(function (node) {
|
|
44
|
+
return ['write', 'delete'].indexOf(node === null || node === void 0 ? void 0 : node.operation) !== -1;
|
|
45
|
+
}).length === 2;
|
|
41
46
|
};
|
|
42
47
|
|
|
43
48
|
return {
|
|
@@ -80,8 +85,11 @@ function addTopoDataResourcePermission(data) {
|
|
|
80
85
|
var target = nodes.find(function (n) {
|
|
81
86
|
return n.id === link.target;
|
|
82
87
|
});
|
|
88
|
+
var permission = getLinkPermission(link, source, target);
|
|
83
89
|
return (0, _extends2["default"])({}, link, {
|
|
84
|
-
|
|
90
|
+
// 临时适配,待优化
|
|
91
|
+
operation: link.operation || (permission.readable ? 'read' : null),
|
|
92
|
+
permission: permission
|
|
85
93
|
});
|
|
86
94
|
});
|
|
87
95
|
};
|
package/lib/utils/topoData.js
CHANGED
|
@@ -321,9 +321,9 @@ function buildGlobal(_ref2) {
|
|
|
321
321
|
|
|
322
322
|
if ((_result$config = result.config) !== null && _result$config !== void 0 && _result$config.enableLineFlow) {
|
|
323
323
|
edgeFlow = {
|
|
324
|
-
type:
|
|
324
|
+
type: "point",
|
|
325
325
|
// 必填,支持传送带drip、光点point、箭头arrow
|
|
326
|
-
direction:
|
|
326
|
+
direction: "from" // 流动方向,可为空,默认源到目的
|
|
327
327
|
|
|
328
328
|
};
|
|
329
329
|
}
|
|
@@ -332,7 +332,7 @@ function buildGlobal(_ref2) {
|
|
|
332
332
|
edgeFlow = {
|
|
333
333
|
type: globalConfig.edgeFlow,
|
|
334
334
|
// 必填,支持传送带drip、光点point、箭头arrow
|
|
335
|
-
direction: globalConfig.edgeFlowDirection ||
|
|
335
|
+
direction: globalConfig.edgeFlowDirection || "from" // 流动方向,可为空,默认源到目的
|
|
336
336
|
|
|
337
337
|
};
|
|
338
338
|
}
|
|
@@ -391,7 +391,7 @@ var combTopoData = function combTopoData(_ref3) {
|
|
|
391
391
|
engine = _ref3.engine;
|
|
392
392
|
// rlog.debug("combTopoData-接收到数据", result, engine, globalConfig);
|
|
393
393
|
var config = (0, _extends2["default"])({
|
|
394
|
-
type:
|
|
394
|
+
type: "auto"
|
|
395
395
|
}, result.config); // global
|
|
396
396
|
|
|
397
397
|
var global = buildGlobal({
|
|
@@ -490,9 +490,9 @@ function getCiModSet(params) {
|
|
|
490
490
|
return getModSet(ciTypes);
|
|
491
491
|
}
|
|
492
492
|
/**
|
|
493
|
-
*
|
|
494
|
-
* @param {array} ciTypeCodes
|
|
495
|
-
* @returns
|
|
493
|
+
*
|
|
494
|
+
* @param {array} ciTypeCodes
|
|
495
|
+
* @returns
|
|
496
496
|
*/
|
|
497
497
|
|
|
498
498
|
|
|
@@ -502,12 +502,6 @@ function getCiModSet(params) {
|
|
|
502
502
|
return ciTypeCodes.includes(item);
|
|
503
503
|
}).forEach(function (key) {
|
|
504
504
|
var ciTypeObj = ciTypeMap[key];
|
|
505
|
-
modSet[key] = {
|
|
506
|
-
name: ciTypeObj.displayName,
|
|
507
|
-
code: ciTypeObj.code,
|
|
508
|
-
icon: ciTypeObj.icon,
|
|
509
|
-
list: ciModfilter(ciTypeObj, globalConfig, "node", ciTypeObj.code)
|
|
510
|
-
};
|
|
511
505
|
|
|
512
506
|
if (key === "network_link") {
|
|
513
507
|
var linkKeyArr = [{
|
|
@@ -537,8 +531,16 @@ function getCiModSet(params) {
|
|
|
537
531
|
|
|
538
532
|
return link.code;
|
|
539
533
|
});
|
|
534
|
+
} else {
|
|
535
|
+
modSet[key] = {
|
|
536
|
+
name: ciTypeObj.displayName,
|
|
537
|
+
code: ciTypeObj.code,
|
|
538
|
+
icon: ciTypeObj.icon,
|
|
539
|
+
list: ciModfilter(ciTypeObj, globalConfig, "node", ciTypeObj.code)
|
|
540
|
+
};
|
|
540
541
|
}
|
|
541
542
|
});
|
|
543
|
+
console.log("modSet--------------------", modSet);
|
|
542
544
|
return modSet;
|
|
543
545
|
}
|
|
544
546
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riil-frontend/component-topology",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2",
|
|
4
4
|
"description": "拓扑",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "build-scripts start",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@ahooksjs/use-tree-plugin": "^0.2.1",
|
|
42
42
|
"@alifd/biz-anchor": "^1.1.7",
|
|
43
43
|
"@ice/store": "^1.4.2",
|
|
44
|
-
"@riil-frontend/component-topo-icon-select": "^1.0.
|
|
44
|
+
"@riil-frontend/component-topo-icon-select": "^1.0.16",
|
|
45
45
|
"@riil-frontend/component-topology-utils": "^2.0.20-alpha.0",
|
|
46
46
|
"classnames": "^2.2.3",
|
|
47
47
|
"prop-types": "^15.5.8",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"@riil-frontend/component-row-delete-ballon": "^1.0.2",
|
|
68
68
|
"@riil-frontend/component-table-filter-tags": "latest",
|
|
69
69
|
"@riil-frontend/component-table-layout": "^2.0.2",
|
|
70
|
-
"@riil-frontend/component-topology-common": "^1.
|
|
71
|
-
"@riil-frontend/component-topology-graph": "^2.7.0-a.
|
|
70
|
+
"@riil-frontend/component-topology-common": "^1.1.1",
|
|
71
|
+
"@riil-frontend/component-topology-graph": "^2.7.0-a.5",
|
|
72
72
|
"@riil-frontend/css": "^2.0.2",
|
|
73
73
|
"@riil-frontend/hooks": "latest",
|
|
74
74
|
"@riil-frontend/next-collapse": "^1.0.1-a.0",
|
|
@@ -110,6 +110,6 @@
|
|
|
110
110
|
"access": "public"
|
|
111
111
|
},
|
|
112
112
|
"license": "MIT",
|
|
113
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@3.5.
|
|
113
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@3.5.2/build/index.html",
|
|
114
114
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
|
115
115
|
}
|