@riil-frontend/component-topology 7.0.0-dev.9 → 7.0.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 +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +31 -31
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -23
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +3 -2
- package/es/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +1 -2
- package/es/core/components/TopoView/GraphViewPanel.js +18 -2
- package/es/core/editor/components/Toolbar/buttons.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +10 -3
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +9 -2
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +7 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +21 -6
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
- package/es/core/editor/components/settings/PropertyView.js +11 -10
- package/es/core/editor/components/settings/Settings.js +8 -1
- package/es/core/editor/components/settings/core/PropertyViewManager.js +4 -3
- package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -7
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +4 -2
- package/es/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +15 -0
- package/es/core/hooks/usePolling.js +1 -6
- package/es/core/hooks/useTopoEdit.js +3 -1
- package/es/core/models/Alarm.js +12 -24
- package/es/core/models/AttributeMetricDisplay.js +24 -10
- package/es/core/models/TopoApp.js +5 -3
- package/es/core/models/attributeFormatter/index.js +4 -0
- package/es/core/models/utils/linkUtils.js +0 -3
- package/es/core/store/models/topoMod.js +7 -6
- package/es/core/utils/manageStatusUtil.js +4 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
- package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -11
- package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +5 -3
- package/es/networkTopo/getTopoData.js +16 -27
- package/es/networkTopo/index.js +2 -2
- package/es/networkTopo/services/alert.js +55 -0
- package/es/networkTopo/services/authorization.js +135 -0
- package/es/networkTopo/services/cmdb.js +897 -0
- package/es/networkTopo/services/index.js +2 -26
- package/es/networkTopo/services/mdc.js +74 -0
- package/es/networkTopo/services/metric.js +68 -0
- package/es/networkTopo/services/model.js +1283 -0
- package/es/networkTopo/services/risk.js +29 -0
- package/es/networkTopo/services/topo/auth.js +67 -0
- package/es/networkTopo/services/topo/basic.js +727 -0
- package/es/networkTopo/services/topo/blacklist.js +60 -0
- package/es/networkTopo/services/topo/ciInfo.js +69 -0
- package/es/networkTopo/services/topo/constants.js +1 -0
- package/es/networkTopo/services/topo/icon.js +131 -0
- package/es/networkTopo/services/topo/index.js +18 -0
- package/es/networkTopo/services/topo/networkLink.js +33 -0
- package/es/networkTopo/services/topo/relation.js +27 -0
- package/es/networkTopo/services/topo/resourceWebUrl.js +84 -0
- package/es/networkTopo/store/topoTreeMod.js +5 -1
- package/es/networkTopo/utils/storage.js +38 -0
- package/es/style.js +1 -1
- package/es/utils/topoData.js +6 -67
- package/es/utils/tree.js +1 -0
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +3 -24
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +3 -3
- package/lib/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +1 -2
- package/lib/core/components/TopoView/GraphViewPanel.js +22 -2
- package/lib/core/editor/components/Toolbar/buttons.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +10 -3
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +9 -3
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +8 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +21 -7
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
- package/lib/core/editor/components/settings/PropertyView.js +10 -10
- package/lib/core/editor/components/settings/Settings.js +9 -1
- package/lib/core/editor/components/settings/core/PropertyViewManager.js +4 -3
- package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -10
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +5 -3
- package/lib/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +23 -0
- package/lib/core/hooks/usePolling.js +1 -6
- package/lib/core/hooks/useTopoEdit.js +3 -1
- package/lib/core/models/Alarm.js +12 -24
- package/lib/core/models/AttributeMetricDisplay.js +25 -10
- package/lib/core/models/TopoApp.js +5 -3
- package/lib/core/models/attributeFormatter/index.js +4 -0
- package/lib/core/models/utils/linkUtils.js +0 -5
- package/lib/core/store/models/topoMod.js +9 -6
- package/lib/core/utils/manageStatusUtil.js +9 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
- package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +3 -11
- package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +5 -3
- package/lib/networkTopo/getTopoData.js +16 -28
- package/lib/networkTopo/index.js +4 -4
- package/lib/networkTopo/services/alert.js +66 -0
- package/lib/networkTopo/services/authorization.js +145 -0
- package/lib/networkTopo/services/cmdb.js +977 -0
- package/lib/networkTopo/services/index.js +3 -29
- package/lib/networkTopo/services/mdc.js +91 -0
- package/lib/networkTopo/services/metric.js +82 -0
- package/lib/networkTopo/services/model.js +1387 -0
- package/lib/networkTopo/services/risk.js +40 -0
- package/lib/networkTopo/services/topo/auth.js +79 -0
- package/lib/networkTopo/services/topo/basic.js +753 -0
- package/lib/networkTopo/services/topo/blacklist.js +72 -0
- package/lib/networkTopo/services/topo/ciInfo.js +82 -0
- package/lib/networkTopo/services/topo/constants.js +6 -0
- package/lib/networkTopo/services/topo/icon.js +144 -0
- package/lib/networkTopo/{components/editor/plugins/LayerConfigPlugin.js → services/topo/index.js} +33 -23
- package/lib/networkTopo/services/topo/networkLink.js +45 -0
- package/lib/networkTopo/services/topo/relation.js +39 -0
- package/lib/networkTopo/services/topo/resourceWebUrl.js +95 -0
- package/lib/networkTopo/store/topoTreeMod.js +5 -1
- package/lib/networkTopo/utils/storage.js +46 -0
- package/lib/style.js +1 -1
- package/lib/utils/topoData.js +7 -75
- package/lib/utils/tree.js +1 -0
- package/package.json +3 -3
- package/es/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +0 -122
- package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -10
- package/es/networkTopo/components/Topology.js +0 -28
- package/es/networkTopo/components/editor/plugins/LayerConfigPlugin.js +0 -22
- package/es/networkTopo/components/editor/propertyViews/LayerRelatedResourceList.js +0 -48
- package/es/networkTopo/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +0 -35
- package/es/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +0 -43
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +0 -39
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +0 -31
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +0 -37
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +0 -49
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/index.js +0 -2
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -630
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -4
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -458
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -104
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -55
- package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -187
- package/es/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +0 -178
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +0 -103
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +0 -65
- package/es/networkTopo/components/editor/useEditorProps.js +0 -32
- package/es/networkTopo/event/index.js +0 -6
- package/es/networkTopo/hooks/editor/useDeleteEdges.js +0 -200
- package/es/networkTopo/hooks/editor/useGroupSortResources.js +0 -16
- package/es/networkTopo/hooks/useTopoEdit.js +0 -26
- package/lib/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +0 -147
- package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -19
- package/lib/networkTopo/components/Topology.js +0 -40
- package/lib/networkTopo/components/editor/propertyViews/LayerRelatedResourceList.js +0 -63
- package/lib/networkTopo/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +0 -51
- package/lib/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +0 -60
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +0 -54
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +0 -42
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +0 -50
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Setting/index.js +0 -66
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/index.js +0 -11
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -661
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -12
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -486
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -120
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -60
- package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -207
- package/lib/networkTopo/components/editor/propertyViews/edge/link/BindExitLinkSelect.js +0 -205
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +0 -121
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +0 -65
- package/lib/networkTopo/components/editor/useEditorProps.js +0 -46
- package/lib/networkTopo/event/index.js +0 -11
- package/lib/networkTopo/hooks/editor/useDeleteEdges.js +0 -218
- package/lib/networkTopo/hooks/editor/useGroupSortResources.js +0 -21
- package/lib/networkTopo/hooks/useTopoEdit.js +0 -40
@@ -1,187 +0,0 @@
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
-
import topoService from "@riil-frontend/component-topology-common/es/services/topo";
|
4
|
-
import { request } from "@riil-frontend/component-topology-utils";
|
5
|
-
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
6
|
-
export default {
|
7
|
-
/**
|
8
|
-
* 查询端口列表
|
9
|
-
*
|
10
|
-
* @param {array} ciIds
|
11
|
-
*/
|
12
|
-
getPortsById: function getPortsById(id) {
|
13
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
14
|
-
var _result$id, result;
|
15
|
-
|
16
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
17
|
-
while (1) {
|
18
|
-
switch (_context.prev = _context.next) {
|
19
|
-
case 0:
|
20
|
-
_context.prev = 0;
|
21
|
-
_context.next = 3;
|
22
|
-
return request.post("/topo/v1/api/networkLink/devicesInterfaces", [id]);
|
23
|
-
|
24
|
-
case 3:
|
25
|
-
result = _context.sent;
|
26
|
-
rlog.debug("查询端口列表", id, result[id]);
|
27
|
-
return _context.abrupt("return", (_result$id = result[id]) !== null && _result$id !== void 0 ? _result$id : []);
|
28
|
-
|
29
|
-
case 8:
|
30
|
-
_context.prev = 8;
|
31
|
-
_context.t0 = _context["catch"](0);
|
32
|
-
rlog.error("查询端口列表", _context.t0);
|
33
|
-
|
34
|
-
case 11:
|
35
|
-
case "end":
|
36
|
-
return _context.stop();
|
37
|
-
}
|
38
|
-
}
|
39
|
-
}, _callee, null, [[0, 8]]);
|
40
|
-
}))();
|
41
|
-
},
|
42
|
-
|
43
|
-
/**
|
44
|
-
* 新建/编辑链路
|
45
|
-
*
|
46
|
-
* @param {array} ciIds
|
47
|
-
*/
|
48
|
-
addLink: function addLink(parm) {
|
49
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
50
|
-
var result;
|
51
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
52
|
-
while (1) {
|
53
|
-
switch (_context2.prev = _context2.next) {
|
54
|
-
case 0:
|
55
|
-
_context2.prev = 0;
|
56
|
-
_context2.next = 3;
|
57
|
-
return request.post("/topo/v1/api/networkLink", parm);
|
58
|
-
|
59
|
-
case 3:
|
60
|
-
result = _context2.sent;
|
61
|
-
return _context2.abrupt("return", result);
|
62
|
-
|
63
|
-
case 7:
|
64
|
-
_context2.prev = 7;
|
65
|
-
_context2.t0 = _context2["catch"](0);
|
66
|
-
rlog.error("新建链路", _context2.t0);
|
67
|
-
|
68
|
-
case 10:
|
69
|
-
case "end":
|
70
|
-
return _context2.stop();
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}, _callee2, null, [[0, 7]]);
|
74
|
-
}))();
|
75
|
-
},
|
76
|
-
|
77
|
-
/**
|
78
|
-
* 查询当前节点关联的链路
|
79
|
-
*
|
80
|
-
* @param {array} ciId
|
81
|
-
*/
|
82
|
-
queryLinksByNodeId: function queryLinksByNodeId(ciId) {
|
83
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
84
|
-
var condition, parm, jsonParm, result;
|
85
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
86
|
-
while (1) {
|
87
|
-
switch (_context3.prev = _context3.next) {
|
88
|
-
case 0:
|
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); // console.log("查询当前节点关联的链路", parm, jsonParm);
|
97
|
-
|
98
|
-
_context3.prev = 3;
|
99
|
-
_context3.next = 6;
|
100
|
-
return request.post("/mdc/v1/api/cmdb/commonQueryCiData", jsonParm);
|
101
|
-
|
102
|
-
case 6:
|
103
|
-
result = _context3.sent;
|
104
|
-
return _context3.abrupt("return", result);
|
105
|
-
|
106
|
-
case 10:
|
107
|
-
_context3.prev = 10;
|
108
|
-
_context3.t0 = _context3["catch"](3);
|
109
|
-
rlog.error("查询可关联链路", _context3.t0);
|
110
|
-
|
111
|
-
case 13:
|
112
|
-
case "end":
|
113
|
-
return _context3.stop();
|
114
|
-
}
|
115
|
-
}
|
116
|
-
}, _callee3, null, [[3, 10]]);
|
117
|
-
}))();
|
118
|
-
},
|
119
|
-
|
120
|
-
/**
|
121
|
-
* 新建/编辑链路
|
122
|
-
*
|
123
|
-
* @param {array} ciIds
|
124
|
-
*/
|
125
|
-
editLink: function editLink(parm) {
|
126
|
-
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
127
|
-
var result;
|
128
|
-
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
129
|
-
while (1) {
|
130
|
-
switch (_context4.prev = _context4.next) {
|
131
|
-
case 0:
|
132
|
-
_context4.prev = 0;
|
133
|
-
_context4.next = 3;
|
134
|
-
return request.put("/topo/v1/api/networkLink", parm);
|
135
|
-
|
136
|
-
case 3:
|
137
|
-
result = _context4.sent;
|
138
|
-
return _context4.abrupt("return", result);
|
139
|
-
|
140
|
-
case 7:
|
141
|
-
_context4.prev = 7;
|
142
|
-
_context4.t0 = _context4["catch"](0);
|
143
|
-
rlog.error("编辑链路", _context4.t0);
|
144
|
-
|
145
|
-
case 10:
|
146
|
-
case "end":
|
147
|
-
return _context4.stop();
|
148
|
-
}
|
149
|
-
}
|
150
|
-
}, _callee4, null, [[0, 7]]);
|
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
|
-
}))();
|
186
|
-
}
|
187
|
-
};
|
@@ -1,178 +0,0 @@
|
|
1
|
-
import _Form from "@alifd/next/es/form";
|
2
|
-
import _Select from "@alifd/next/es/select";
|
3
|
-
import _Loading from "@alifd/next/es/loading";
|
4
|
-
import _extends from "@babel/runtime/helpers/extends";
|
5
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
6
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
7
|
-
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
8
|
-
import React, { useEffect, useState } from "react";
|
9
|
-
import service from "../../../../../services/link";
|
10
|
-
export default function BindExitLinkSelect(props) {
|
11
|
-
var topo = props.topo,
|
12
|
-
edge = props.edge,
|
13
|
-
values = props.values,
|
14
|
-
onChange = props.onChange,
|
15
|
-
editorProps = props.editorProps;
|
16
|
-
var store = topo.store;
|
17
|
-
|
18
|
-
var _store$useModel = store.useModel("topoConfig"),
|
19
|
-
editState = _store$useModel[0],
|
20
|
-
editDispatchers = _store$useModel[1]; // 可关联出口链路
|
21
|
-
|
22
|
-
|
23
|
-
var _useState = useState([]),
|
24
|
-
associatedlinks = _useState[0],
|
25
|
-
setAssociatedlinks = _useState[1];
|
26
|
-
|
27
|
-
var _useState2 = useState(false),
|
28
|
-
loading = _useState2[0],
|
29
|
-
setLoading = _useState2[1]; // const [isLine, setIsLine] = useState(false);
|
30
|
-
|
31
|
-
|
32
|
-
var getLinkByNodes = /*#__PURE__*/function () {
|
33
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
|
34
|
-
var result, hasLinkIds, axlink;
|
35
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
36
|
-
while (1) {
|
37
|
-
switch (_context.prev = _context.next) {
|
38
|
-
case 0:
|
39
|
-
_context.next = 2;
|
40
|
-
return service.queryAssociatedlinks(id);
|
41
|
-
|
42
|
-
case 2:
|
43
|
-
result = _context.sent;
|
44
|
-
hasLinkIds = topo.getLines().map(function (line) {
|
45
|
-
return line.id;
|
46
|
-
});
|
47
|
-
axlink = [];
|
48
|
-
result.data.map(function (exLink) {
|
49
|
-
if (hasLinkIds.indexOf(exLink.id) < 0) {
|
50
|
-
axlink.push(exLink);
|
51
|
-
}
|
52
|
-
});
|
53
|
-
rlog.debug("出口链路列表", result.data, axlink);
|
54
|
-
setAssociatedlinks(axlink);
|
55
|
-
|
56
|
-
case 8:
|
57
|
-
case "end":
|
58
|
-
return _context.stop();
|
59
|
-
}
|
60
|
-
}
|
61
|
-
}, _callee);
|
62
|
-
}));
|
63
|
-
|
64
|
-
return function getLinkByNodes(_x) {
|
65
|
-
return _ref.apply(this, arguments);
|
66
|
-
};
|
67
|
-
}();
|
68
|
-
|
69
|
-
useEffect(function () {
|
70
|
-
// console.log(
|
71
|
-
// "CommonEdgePropertyView-edge",
|
72
|
-
// edge,
|
73
|
-
// edge.getSource().getTag(),
|
74
|
-
// edge.getTarget()
|
75
|
-
// );
|
76
|
-
var ids = [edge.getSource().getTag(), edge.getTarget().getTag()];
|
77
|
-
getLinkByNodes(ids);
|
78
|
-
}, [edge]);
|
79
|
-
|
80
|
-
var bindExitLink = /*#__PURE__*/function () {
|
81
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value) {
|
82
|
-
var data, exitLink, config, exconfig, exportLinkIdList, _yield$editDispatcher, elements, target, aobj;
|
83
|
-
|
84
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
85
|
-
while (1) {
|
86
|
-
switch (_context2.prev = _context2.next) {
|
87
|
-
case 0:
|
88
|
-
topo.historyManager.beginTransaction();
|
89
|
-
setLoading(true);
|
90
|
-
data = associatedlinks.find(function (link) {
|
91
|
-
return link.id === value;
|
92
|
-
});
|
93
|
-
rlog.debug("bindExitLink--- v, edge", data, edge);
|
94
|
-
exitLink = {
|
95
|
-
attributes: [],
|
96
|
-
ciType: "network_link",
|
97
|
-
dtype: "link",
|
98
|
-
id: data.id,
|
99
|
-
interfaceSource: data["network_link.source_device_id"],
|
100
|
-
interfaceTarget: data.attributes["network_link.destination_device_id"],
|
101
|
-
metrics: [],
|
102
|
-
name: data.attributes.name,
|
103
|
-
"network_link.destination_ipv4": data.attributes["network_link.destination_ipv4"],
|
104
|
-
operation: "delete",
|
105
|
-
source: data.attributes.source_id,
|
106
|
-
target: data.attributes.destination_id,
|
107
|
-
type: "link"
|
108
|
-
};
|
109
|
-
config = topo.resourceConfig.getConfigFromHt();
|
110
|
-
rlog.debug("getConfigFromHt", config, topo.resourceConfig);
|
111
|
-
exconfig = _extends({}, config);
|
112
|
-
exportLinkIdList = config.exportLinkIdList;
|
113
|
-
exportLinkIdList.push(data.id);
|
114
|
-
topo.resourceConfig.updateConfig(_extends({}, config, {
|
115
|
-
exportLinkIdList: exportLinkIdList
|
116
|
-
}));
|
117
|
-
_context2.next = 13;
|
118
|
-
return editDispatchers.fetchDataByConfig();
|
119
|
-
|
120
|
-
case 13:
|
121
|
-
_yield$editDispatcher = _context2.sent;
|
122
|
-
elements = _yield$editDispatcher.elements;
|
123
|
-
target = edge.getTarget();
|
124
|
-
|
125
|
-
if (target.getTag() === undefined) {
|
126
|
-
target.a("name", exitLink["network_link.destination_ipv4"]);
|
127
|
-
}
|
128
|
-
|
129
|
-
aobj = edge.getAttrObject();
|
130
|
-
edge.setAttrObject(_extends({}, aobj, exitLink));
|
131
|
-
edge.setTag(data.id); // console.log(
|
132
|
-
// "bindExitLink------------",
|
133
|
-
// target,
|
134
|
-
// target.getTag(),
|
135
|
-
// data["network_link.destination_ipv4"],
|
136
|
-
// exitLink
|
137
|
-
// );
|
138
|
-
|
139
|
-
rlog.debug("fetchDataByConfig", elements);
|
140
|
-
setLoading(false);
|
141
|
-
topo.historyManager.endTransaction();
|
142
|
-
|
143
|
-
case 23:
|
144
|
-
case "end":
|
145
|
-
return _context2.stop();
|
146
|
-
}
|
147
|
-
}
|
148
|
-
}, _callee2);
|
149
|
-
}));
|
150
|
-
|
151
|
-
return function bindExitLink(_x2) {
|
152
|
-
return _ref2.apply(this, arguments);
|
153
|
-
};
|
154
|
-
}();
|
155
|
-
|
156
|
-
return /*#__PURE__*/React.createElement(_Form.Item, {
|
157
|
-
label: "\u5173\u8054\u51FA\u53E3\u94FE\u8DEF",
|
158
|
-
style: {
|
159
|
-
marginBottom: 0
|
160
|
-
}
|
161
|
-
}, /*#__PURE__*/React.createElement(_Loading, {
|
162
|
-
visible: loading,
|
163
|
-
fullScreen: true
|
164
|
-
}), /*#__PURE__*/React.createElement(_Select, {
|
165
|
-
style: {
|
166
|
-
width: 232
|
167
|
-
},
|
168
|
-
disabled: associatedlinks.length < 1,
|
169
|
-
onChange: function onChange(v) {
|
170
|
-
bindExitLink(v);
|
171
|
-
}
|
172
|
-
}, associatedlinks.map(function (item, index) {
|
173
|
-
return /*#__PURE__*/React.createElement(_Select.Option, {
|
174
|
-
value: item.id,
|
175
|
-
key: index
|
176
|
-
}, item.attributes.display_name);
|
177
|
-
})));
|
178
|
-
}
|
@@ -1,103 +0,0 @@
|
|
1
|
-
import _Box from "@alifd/next/es/box";
|
2
|
-
import _Collapse from "@alifd/next/es/collapse";
|
3
|
-
import React, { useEffect } from "react";
|
4
|
-
import styles from "./LinkInfoPreview.module.scss";
|
5
|
-
import { formatMetric } from "../../../../../../core/models/attributeFormatter";
|
6
|
-
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
7
|
-
var CollapsePanel = _Collapse.Panel;
|
8
|
-
export default function LindInfoPreview(props) {
|
9
|
-
var topo = props.topo,
|
10
|
-
data = props.data;
|
11
|
-
var fields = [{
|
12
|
-
label: "链路名称",
|
13
|
-
name: "display_name"
|
14
|
-
}, {
|
15
|
-
label: "源节点名称",
|
16
|
-
name: "network_link.source_device_id"
|
17
|
-
}, {
|
18
|
-
label: "源节点IP",
|
19
|
-
name: "network_link.source_device_ipv4"
|
20
|
-
}, {
|
21
|
-
label: "源端口",
|
22
|
-
name: "source_id"
|
23
|
-
}, {
|
24
|
-
label: "源端IP",
|
25
|
-
name: "network_link.source_ipv4"
|
26
|
-
}, {
|
27
|
-
label: "目的节点名称",
|
28
|
-
name: "network_link.destination_device_id"
|
29
|
-
}, {
|
30
|
-
label: "目的节点IP",
|
31
|
-
name: "network_link.destination_device_ipv4"
|
32
|
-
}, {
|
33
|
-
label: "目的端口",
|
34
|
-
name: "destination_id"
|
35
|
-
}, {
|
36
|
-
label: "目的端IP",
|
37
|
-
name: "network_link.destination_ipv4"
|
38
|
-
}, {
|
39
|
-
label: "取值端口",
|
40
|
-
name: "network_link.value_port"
|
41
|
-
}, {
|
42
|
-
label: "实际带宽",
|
43
|
-
name: "network_link.actual_bandwidth"
|
44
|
-
}, {
|
45
|
-
label: "用途",
|
46
|
-
name: "use"
|
47
|
-
}];
|
48
|
-
|
49
|
-
var getValue = function getValue(name) {
|
50
|
-
var value; // console.log('LindInfoPreview-getValue',data,name)
|
51
|
-
|
52
|
-
if (data) {
|
53
|
-
if (data.attributes[name + "_object"]) {
|
54
|
-
value = data.attributes[name + "_object"].displayName;
|
55
|
-
} else {
|
56
|
-
value = data.attributes[name];
|
57
|
-
}
|
58
|
-
|
59
|
-
var attrMeta = topo.ciTyeCache.getCiType("network_link").attributeMap[name];
|
60
|
-
value = formatMetric(value, attrMeta);
|
61
|
-
|
62
|
-
if (name === "network_link.value_port") {
|
63
|
-
value = "源端口";
|
64
|
-
}
|
65
|
-
} else {
|
66
|
-
value = "-";
|
67
|
-
}
|
68
|
-
|
69
|
-
return value;
|
70
|
-
};
|
71
|
-
|
72
|
-
return fields.map(function (field) {
|
73
|
-
return /*#__PURE__*/React.createElement(_Box, {
|
74
|
-
key: field.name,
|
75
|
-
direction: "row",
|
76
|
-
spacing: 8,
|
77
|
-
className: styles.row
|
78
|
-
}, /*#__PURE__*/React.createElement(_Box, {
|
79
|
-
className: styles.label
|
80
|
-
}, field.label), /*#__PURE__*/React.createElement(_Box, {
|
81
|
-
className: field.name === "use" ? styles.uselabelValue : styles.labelValue,
|
82
|
-
flex: 1
|
83
|
-
}, getValue(field.name)));
|
84
|
-
}); // <Collapse
|
85
|
-
// defaultExpandedKeys={["相关资源"]}
|
86
|
-
// style={{ border: "none" }}
|
87
|
-
// className={styles.panelFullHeight}
|
88
|
-
// >
|
89
|
-
// <CollapsePanel key="相关资源" title="相关资源">
|
90
|
-
// {fields.map((field) => (
|
91
|
-
// <Box
|
92
|
-
// key={field.name}
|
93
|
-
// direction="row"
|
94
|
-
// spacing={12}
|
95
|
-
// className={styles.row}
|
96
|
-
// >
|
97
|
-
// <Box className={styles.label}>{field.label}</Box>
|
98
|
-
// <Box flex={1}>{getValue(field.name)}</Box>
|
99
|
-
// </Box>
|
100
|
-
// ))}
|
101
|
-
// </CollapsePanel>
|
102
|
-
// </Collapse>
|
103
|
-
}
|
package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
@import '~@alifd/next/variables.scss';
|
2
|
-
|
3
|
-
|
4
|
-
.row {
|
5
|
-
margin-bottom: 12px;
|
6
|
-
}
|
7
|
-
|
8
|
-
.label {
|
9
|
-
width: 74px;
|
10
|
-
text-align: right;
|
11
|
-
color: #78849C;
|
12
|
-
}
|
13
|
-
|
14
|
-
.labelValue {
|
15
|
-
max-width: 160px;
|
16
|
-
max-height: 200px;
|
17
|
-
overflow-x: hidden;
|
18
|
-
overflow-wrap: break-word;
|
19
|
-
}
|
20
|
-
|
21
|
-
.uselabelValue {
|
22
|
-
max-width: 160px;
|
23
|
-
max-height: 200px;
|
24
|
-
overflow-y: scroll;
|
25
|
-
overflow-x: hidden;
|
26
|
-
overflow-wrap: break-word;
|
27
|
-
|
28
|
-
}
|
29
|
-
|
30
|
-
|
31
|
-
.content {}
|
32
|
-
|
33
|
-
.footer {
|
34
|
-
position: absolute;
|
35
|
-
bottom: 0;
|
36
|
-
width: 100%;
|
37
|
-
border-top: 1px solid #e8e8e8;
|
38
|
-
padding: 10px 16px;
|
39
|
-
text-align: right;
|
40
|
-
left: 0;
|
41
|
-
background: #fff;
|
42
|
-
border-radius: 0 0 4px 4px;
|
43
|
-
|
44
|
-
& .button {
|
45
|
-
&:not(:first-child) {
|
46
|
-
margin-left: 8px;
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
|
52
|
-
.panelFullHeight {
|
53
|
-
height: 100%;
|
54
|
-
display: flex;
|
55
|
-
flex-direction: column;
|
56
|
-
padding-top: 12px;
|
57
|
-
padding-left: 16px;
|
58
|
-
|
59
|
-
:global {
|
60
|
-
.#{$css-prefix}collapse-panel-content {
|
61
|
-
flex: 1;
|
62
|
-
overflow: auto;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import _useGroupSortResources from "../../hooks/editor/useGroupSortResources";
|
3
|
-
import LayerConfigPlugin from "./plugins/LayerConfigPlugin";
|
4
|
-
import AddLinkDrawer from "./propertyViews/edge/addLinkDrawer/AddLinkDrawer";
|
5
|
-
import EdgePropertyView from "./propertyViews/edge/EdgePropertyView";
|
6
|
-
import LinkPropertyView from "./propertyViews/edge/LinkPropertyView";
|
7
|
-
import LayerRelatedResourceList from "./propertyViews/LayerRelatedResourceList";
|
8
|
-
export default function useEditorProps(props) {
|
9
|
-
var topo = props.topo,
|
10
|
-
customEditorProps = props.editorProps;
|
11
|
-
return _extends({
|
12
|
-
useGroupSortResources: function useGroupSortResources(nodes) {
|
13
|
-
return _useGroupSortResources(topo.store, nodes);
|
14
|
-
},
|
15
|
-
layerRelatedResourceList: LayerRelatedResourceList,
|
16
|
-
multipleElementPropertyViewProps: {
|
17
|
-
showElementAlign: true
|
18
|
-
},
|
19
|
-
// 连线属性面板
|
20
|
-
edgePropertyViews: {
|
21
|
-
edge: EdgePropertyView,
|
22
|
-
link: LinkPropertyView
|
23
|
-
},
|
24
|
-
getEdgePropertyViewType: function getEdgePropertyViewType(_ref) {
|
25
|
-
var edge = _ref.edge;
|
26
|
-
return edge.getTag() ? 'link' : null;
|
27
|
-
},
|
28
|
-
showLinkConfig: true,
|
29
|
-
// 是否显示链路相关配置
|
30
|
-
plugins: [LayerConfigPlugin, AddLinkDrawer]
|
31
|
-
}, customEditorProps);
|
32
|
-
}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
var TopoCenterEvent = function TopoCenterEvent() {};
|
2
|
-
|
3
|
-
TopoCenterEvent.TOPO_LINK_ENTER_CREATE_MODE = "topo_link_enter_create_mode";
|
4
|
-
TopoCenterEvent.TOPO_LINK_CREATED = "topo_link_created";
|
5
|
-
TopoCenterEvent.TOPO_LINK_SELECT_SOURCE_NODE = "topo_link_select_source_node";
|
6
|
-
export { TopoCenterEvent as default };
|