@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,60 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.lineData = void 0;
5
- var lineData = {
6
- source: {
7
- id: "1",
8
- name: "锐捷交换机1",
9
- ip: "172.17.161.203",
10
- ciType: "锐捷交换机",
11
- ports: [{
12
- label: "1/0",
13
- value: "1"
14
- }, {
15
- label: "1/1",
16
- value: "2"
17
- }, {
18
- label: "1/2",
19
- value: "3"
20
- }]
21
- },
22
- target: {
23
- id: "2",
24
- name: "锐捷路由器2",
25
- ip: "172.17.161.249",
26
- ciType: "锐捷路由器",
27
- ports: [{
28
- label: "1/0",
29
- value: "1"
30
- }, {
31
- label: "1/1",
32
- value: "2"
33
- }, {
34
- label: "1/2",
35
- value: "3"
36
- }]
37
- }
38
- };
39
- exports.lineData = lineData;
40
- var attributes = {
41
- "network_link.to_if_connect": "r691616699585134592",
42
- "network_link.destination_ipv4 ": "172.17.166.27",
43
- "network_link.work_mode": "single",
44
- support_templates: "m.physical_link ",
45
- destination_id: "o000000046d0cc17",
46
- "rated_bandwidth ": 1000,
47
- source_type: "network.interface",
48
- "network_link.connect_type ": "phy",
49
- display_name: "172.17.166.10(Gi 0/41) - 172.17.166.27(Gi 0/49) ",
50
- asset_status: "1 ",
51
- destination_type: "network.interface",
52
- "network_link.network_category": "CAN ",
53
- "network_link.source_ipv4 ": "172.17.166.10",
54
- name: "172.17.166.10(Gi 0/41) - 172.17.166.27(Gi 0/49 ) ",
55
- "distance_outlet ": 2147483647,
56
- "network_link.is_crucial": false,
57
- source_id: "o00o000046d0c3cc",
58
- "network_link.source_device_id": "o00oo00046d0c368",
59
- "network_link.destination_device_id": " 0000000046d0c95e"
60
- };
@@ -1,207 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- exports.__esModule = true;
6
- exports["default"] = void 0;
7
-
8
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
-
10
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
-
12
- var _topo = _interopRequireDefault(require("@riil-frontend/component-topology-common/es/services/topo"));
13
-
14
- var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
15
-
16
- var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
17
-
18
- var _default = {
19
- /**
20
- * 查询端口列表
21
- *
22
- * @param {array} ciIds
23
- */
24
- getPortsById: function getPortsById(id) {
25
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
26
- var _result$id, result;
27
-
28
- return _regenerator["default"].wrap(function _callee$(_context) {
29
- while (1) {
30
- switch (_context.prev = _context.next) {
31
- case 0:
32
- _context.prev = 0;
33
- _context.next = 3;
34
- return _componentTopologyUtils.request.post("/topo/v1/api/networkLink/devicesInterfaces", [id]);
35
-
36
- case 3:
37
- result = _context.sent;
38
-
39
- _rlog["default"].debug("查询端口列表", id, result[id]);
40
-
41
- return _context.abrupt("return", (_result$id = result[id]) !== null && _result$id !== void 0 ? _result$id : []);
42
-
43
- case 8:
44
- _context.prev = 8;
45
- _context.t0 = _context["catch"](0);
46
-
47
- _rlog["default"].error("查询端口列表", _context.t0);
48
-
49
- case 11:
50
- case "end":
51
- return _context.stop();
52
- }
53
- }
54
- }, _callee, null, [[0, 8]]);
55
- }))();
56
- },
57
-
58
- /**
59
- * 新建/编辑链路
60
- *
61
- * @param {array} ciIds
62
- */
63
- addLink: function addLink(parm) {
64
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
65
- var result;
66
- return _regenerator["default"].wrap(function _callee2$(_context2) {
67
- while (1) {
68
- switch (_context2.prev = _context2.next) {
69
- case 0:
70
- _context2.prev = 0;
71
- _context2.next = 3;
72
- return _componentTopologyUtils.request.post("/topo/v1/api/networkLink", parm);
73
-
74
- case 3:
75
- result = _context2.sent;
76
- return _context2.abrupt("return", result);
77
-
78
- case 7:
79
- _context2.prev = 7;
80
- _context2.t0 = _context2["catch"](0);
81
-
82
- _rlog["default"].error("新建链路", _context2.t0);
83
-
84
- case 10:
85
- case "end":
86
- return _context2.stop();
87
- }
88
- }
89
- }, _callee2, null, [[0, 7]]);
90
- }))();
91
- },
92
-
93
- /**
94
- * 查询当前节点关联的链路
95
- *
96
- * @param {array} ciId
97
- */
98
- queryLinksByNodeId: function queryLinksByNodeId(ciId) {
99
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
100
- var condition, parm, jsonParm, result;
101
- return _regenerator["default"].wrap(function _callee3$(_context3) {
102
- while (1) {
103
- switch (_context3.prev = _context3.next) {
104
- case 0:
105
- condition = "type('network_link') && (network_link.source_device_id='" + ciId + "' || network_link.destination_device_id='" + ciId + "')";
106
- parm = {
107
- condition: condition,
108
- sort: "name asc",
109
- currentPage: 1,
110
- pageSize: 9999
111
- };
112
- jsonParm = JSON.stringify(parm); // console.log("查询当前节点关联的链路", parm, jsonParm);
113
-
114
- _context3.prev = 3;
115
- _context3.next = 6;
116
- return _componentTopologyUtils.request.post("/mdc/v1/api/cmdb/commonQueryCiData", jsonParm);
117
-
118
- case 6:
119
- result = _context3.sent;
120
- return _context3.abrupt("return", result);
121
-
122
- case 10:
123
- _context3.prev = 10;
124
- _context3.t0 = _context3["catch"](3);
125
-
126
- _rlog["default"].error("查询可关联链路", _context3.t0);
127
-
128
- case 13:
129
- case "end":
130
- return _context3.stop();
131
- }
132
- }
133
- }, _callee3, null, [[3, 10]]);
134
- }))();
135
- },
136
-
137
- /**
138
- * 新建/编辑链路
139
- *
140
- * @param {array} ciIds
141
- */
142
- editLink: function editLink(parm) {
143
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
144
- var result;
145
- return _regenerator["default"].wrap(function _callee4$(_context4) {
146
- while (1) {
147
- switch (_context4.prev = _context4.next) {
148
- case 0:
149
- _context4.prev = 0;
150
- _context4.next = 3;
151
- return _componentTopologyUtils.request.put("/topo/v1/api/networkLink", parm);
152
-
153
- case 3:
154
- result = _context4.sent;
155
- return _context4.abrupt("return", result);
156
-
157
- case 7:
158
- _context4.prev = 7;
159
- _context4.t0 = _context4["catch"](0);
160
-
161
- _rlog["default"].error("编辑链路", _context4.t0);
162
-
163
- case 10:
164
- case "end":
165
- return _context4.stop();
166
- }
167
- }
168
- }, _callee4, null, [[0, 7]]);
169
- }))();
170
- },
171
-
172
- /**
173
- * 删除链路
174
- *
175
- * @param {array} ciIds
176
- */
177
- deleteLink: function deleteLink(id) {
178
- return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
179
- var result;
180
- return _regenerator["default"].wrap(function _callee5$(_context5) {
181
- while (1) {
182
- switch (_context5.prev = _context5.next) {
183
- case 0:
184
- _context5.prev = 0;
185
- _context5.next = 3;
186
- return _componentTopologyUtils.request["delete"]("/topo/v1/api/networkLink/{" + id + "}");
187
-
188
- case 3:
189
- result = _context5.sent;
190
- return _context5.abrupt("return", result);
191
-
192
- case 7:
193
- _context5.prev = 7;
194
- _context5.t0 = _context5["catch"](0);
195
-
196
- _rlog["default"].error("删除链路", _context5.t0);
197
-
198
- case 10:
199
- case "end":
200
- return _context5.stop();
201
- }
202
- }
203
- }, _callee5, null, [[0, 7]]);
204
- }))();
205
- }
206
- };
207
- exports["default"] = _default;
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports["default"] = void 0;
5
-
6
- var TopoCenterEvent = function TopoCenterEvent() {};
7
-
8
- exports["default"] = TopoCenterEvent;
9
- TopoCenterEvent.TOPO_LINK_ENTER_CREATE_MODE = "topo_link_enter_create_mode";
10
- TopoCenterEvent.TOPO_LINK_CREATED = "topo_link_created";
11
- TopoCenterEvent.TOPO_LINK_SELECT_SOURCE_NODE = "topo_link_select_source_node";