@riil-frontend/component-topology 7.0.0-dev.2 → 7.0.0-dev.20
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/TopoView/topoView.js +2 -19
- package/es/core/components/titlebar/index.js +2 -1
- package/es/core/editor/components/EditorPlugin.js +1 -2
- package/es/core/editor/components/Toolbar/buttons.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -3
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
- 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 +6 -3
- package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/es/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +10 -0
- package/es/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/es/core/hooks/usePolling.js +1 -6
- package/es/core/hooks/useTopoEdit.js +134 -170
- package/es/core/models/Alarm.js +12 -24
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/topoData.js +3 -3
- package/es/core/models/utils/linkUtils.js +0 -3
- package/es/core/store/models/topoConfig.js +7 -5
- package/es/core/store/models/topoMod.js +8 -7
- package/es/core/utils/saveSerialize.js +2 -3
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
- 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/BasicTools.js +3 -16
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +25 -0
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -2
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +7 -9
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +42 -16
- package/es/networkTopo/components/editor/useEditorProps.js +4 -5
- package/es/networkTopo/getTopoData.js +18 -30
- package/es/networkTopo/hooks/editor/useDeleteEdges.js +6 -3
- 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/utils/storage.js +38 -0
- package/es/style.js +21 -21
- package/es/utils/tree.js +1 -0
- package/lib/core/components/TopoView/topoView.js +2 -20
- package/lib/core/components/titlebar/index.js +5 -1
- package/lib/core/editor/components/EditorPlugin.js +1 -3
- package/lib/core/editor/components/Toolbar/buttons.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -4
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
- 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 +7 -4
- package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
- package/lib/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +18 -0
- package/lib/core/editor/hooks/useKeyboardShortcut.js +1 -1
- package/lib/core/hooks/usePolling.js +1 -6
- package/lib/core/hooks/useTopoEdit.js +134 -170
- package/lib/core/models/Alarm.js +12 -24
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/topoData.js +7 -11
- package/lib/core/models/utils/linkUtils.js +0 -5
- package/lib/core/store/models/topoConfig.js +7 -5
- package/lib/core/store/models/topoMod.js +10 -7
- package/lib/core/utils/saveSerialize.js +1 -3
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
- 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/BasicTools.js +3 -17
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +36 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -2
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +7 -9
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +42 -16
- package/lib/networkTopo/components/editor/useEditorProps.js +4 -6
- package/lib/networkTopo/getTopoData.js +19 -33
- package/lib/networkTopo/hooks/editor/useDeleteEdges.js +6 -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/services/topo/index.js +42 -0
- 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/utils/storage.js +46 -0
- package/lib/style.js +21 -21
- package/lib/utils/tree.js +1 -0
- package/package.json +3 -3
- package/es/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -15
- package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -10
- 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/event/index.js +0 -6
- package/lib/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -25
- package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -19
- 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/event/index.js +0 -11
@@ -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,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 };
|
@@ -1,25 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
exports.__esModule = true;
|
6
|
-
exports["default"] = MultipleResourceSelectPlugin;
|
7
|
-
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
|
-
var _MultiResourceDrawer = _interopRequireDefault(require("../../../../components/MultiResourceDrawer"));
|
11
|
-
|
12
|
-
function MultipleResourceSelectPlugin(props) {
|
13
|
-
var topoEdit = props.topoEdit;
|
14
|
-
return /*#__PURE__*/_react["default"].createElement(_MultiResourceDrawer["default"], {
|
15
|
-
visible: topoEdit.showComboResDrawer,
|
16
|
-
loading: topoEdit.topoLoading,
|
17
|
-
initialData: topoEdit.initialComboRes,
|
18
|
-
getExcludeIds: topoEdit.getAllNodeResourceIds,
|
19
|
-
mode: topoEdit.getAddResourceDrawerMode(),
|
20
|
-
onSave: topoEdit.onSaveComboRes,
|
21
|
-
onClose: topoEdit.onCloseComboResDrawer
|
22
|
-
});
|
23
|
-
}
|
24
|
-
|
25
|
-
;
|
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
|
5
|
-
exports.__esModule = true;
|
6
|
-
exports["default"] = addEdgeProps;
|
7
|
-
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
-
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
11
|
-
|
12
|
-
function addEdgeProps(Component) {
|
13
|
-
return function AdapterEdgeProps(props) {
|
14
|
-
var selectionElement = props.selectionElement;
|
15
|
-
return /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({}, props, {
|
16
|
-
edge: selectionElement
|
17
|
-
}));
|
18
|
-
};
|
19
|
-
}
|