@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.
Files changed (143) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +31 -31
  5. package/es/core/components/TopoView/topoView.js +2 -19
  6. package/es/core/components/titlebar/index.js +2 -1
  7. package/es/core/editor/components/EditorPlugin.js +1 -2
  8. package/es/core/editor/components/Toolbar/buttons.js +2 -2
  9. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -3
  10. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
  11. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
  12. package/es/core/editor/components/settings/PropertyView.js +11 -10
  13. package/es/core/editor/components/settings/Settings.js +8 -1
  14. package/es/core/editor/components/settings/core/PropertyViewManager.js +4 -3
  15. package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -7
  16. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +6 -3
  17. package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
  18. package/es/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +10 -0
  19. package/es/core/editor/hooks/useKeyboardShortcut.js +1 -1
  20. package/es/core/hooks/usePolling.js +1 -6
  21. package/es/core/hooks/useTopoEdit.js +134 -170
  22. package/es/core/models/Alarm.js +12 -24
  23. package/es/core/models/TopoApp.js +1 -1
  24. package/es/core/models/topoData.js +3 -3
  25. package/es/core/models/utils/linkUtils.js +0 -3
  26. package/es/core/store/models/topoConfig.js +7 -5
  27. package/es/core/store/models/topoMod.js +8 -7
  28. package/es/core/utils/saveSerialize.js +2 -3
  29. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
  30. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -25
  31. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
  32. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
  33. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
  34. package/es/core/viewer/components/titlebar/BasicTools.js +3 -16
  35. package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +25 -0
  36. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -2
  37. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +7 -9
  38. package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +42 -16
  39. package/es/networkTopo/components/editor/useEditorProps.js +4 -5
  40. package/es/networkTopo/getTopoData.js +18 -30
  41. package/es/networkTopo/hooks/editor/useDeleteEdges.js +6 -3
  42. package/es/networkTopo/services/alert.js +55 -0
  43. package/es/networkTopo/services/authorization.js +135 -0
  44. package/es/networkTopo/services/cmdb.js +897 -0
  45. package/es/networkTopo/services/index.js +2 -26
  46. package/es/networkTopo/services/mdc.js +74 -0
  47. package/es/networkTopo/services/metric.js +68 -0
  48. package/es/networkTopo/services/model.js +1283 -0
  49. package/es/networkTopo/services/risk.js +29 -0
  50. package/es/networkTopo/services/topo/auth.js +67 -0
  51. package/es/networkTopo/services/topo/basic.js +727 -0
  52. package/es/networkTopo/services/topo/blacklist.js +60 -0
  53. package/es/networkTopo/services/topo/ciInfo.js +69 -0
  54. package/es/networkTopo/services/topo/constants.js +1 -0
  55. package/es/networkTopo/services/topo/icon.js +131 -0
  56. package/es/networkTopo/services/topo/index.js +18 -0
  57. package/es/networkTopo/services/topo/networkLink.js +33 -0
  58. package/es/networkTopo/services/topo/relation.js +27 -0
  59. package/es/networkTopo/services/topo/resourceWebUrl.js +84 -0
  60. package/es/networkTopo/utils/storage.js +38 -0
  61. package/es/style.js +21 -21
  62. package/es/utils/tree.js +1 -0
  63. package/lib/core/components/TopoView/topoView.js +2 -20
  64. package/lib/core/components/titlebar/index.js +5 -1
  65. package/lib/core/editor/components/EditorPlugin.js +1 -3
  66. package/lib/core/editor/components/Toolbar/buttons.js +2 -2
  67. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +11 -4
  68. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +6 -1
  69. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
  70. package/lib/core/editor/components/settings/PropertyView.js +10 -10
  71. package/lib/core/editor/components/settings/Settings.js +9 -1
  72. package/lib/core/editor/components/settings/core/PropertyViewManager.js +4 -3
  73. package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -10
  74. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +7 -4
  75. package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +4 -2
  76. package/lib/core/editor/components/settings/propertyViews/node/data/PlatformDisplay.js +18 -0
  77. package/lib/core/editor/hooks/useKeyboardShortcut.js +1 -1
  78. package/lib/core/hooks/usePolling.js +1 -6
  79. package/lib/core/hooks/useTopoEdit.js +134 -170
  80. package/lib/core/models/Alarm.js +12 -24
  81. package/lib/core/models/TopoApp.js +1 -1
  82. package/lib/core/models/topoData.js +7 -11
  83. package/lib/core/models/utils/linkUtils.js +0 -5
  84. package/lib/core/store/models/topoConfig.js +7 -5
  85. package/lib/core/store/models/topoMod.js +10 -7
  86. package/lib/core/utils/saveSerialize.js +1 -3
  87. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +13 -2
  88. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -26
  89. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +4 -0
  90. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +17 -17
  91. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
  92. package/lib/core/viewer/components/titlebar/BasicTools.js +3 -17
  93. package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +36 -0
  94. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/Data/index.js +8 -2
  95. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +7 -9
  96. package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.js +42 -16
  97. package/lib/networkTopo/components/editor/useEditorProps.js +4 -6
  98. package/lib/networkTopo/getTopoData.js +19 -33
  99. package/lib/networkTopo/hooks/editor/useDeleteEdges.js +6 -4
  100. package/lib/networkTopo/services/alert.js +66 -0
  101. package/lib/networkTopo/services/authorization.js +145 -0
  102. package/lib/networkTopo/services/cmdb.js +977 -0
  103. package/lib/networkTopo/services/index.js +3 -29
  104. package/lib/networkTopo/services/mdc.js +91 -0
  105. package/lib/networkTopo/services/metric.js +82 -0
  106. package/lib/networkTopo/services/model.js +1387 -0
  107. package/lib/networkTopo/services/risk.js +40 -0
  108. package/lib/networkTopo/services/topo/auth.js +79 -0
  109. package/lib/networkTopo/services/topo/basic.js +753 -0
  110. package/lib/networkTopo/services/topo/blacklist.js +72 -0
  111. package/lib/networkTopo/services/topo/ciInfo.js +82 -0
  112. package/lib/networkTopo/services/topo/constants.js +6 -0
  113. package/lib/networkTopo/services/topo/icon.js +144 -0
  114. package/lib/networkTopo/services/topo/index.js +42 -0
  115. package/lib/networkTopo/services/topo/networkLink.js +45 -0
  116. package/lib/networkTopo/services/topo/relation.js +39 -0
  117. package/lib/networkTopo/services/topo/resourceWebUrl.js +95 -0
  118. package/lib/networkTopo/utils/storage.js +46 -0
  119. package/lib/style.js +21 -21
  120. package/lib/utils/tree.js +1 -0
  121. package/package.json +3 -3
  122. package/es/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -15
  123. package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -10
  124. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -630
  125. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -4
  126. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -458
  127. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
  128. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -104
  129. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
  130. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -55
  131. package/es/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -187
  132. package/es/networkTopo/event/index.js +0 -6
  133. package/lib/core/editor/components/plugins/MultipleResourceSelectPlugin.js +0 -25
  134. package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -19
  135. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/AddLinkDrawer.js +0 -661
  136. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/NetworkLinkForm.js +0 -12
  137. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/editLinkInfo.js +0 -486
  138. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/components/index.module.scss +0 -34
  139. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/hooks/useAddLink.js +0 -120
  140. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/index.module.scss +0 -12
  141. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/mock.js +0 -60
  142. package/lib/networkTopo/components/editor/propertyViews/edge/addLinkDrawer/server.js +0 -207
  143. 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
- }