@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import topoService from "@riil-frontend/component-topology-common/es/services/topo";
|
|
4
|
-
import { request } from
|
|
4
|
+
import { request } from "@riil-frontend/component-topology-utils";
|
|
5
5
|
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
6
6
|
export default {
|
|
7
7
|
/**
|
|
@@ -75,45 +75,54 @@ export default {
|
|
|
75
75
|
},
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* 查询当前节点关联的链路
|
|
79
79
|
*
|
|
80
|
-
* @param {array}
|
|
80
|
+
* @param {array} ciId
|
|
81
81
|
*/
|
|
82
|
-
|
|
82
|
+
queryLinksByNodeId: function queryLinksByNodeId(ciId) {
|
|
83
83
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
84
|
-
var result;
|
|
84
|
+
var condition, parm, jsonParm, result;
|
|
85
85
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
86
86
|
while (1) {
|
|
87
87
|
switch (_context3.prev = _context3.next) {
|
|
88
88
|
case 0:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
condition = "type('network_link') && (network_link.source_device_id='" + ciId + "' || network_link.destination_device_id='" + ciId + "')";
|
|
90
|
+
parm = {
|
|
91
|
+
condition: condition,
|
|
92
|
+
sort: "name asc",
|
|
93
|
+
currentPage: 1,
|
|
94
|
+
pageSize: 9999
|
|
95
|
+
};
|
|
96
|
+
jsonParm = JSON.stringify(parm);
|
|
97
|
+
console.log("查询当前节点关联的链路", parm, jsonParm);
|
|
98
|
+
_context3.prev = 4;
|
|
99
|
+
_context3.next = 7;
|
|
100
|
+
return request.post("/mdc/v1/api/cmdb/commonQueryCiData", jsonParm);
|
|
92
101
|
|
|
93
|
-
case
|
|
102
|
+
case 7:
|
|
94
103
|
result = _context3.sent;
|
|
95
104
|
return _context3.abrupt("return", result);
|
|
96
105
|
|
|
97
|
-
case
|
|
98
|
-
_context3.prev =
|
|
99
|
-
_context3.t0 = _context3["catch"](
|
|
100
|
-
rlog.error("
|
|
106
|
+
case 11:
|
|
107
|
+
_context3.prev = 11;
|
|
108
|
+
_context3.t0 = _context3["catch"](4);
|
|
109
|
+
rlog.error("查询可关联链路", _context3.t0);
|
|
101
110
|
|
|
102
|
-
case
|
|
111
|
+
case 14:
|
|
103
112
|
case "end":
|
|
104
113
|
return _context3.stop();
|
|
105
114
|
}
|
|
106
115
|
}
|
|
107
|
-
}, _callee3, null, [[
|
|
116
|
+
}, _callee3, null, [[4, 11]]);
|
|
108
117
|
}))();
|
|
109
118
|
},
|
|
110
119
|
|
|
111
120
|
/**
|
|
112
|
-
*
|
|
121
|
+
* 新建/编辑链路
|
|
113
122
|
*
|
|
114
123
|
* @param {array} ciIds
|
|
115
124
|
*/
|
|
116
|
-
|
|
125
|
+
editLink: function editLink(parm) {
|
|
117
126
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
118
127
|
var result;
|
|
119
128
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
@@ -122,7 +131,7 @@ export default {
|
|
|
122
131
|
case 0:
|
|
123
132
|
_context4.prev = 0;
|
|
124
133
|
_context4.next = 3;
|
|
125
|
-
return request
|
|
134
|
+
return request.put("/topo/v1/api/networkLink", parm);
|
|
126
135
|
|
|
127
136
|
case 3:
|
|
128
137
|
result = _context4.sent;
|
|
@@ -131,7 +140,7 @@ export default {
|
|
|
131
140
|
case 7:
|
|
132
141
|
_context4.prev = 7;
|
|
133
142
|
_context4.t0 = _context4["catch"](0);
|
|
134
|
-
rlog.error("
|
|
143
|
+
rlog.error("编辑链路", _context4.t0);
|
|
135
144
|
|
|
136
145
|
case 10:
|
|
137
146
|
case "end":
|
|
@@ -140,5 +149,39 @@ export default {
|
|
|
140
149
|
}
|
|
141
150
|
}, _callee4, null, [[0, 7]]);
|
|
142
151
|
}))();
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* 删除链路
|
|
156
|
+
*
|
|
157
|
+
* @param {array} ciIds
|
|
158
|
+
*/
|
|
159
|
+
deleteLink: function deleteLink(id) {
|
|
160
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
161
|
+
var result;
|
|
162
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
163
|
+
while (1) {
|
|
164
|
+
switch (_context5.prev = _context5.next) {
|
|
165
|
+
case 0:
|
|
166
|
+
_context5.prev = 0;
|
|
167
|
+
_context5.next = 3;
|
|
168
|
+
return request["delete"]("/topo/v1/api/networkLink/{" + id + "}");
|
|
169
|
+
|
|
170
|
+
case 3:
|
|
171
|
+
result = _context5.sent;
|
|
172
|
+
return _context5.abrupt("return", result);
|
|
173
|
+
|
|
174
|
+
case 7:
|
|
175
|
+
_context5.prev = 7;
|
|
176
|
+
_context5.t0 = _context5["catch"](0);
|
|
177
|
+
rlog.error("删除链路", _context5.t0);
|
|
178
|
+
|
|
179
|
+
case 10:
|
|
180
|
+
case "end":
|
|
181
|
+
return _context5.stop();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}, _callee5, null, [[0, 7]]);
|
|
185
|
+
}))();
|
|
143
186
|
}
|
|
144
187
|
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import _Form from "@alifd/next/es/form";
|
|
2
|
+
import _Select from "@alifd/next/es/select";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
+
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
|
7
|
+
import React, { useEffect, useState } from "react";
|
|
8
|
+
import service from "../../../../../../topoCenter/services/link";
|
|
9
|
+
export default function BindExitLinkSelect(props) {
|
|
10
|
+
var topo = props.topo,
|
|
11
|
+
edge = props.edge,
|
|
12
|
+
values = props.values,
|
|
13
|
+
onChange = props.onChange,
|
|
14
|
+
editorProps = props.editorProps;
|
|
15
|
+
var store = topo.store;
|
|
16
|
+
|
|
17
|
+
var _store$useModel = store.useModel("topoConfig"),
|
|
18
|
+
editState = _store$useModel[0],
|
|
19
|
+
editDispatchers = _store$useModel[1]; // 可关联出口链路
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
var _useState = useState([]),
|
|
23
|
+
associatedlinks = _useState[0],
|
|
24
|
+
setAssociatedlinks = _useState[1]; // const [isLine, setIsLine] = useState(false);
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var getLinkByNodes = /*#__PURE__*/function () {
|
|
28
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
|
|
29
|
+
var result, hasLinkIds, axlink;
|
|
30
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
31
|
+
while (1) {
|
|
32
|
+
switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
_context.next = 2;
|
|
35
|
+
return service.queryAssociatedlinks(id);
|
|
36
|
+
|
|
37
|
+
case 2:
|
|
38
|
+
result = _context.sent;
|
|
39
|
+
hasLinkIds = topo.getLines().map(function (line) {
|
|
40
|
+
return line.id;
|
|
41
|
+
});
|
|
42
|
+
axlink = [];
|
|
43
|
+
result.data.map(function (exLink) {
|
|
44
|
+
if (hasLinkIds.indexOf(exLink.id) < 0) {
|
|
45
|
+
axlink.push(exLink);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
rlog.debug("出口链路列表", result.data, axlink);
|
|
49
|
+
setAssociatedlinks(axlink);
|
|
50
|
+
|
|
51
|
+
case 8:
|
|
52
|
+
case "end":
|
|
53
|
+
return _context.stop();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}, _callee);
|
|
57
|
+
}));
|
|
58
|
+
|
|
59
|
+
return function getLinkByNodes(_x) {
|
|
60
|
+
return _ref.apply(this, arguments);
|
|
61
|
+
};
|
|
62
|
+
}();
|
|
63
|
+
|
|
64
|
+
useEffect(function () {
|
|
65
|
+
console.log("CommonEdgePropertyView-edge", edge, edge.getSource().getTag(), edge.getTarget());
|
|
66
|
+
var ids = [edge.getSource().getTag(), edge.getTarget().getTag()];
|
|
67
|
+
getLinkByNodes(ids);
|
|
68
|
+
}, [edge]);
|
|
69
|
+
|
|
70
|
+
var bindExitLink = /*#__PURE__*/function () {
|
|
71
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value) {
|
|
72
|
+
var data, exitLink, config, exconfig, exportLinkIdList, _yield$editDispatcher, elements, target, aobj;
|
|
73
|
+
|
|
74
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
75
|
+
while (1) {
|
|
76
|
+
switch (_context2.prev = _context2.next) {
|
|
77
|
+
case 0:
|
|
78
|
+
data = associatedlinks.find(function (link) {
|
|
79
|
+
return link.id === value;
|
|
80
|
+
});
|
|
81
|
+
rlog.debug("bindExitLink--- v, edge", data, edge);
|
|
82
|
+
exitLink = {
|
|
83
|
+
attributes: [],
|
|
84
|
+
ciType: "network_link",
|
|
85
|
+
dtype: "link",
|
|
86
|
+
id: data.id,
|
|
87
|
+
interfaceSource: data["network_link.source_device_id"],
|
|
88
|
+
interfaceTarget: data.attributes["network_link.destination_device_id"],
|
|
89
|
+
metrics: [],
|
|
90
|
+
name: data.attributes.name,
|
|
91
|
+
"network_link.connect_type": "exit",
|
|
92
|
+
"network_link.destination_ipv4": data.attributes["network_link.destination_ipv4"],
|
|
93
|
+
operation: "delete",
|
|
94
|
+
connect_type: "exit",
|
|
95
|
+
source: data.attributes.source_id,
|
|
96
|
+
target: data.attributes.destination_id,
|
|
97
|
+
type: "link"
|
|
98
|
+
};
|
|
99
|
+
config = topo.resourceConfig.getConfigFromHt();
|
|
100
|
+
rlog.debug("getConfigFromHt", config, topo.resourceConfig);
|
|
101
|
+
exconfig = _extends({}, config);
|
|
102
|
+
exportLinkIdList = config.exportLinkIdList;
|
|
103
|
+
exportLinkIdList.push(data.id);
|
|
104
|
+
topo.resourceConfig.updateConfig(_extends({}, config, {
|
|
105
|
+
exportLinkIdList: exportLinkIdList
|
|
106
|
+
}));
|
|
107
|
+
_context2.next = 11;
|
|
108
|
+
return editDispatchers.fetchDataByConfig();
|
|
109
|
+
|
|
110
|
+
case 11:
|
|
111
|
+
_yield$editDispatcher = _context2.sent;
|
|
112
|
+
elements = _yield$editDispatcher.elements;
|
|
113
|
+
target = edge.getTarget();
|
|
114
|
+
|
|
115
|
+
if (target.getTag() === undefined) {
|
|
116
|
+
target.a("name", exitLink["network_link.destination_ipv4"]);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
aobj = edge.getAttrObject();
|
|
120
|
+
edge.setAttrObject(_extends({}, aobj, exitLink));
|
|
121
|
+
edge.setTag(data.id);
|
|
122
|
+
console.log("bindExitLink------------", target, target.getTag(), data["network_link.destination_ipv4"], exitLink);
|
|
123
|
+
rlog.debug("fetchDataByConfig", elements);
|
|
124
|
+
|
|
125
|
+
case 20:
|
|
126
|
+
case "end":
|
|
127
|
+
return _context2.stop();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}, _callee2);
|
|
131
|
+
}));
|
|
132
|
+
|
|
133
|
+
return function bindExitLink(_x2) {
|
|
134
|
+
return _ref2.apply(this, arguments);
|
|
135
|
+
};
|
|
136
|
+
}();
|
|
137
|
+
|
|
138
|
+
return /*#__PURE__*/React.createElement(_Form.Item, {
|
|
139
|
+
label: "\u5173\u8054\u51FA\u53E3\u94FE\u8DEF",
|
|
140
|
+
style: {
|
|
141
|
+
marginBottom: 0
|
|
142
|
+
}
|
|
143
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
|
144
|
+
style: {
|
|
145
|
+
width: 232
|
|
146
|
+
},
|
|
147
|
+
disabled: associatedlinks.length < 1,
|
|
148
|
+
onChange: function onChange(v) {
|
|
149
|
+
bindExitLink(v);
|
|
150
|
+
}
|
|
151
|
+
}, associatedlinks.map(function (item, index) {
|
|
152
|
+
return /*#__PURE__*/React.createElement(_Select.Option, {
|
|
153
|
+
value: item.id,
|
|
154
|
+
key: index
|
|
155
|
+
}, item.attributes.display_name);
|
|
156
|
+
})));
|
|
157
|
+
}
|
|
@@ -44,8 +44,7 @@ export default function LindInfoPreview(props) {
|
|
|
44
44
|
}];
|
|
45
45
|
|
|
46
46
|
var getValue = function getValue(name) {
|
|
47
|
-
var value;
|
|
48
|
-
console.log('LindInfoPreview-getValue', data, name);
|
|
47
|
+
var value; // console.log('LindInfoPreview-getValue',data,name)
|
|
49
48
|
|
|
50
49
|
if (data) {
|
|
51
50
|
if (data.attributes[name + "_object"]) {
|
|
@@ -6,7 +6,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
6
6
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
7
7
|
import { isAggLink } from "../../../core/models/utils/linkUtils";
|
|
8
8
|
import linkService from "../../services/link";
|
|
9
|
-
import { getLinkPermission } from "../../utils/
|
|
9
|
+
import { getLinkPermission } from "../../utils/resourcePermissionUtil";
|
|
10
10
|
/**
|
|
11
11
|
* 删除连线
|
|
12
12
|
*/
|
|
@@ -29,8 +29,7 @@ export default (function (_ref) {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
function checkLinkDeleteable(link) {
|
|
32
|
-
var
|
|
33
|
-
deleteable = _getLinkPermission.deleteable;
|
|
32
|
+
var deleteable = link.permission.deleteable;
|
|
34
33
|
|
|
35
34
|
if (deleteable) {
|
|
36
35
|
return deleteable;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
export function getNodePermission(node) {
|
|
3
|
+
return parseBasicPermission(node === null || node === void 0 ? void 0 : node.operation);
|
|
4
|
+
}
|
|
5
|
+
export function parseBasicPermission(operation) {
|
|
3
6
|
return {
|
|
4
|
-
readable: !!
|
|
5
|
-
writeable: ['write', 'delete'].includes(
|
|
6
|
-
deleteable: ['delete'].includes(
|
|
7
|
+
readable: !!operation,
|
|
8
|
+
writeable: ['write', 'delete'].includes(operation),
|
|
9
|
+
deleteable: ['delete'].includes(operation)
|
|
7
10
|
};
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
@@ -16,16 +19,16 @@ export function getNodePermission(node) {
|
|
|
16
19
|
*/
|
|
17
20
|
|
|
18
21
|
export function getLinkPermission(link, source, target) {
|
|
19
|
-
var linkType = link.attributes['network_link.connect_type'];
|
|
22
|
+
var linkType = link.attributes['network_link.connect_type']; // 出口链路使用权限中心配置
|
|
23
|
+
|
|
24
|
+
if (linkType === 'exit') {
|
|
25
|
+
return parseBasicPermission(link === null || link === void 0 ? void 0 : link.operation);
|
|
26
|
+
}
|
|
20
27
|
|
|
21
28
|
var isWriteable = function isWriteable() {
|
|
22
|
-
|
|
23
|
-
return ['write', 'delete'].indexOf(
|
|
24
|
-
}
|
|
25
|
-
return [source, target].filter(function (node) {
|
|
26
|
-
return ['write', 'delete'].indexOf(node === null || node === void 0 ? void 0 : node.operation) !== -1;
|
|
27
|
-
}).length === 2;
|
|
28
|
-
}
|
|
29
|
+
return [source, target].filter(function (node) {
|
|
30
|
+
return ['write', 'delete'].indexOf(node === null || node === void 0 ? void 0 : node.operation) !== -1;
|
|
31
|
+
}).length === 2;
|
|
29
32
|
};
|
|
30
33
|
|
|
31
34
|
return {
|
|
@@ -66,8 +69,11 @@ export function addTopoDataResourcePermission(data) {
|
|
|
66
69
|
var target = nodes.find(function (n) {
|
|
67
70
|
return n.id === link.target;
|
|
68
71
|
});
|
|
72
|
+
var permission = getLinkPermission(link, source, target);
|
|
69
73
|
return _extends({}, link, {
|
|
70
|
-
|
|
74
|
+
// 临时适配,待优化
|
|
75
|
+
operation: link.operation || (permission.readable ? 'read' : null),
|
|
76
|
+
permission: permission
|
|
71
77
|
});
|
|
72
78
|
});
|
|
73
79
|
};
|
package/es/utils/topoData.js
CHANGED
|
@@ -279,9 +279,9 @@ function buildGlobal(_ref2) {
|
|
|
279
279
|
|
|
280
280
|
if ((_result$config = result.config) !== null && _result$config !== void 0 && _result$config.enableLineFlow) {
|
|
281
281
|
edgeFlow = {
|
|
282
|
-
type:
|
|
282
|
+
type: "point",
|
|
283
283
|
// 必填,支持传送带drip、光点point、箭头arrow
|
|
284
|
-
direction:
|
|
284
|
+
direction: "from" // 流动方向,可为空,默认源到目的
|
|
285
285
|
|
|
286
286
|
};
|
|
287
287
|
}
|
|
@@ -290,7 +290,7 @@ function buildGlobal(_ref2) {
|
|
|
290
290
|
edgeFlow = {
|
|
291
291
|
type: globalConfig.edgeFlow,
|
|
292
292
|
// 必填,支持传送带drip、光点point、箭头arrow
|
|
293
|
-
direction: globalConfig.edgeFlowDirection ||
|
|
293
|
+
direction: globalConfig.edgeFlowDirection || "from" // 流动方向,可为空,默认源到目的
|
|
294
294
|
|
|
295
295
|
};
|
|
296
296
|
}
|
|
@@ -350,7 +350,7 @@ export var combTopoData = function combTopoData(_ref3) {
|
|
|
350
350
|
|
|
351
351
|
// rlog.debug("combTopoData-接收到数据", result, engine, globalConfig);
|
|
352
352
|
var config = _extends({
|
|
353
|
-
type:
|
|
353
|
+
type: "auto"
|
|
354
354
|
}, result.config); // global
|
|
355
355
|
|
|
356
356
|
|
|
@@ -449,9 +449,9 @@ export function getCiModSet(params) {
|
|
|
449
449
|
return getModSet(ciTypes);
|
|
450
450
|
}
|
|
451
451
|
/**
|
|
452
|
-
*
|
|
453
|
-
* @param {array} ciTypeCodes
|
|
454
|
-
* @returns
|
|
452
|
+
*
|
|
453
|
+
* @param {array} ciTypeCodes
|
|
454
|
+
* @returns
|
|
455
455
|
*/
|
|
456
456
|
|
|
457
457
|
|
|
@@ -461,12 +461,6 @@ export function getCiModSet(params) {
|
|
|
461
461
|
return ciTypeCodes.includes(item);
|
|
462
462
|
}).forEach(function (key) {
|
|
463
463
|
var ciTypeObj = ciTypeMap[key];
|
|
464
|
-
modSet[key] = {
|
|
465
|
-
name: ciTypeObj.displayName,
|
|
466
|
-
code: ciTypeObj.code,
|
|
467
|
-
icon: ciTypeObj.icon,
|
|
468
|
-
list: ciModfilter(ciTypeObj, globalConfig, "node", ciTypeObj.code)
|
|
469
|
-
};
|
|
470
464
|
|
|
471
465
|
if (key === "network_link") {
|
|
472
466
|
var linkKeyArr = [{
|
|
@@ -496,8 +490,16 @@ export function getCiModSet(params) {
|
|
|
496
490
|
|
|
497
491
|
return link.code;
|
|
498
492
|
});
|
|
493
|
+
} else {
|
|
494
|
+
modSet[key] = {
|
|
495
|
+
name: ciTypeObj.displayName,
|
|
496
|
+
code: ciTypeObj.code,
|
|
497
|
+
icon: ciTypeObj.icon,
|
|
498
|
+
list: ciModfilter(ciTypeObj, globalConfig, "node", ciTypeObj.code)
|
|
499
|
+
};
|
|
499
500
|
}
|
|
500
501
|
});
|
|
502
|
+
console.log("modSet--------------------", modSet);
|
|
501
503
|
return modSet;
|
|
502
504
|
}
|
|
503
505
|
|
|
@@ -27,117 +27,6 @@
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
:global {
|
|
34
|
-
.#{$css-prefix}loading-wrap {
|
|
35
|
-
height: 100%;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.layout-aside {
|
|
40
|
-
// padding: 12px;
|
|
41
|
-
height: 100%;
|
|
42
|
-
position: relative;
|
|
43
|
-
|
|
44
|
-
background: #ffffff;
|
|
45
|
-
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.08);
|
|
46
|
-
border-radius: 4px;
|
|
47
|
-
border: 1px solid #dcdee3;
|
|
48
|
-
padding: 12px;
|
|
49
|
-
background: $color-white;
|
|
50
|
-
box-shadow: $shadow-1;
|
|
51
|
-
|
|
52
|
-
overflow: auto;
|
|
53
|
-
border-radius: 4px;
|
|
54
|
-
|
|
55
|
-
.tree-tool {
|
|
56
|
-
width: 100%;
|
|
57
|
-
padding-bottom: 12px;
|
|
58
|
-
display: flex;
|
|
59
|
-
justify-content: space-between;
|
|
60
|
-
|
|
61
|
-
.tree-tool-search {
|
|
62
|
-
flex: 1;
|
|
63
|
-
|
|
64
|
-
:global {
|
|
65
|
-
.#{$css-prefix}select-trigger {
|
|
66
|
-
min-width: 70px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.#{$css-prefix}select {
|
|
70
|
-
margin-right: 4px;
|
|
71
|
-
|
|
72
|
-
.#{$css-prefix}input.#{$css-prefix}medium {
|
|
73
|
-
// width: 100%;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.#{$css-prefix}select-inner {
|
|
77
|
-
min-width: 70px !important;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.tree-tool-container {
|
|
84
|
-
margin-left: 4px;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.tree-tool-btn {
|
|
88
|
-
margin-left: 8px;
|
|
89
|
-
height: 28px;
|
|
90
|
-
width: 28px;
|
|
91
|
-
padding-left: 5px;
|
|
92
|
-
text-align: right;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.tree {
|
|
97
|
-
// height: 100%; // min-width: 208px;
|
|
98
|
-
width: 100%;
|
|
99
|
-
|
|
100
|
-
:global {
|
|
101
|
-
ul {
|
|
102
|
-
li {
|
|
103
|
-
:global {
|
|
104
|
-
.#{$css-prefix}tree-node-inner {
|
|
105
|
-
height: 28px;
|
|
106
|
-
|
|
107
|
-
.#{$css-prefix}tree-node-label-wrapper {
|
|
108
|
-
.#{$css-prefix}tree-node-label {
|
|
109
|
-
width: 100%;
|
|
110
|
-
|
|
111
|
-
.tree-node-label {
|
|
112
|
-
width: 100%;
|
|
113
|
-
overflow: hidden;
|
|
114
|
-
text-overflow: ellipsis;
|
|
115
|
-
white-space: nowrap;
|
|
116
|
-
|
|
117
|
-
span:nth-child(3) {
|
|
118
|
-
width: 20px;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.#{$css-prefix}node-block .#{$css-prefix}tree-node-inner {
|
|
126
|
-
|
|
127
|
-
.#{$css-prefix}disabled,
|
|
128
|
-
.#{$css-prefix}disabled:hover {
|
|
129
|
-
-webkit-text-fill-color: $color-text1-4;
|
|
130
|
-
cursor: not-allowed;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.empty {
|
|
140
|
-
padding-top: 50%;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
30
|
+
.empty {
|
|
31
|
+
background: transparent;
|
|
32
|
+
}
|
|
@@ -27,22 +27,17 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
27
27
|
|
|
28
28
|
function AlarmListPanel(props, ref) {
|
|
29
29
|
// 传入参数
|
|
30
|
-
var topo = props.topo
|
|
30
|
+
var topo = props.topo,
|
|
31
|
+
alarmData = props.alarmData,
|
|
32
|
+
onClose = props.onClose;
|
|
31
33
|
|
|
32
34
|
var _useState = (0, _react.useState)([]),
|
|
33
35
|
alarmList = _useState[0],
|
|
34
|
-
setAlarmList = _useState[1];
|
|
36
|
+
setAlarmList = _useState[1]; //const { alarmData } = alarmState;
|
|
37
|
+
// const onClose = () => {/* */
|
|
38
|
+
// topo.alarm.switchAlarmPopPanel(false);
|
|
39
|
+
// };
|
|
35
40
|
|
|
36
|
-
var _topo$store$useModel = topo.store.useModel("topoAlarm"),
|
|
37
|
-
alarmState = _topo$store$useModel[0],
|
|
38
|
-
alarmDispatchers = _topo$store$useModel[1];
|
|
39
|
-
|
|
40
|
-
var alarmData = alarmState.alarmData;
|
|
41
|
-
|
|
42
|
-
var onClose = function onClose() {
|
|
43
|
-
// console.log("AlarmListPanel-onClose", alarm);
|
|
44
|
-
topo.alarm.switchAlarmPopPanel(false);
|
|
45
|
-
};
|
|
46
41
|
|
|
47
42
|
(0, _react.useEffect)(function () {
|
|
48
43
|
if (alarmData) {
|
|
@@ -9,6 +9,8 @@ var _box = _interopRequireDefault(require("@alifd/next/lib/box"));
|
|
|
9
9
|
|
|
10
10
|
var _form = _interopRequireDefault(require("@alifd/next/lib/form"));
|
|
11
11
|
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
12
14
|
var _field = _interopRequireDefault(require("@alifd/next/lib/field"));
|
|
13
15
|
|
|
14
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -45,7 +47,9 @@ function DisplaySetting(props, ref) {
|
|
|
45
47
|
linkTipConfig = _ref.linkTipConfig,
|
|
46
48
|
showEdgeExpandConfig = _ref.showEdgeExpandConfig,
|
|
47
49
|
extraConfig = _ref.extraConfig,
|
|
48
|
-
showLinkConfig = _ref.showLinkConfig
|
|
50
|
+
showLinkConfig = _ref.showLinkConfig,
|
|
51
|
+
nodeTagProps = _ref.nodeTagProps,
|
|
52
|
+
nodeTipProps = _ref.nodeTipProps;
|
|
49
53
|
|
|
50
54
|
var field = _field["default"].useField({
|
|
51
55
|
autoUnmount: false,
|
|
@@ -74,10 +78,10 @@ function DisplaySetting(props, ref) {
|
|
|
74
78
|
label: "\u8D44\u6E90\u6807\u6CE8",
|
|
75
79
|
helpText: "\u6700\u591A\u652F\u6301\u52FE\u90093\u9879"
|
|
76
80
|
})
|
|
77
|
-
}, /*#__PURE__*/_react["default"].createElement(_NodeTag["default"], {
|
|
81
|
+
}, /*#__PURE__*/_react["default"].createElement(_NodeTag["default"], (0, _extends2["default"])({}, nodeTagProps, {
|
|
78
82
|
name: "nodeTag",
|
|
79
83
|
topo: topo
|
|
80
|
-
})), linkTagConfig && /*#__PURE__*/_react["default"].createElement(_form["default"].Item, {
|
|
84
|
+
}))), linkTagConfig && /*#__PURE__*/_react["default"].createElement(_form["default"].Item, {
|
|
81
85
|
label: /*#__PURE__*/_react["default"].createElement(Label, {
|
|
82
86
|
label: "\u94FE\u8DEF\u6807\u6CE8",
|
|
83
87
|
helpText: "\u6700\u591A\u652F\u6301\u52FE\u90092\u9879"
|
|
@@ -92,10 +96,10 @@ function DisplaySetting(props, ref) {
|
|
|
92
96
|
helpText: "\u6700\u591A\u652F\u6301\u52FE\u90094\u9879"
|
|
93
97
|
}),
|
|
94
98
|
patternTrigger: "onChange"
|
|
95
|
-
}, /*#__PURE__*/_react["default"].createElement(_NodeTip["default"], {
|
|
99
|
+
}, /*#__PURE__*/_react["default"].createElement(_NodeTip["default"], (0, _extends2["default"])({}, nodeTipProps, {
|
|
96
100
|
name: "nodeTip",
|
|
97
101
|
topo: topo
|
|
98
|
-
})), linkTipConfig && /*#__PURE__*/_react["default"].createElement(_form["default"].Item, {
|
|
102
|
+
}))), linkTipConfig && /*#__PURE__*/_react["default"].createElement(_form["default"].Item, {
|
|
99
103
|
label: /*#__PURE__*/_react["default"].createElement(Label, {
|
|
100
104
|
label: "\u94FE\u8DEF\u60AC\u6D6E\u6846",
|
|
101
105
|
helpText: "\u6700\u591A\u652F\u6301\u52FE\u90094\u9879"
|