@riil-frontend/component-topology 7.0.0-dev.13 → 7.0.0-dev.15

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 (30) hide show
  1. package/build/index.js +1 -1
  2. package/es/core/editor/components/Toolbar/buttons.js +2 -2
  3. package/es/core/editor/components/settings/PropertyView.js +11 -10
  4. package/es/core/editor/components/settings/Settings.js +8 -1
  5. package/es/core/editor/components/settings/core/PropertyViewManager.js +4 -3
  6. package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -7
  7. package/es/core/hooks/usePolling.js +1 -6
  8. package/es/core/hooks/useTopoEdit.js +3 -1
  9. package/es/core/models/Alarm.js +12 -24
  10. package/es/core/models/TopoApp.js +1 -1
  11. package/es/core/models/utils/linkUtils.js +0 -3
  12. package/es/core/store/models/topoMod.js +7 -6
  13. package/es/networkTopo/getTopoData.js +16 -27
  14. package/es/networkTopo/hooks/editor/useDeleteEdges.js +1 -3
  15. package/lib/core/editor/components/Toolbar/buttons.js +2 -2
  16. package/lib/core/editor/components/settings/PropertyView.js +10 -10
  17. package/lib/core/editor/components/settings/Settings.js +9 -1
  18. package/lib/core/editor/components/settings/core/PropertyViewManager.js +4 -3
  19. package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +1 -10
  20. package/lib/core/hooks/usePolling.js +1 -6
  21. package/lib/core/hooks/useTopoEdit.js +3 -1
  22. package/lib/core/models/Alarm.js +12 -24
  23. package/lib/core/models/TopoApp.js +1 -1
  24. package/lib/core/models/utils/linkUtils.js +0 -5
  25. package/lib/core/store/models/topoMod.js +9 -6
  26. package/lib/networkTopo/getTopoData.js +16 -28
  27. package/lib/networkTopo/hooks/editor/useDeleteEdges.js +1 -4
  28. package/package.json +2 -2
  29. package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -10
  30. package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +0 -19
@@ -237,23 +237,11 @@ var Alarm = /*#__PURE__*/function () {
237
237
 
238
238
  _proto.hmGetTopoAlarm = /*#__PURE__*/function () {
239
239
  var _hmGetTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id) {
240
- var _this$topo$store$getS, data, resAndMetrics, topoData, _this$getState2, alarmIsOpened, alarmOpening, nodeIdsList, linkIdsList, resIdsList, mainCiIdList, endTime, startTime, parms, result;
241
-
240
+ var mainCiIdList, endTime, startTime, parms, result;
242
241
  return _regenerator["default"].wrap(function _callee3$(_context3) {
243
242
  while (1) {
244
243
  switch (_context3.prev = _context3.next) {
245
244
  case 0:
246
- _this$topo$store$getS = this.topo.store.getState().topoMod, data = _this$topo$store$getS.data, resAndMetrics = _this$topo$store$getS.resAndMetrics, topoData = _this$topo$store$getS.topoData;
247
- _this$getState2 = this.getState(), alarmIsOpened = _this$getState2.alarmIsOpened, alarmOpening = _this$getState2.alarmOpening; // const { nodes, links } = data;
248
-
249
- nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList, resIdsList = resAndMetrics.resIdsList; // rlog.debug(
250
- // "获取告警列表--resAndMetrics,topoData,data",
251
- // this.topo,
252
- // resAndMetrics,
253
- // topoData,
254
- // data
255
- // );
256
-
257
245
  mainCiIdList = this.topo.dataModel.getDatas().filter(function (ci) {
258
246
  return !!ci.operation;
259
247
  }) // 过滤掉权限
@@ -262,7 +250,7 @@ var Alarm = /*#__PURE__*/function () {
262
250
  });
263
251
 
264
252
  if (!(mainCiIdList.length === 0)) {
265
- _context3.next = 7;
253
+ _context3.next = 4;
266
254
  break;
267
255
  }
268
256
 
@@ -272,7 +260,7 @@ var Alarm = /*#__PURE__*/function () {
272
260
  });
273
261
  return _context3.abrupt("return");
274
262
 
275
- case 7:
263
+ case 4:
276
264
  //rlog.debug("获取告警列表", mainCiIdList);
277
265
  endTime = null; // new Date().valueOf();
278
266
 
@@ -297,10 +285,10 @@ var Alarm = /*#__PURE__*/function () {
297
285
  endTime: endTime
298
286
  }
299
287
  };
300
- _context3.next = 12;
288
+ _context3.next = 9;
301
289
  return _topo["default"].getAlarmByIds(parms);
302
290
 
303
- case 12:
291
+ case 9:
304
292
  result = _context3.sent;
305
293
 
306
294
  _rlog["default"].debug("getAlarmById-result", result); // if (alarmIsOpened) {
@@ -313,7 +301,7 @@ var Alarm = /*#__PURE__*/function () {
313
301
  // });
314
302
 
315
303
 
316
- case 14:
304
+ case 11:
317
305
  case "end":
318
306
  return _context3.stop();
319
307
  }
@@ -408,14 +396,14 @@ var Alarm = /*#__PURE__*/function () {
408
396
  var _openTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(id) {
409
397
  var _this2 = this;
410
398
 
411
- var _this$getState3, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
399
+ var _this$getState2, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
412
400
 
413
401
  return _regenerator["default"].wrap(function _callee6$(_context6) {
414
402
  while (1) {
415
403
  switch (_context6.prev = _context6.next) {
416
404
  case 0:
417
405
  // 如果当前拓扑图开启中或已开启则退出
418
- _this$getState3 = this.getState(), alarmOpening = _this$getState3.alarmOpening, topoAlarmIsOpen = _this$getState3.topoAlarmIsOpen;
406
+ _this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
419
407
 
420
408
  if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
421
409
  _context6.next = 3;
@@ -477,14 +465,14 @@ var Alarm = /*#__PURE__*/function () {
477
465
  /*#__PURE__*/
478
466
  function () {
479
467
  var _closeTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id) {
480
- var _this$getState4, alarmIsOpened, alarmOpening;
468
+ var _this$getState3, alarmIsOpened, alarmOpening;
481
469
 
482
470
  return _regenerator["default"].wrap(function _callee7$(_context7) {
483
471
  while (1) {
484
472
  switch (_context7.prev = _context7.next) {
485
473
  case 0:
486
474
  // 如果未开启则退出
487
- _this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened, alarmOpening = _this$getState4.alarmOpening;
475
+ _this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
488
476
 
489
477
  if (!(!alarmIsOpened && !alarmOpening)) {
490
478
  _context7.next = 3;
@@ -574,13 +562,13 @@ var Alarm = /*#__PURE__*/function () {
574
562
  /*#__PURE__*/
575
563
  function () {
576
564
  var _handleAlarmEvent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(alertData) {
577
- var _this$getState5, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
565
+ var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
578
566
 
579
567
  return _regenerator["default"].wrap(function _callee9$(_context9) {
580
568
  while (1) {
581
569
  switch (_context9.prev = _context9.next) {
582
570
  case 0:
583
- _this$getState5 = this.getState(), alarmIsOpened = _this$getState5.alarmIsOpened;
571
+ _this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
584
572
  resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
585
573
  resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
586
574
  alarmDispatchers = this.topo.store.getModelDispatchers("topoAlarm"); // 添加事件
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
54
54
  var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
55
55
 
56
56
  // eslint-disable-next-line no-undef
57
- var version = typeof "7.0.0-dev.13" === 'string' ? "7.0.0-dev.13" : null;
57
+ var version = typeof "7.0.0-dev.15" === 'string' ? "7.0.0-dev.15" : null;
58
58
  console.info("\u62D3\u6251\u7248\u672C: " + version);
59
59
  /**
60
60
  * 拓扑显示和编辑
@@ -6,7 +6,6 @@ exports.__esModule = true;
6
6
  exports.buildTopoLinkData = buildTopoLinkData;
7
7
  exports.getInterfaceObject = exports.compatibleWith = void 0;
8
8
  exports.getLinksDetail = getLinksDetail;
9
- exports.isAggLink = isAggLink;
10
9
  exports.isCrucialLink = isCrucialLink;
11
10
  exports.isExitLink = isExitLink;
12
11
  exports.mergeLinksData = mergeLinksData;
@@ -57,10 +56,6 @@ function isExitLink(link) {
57
56
  return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes['destination_id']);
58
57
  }
59
58
 
60
- function isAggLink(link) {
61
- return link.attributes["network_link.connect_type"] === "agg";
62
- }
63
-
64
59
  var getInterfaceObject = /*#__PURE__*/function () {
65
60
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(codes) {
66
61
  var query, promises, result, ifDoc;
@@ -629,17 +629,20 @@ function _default(topoApp) {
629
629
 
630
630
  case 4:
631
631
  topoPermission = _context11.sent;
632
- _context11.next = 10;
632
+
633
+ _rlog["default"].debug('查询拓扑权限', topoPermission);
634
+
635
+ _context11.next = 11;
633
636
  break;
634
637
 
635
- case 7:
636
- _context11.prev = 7;
638
+ case 8:
639
+ _context11.prev = 8;
637
640
  _context11.t0 = _context11["catch"](1);
638
641
 
639
642
  _rlog["default"].error("\u67E5\u8BE2\u62D3\u6251" + id + "\u7684\u6743\u9650\u5931\u8D25", _context11.t0); // 尚未区分拓扑图不存在还是接口请求报错
640
643
 
641
644
 
642
- case 10:
645
+ case 11:
643
646
  if (update !== false) {
644
647
  _this8.update({
645
648
  topoPermission: topoPermission
@@ -648,12 +651,12 @@ function _default(topoApp) {
648
651
 
649
652
  return _context11.abrupt("return", topoPermission);
650
653
 
651
- case 12:
654
+ case 13:
652
655
  case "end":
653
656
  return _context11.stop();
654
657
  }
655
658
  }
656
- }, _callee11, null, [[1, 7]]);
659
+ }, _callee11, null, [[1, 8]]);
657
660
  }))();
658
661
  }
659
662
  };
@@ -15,8 +15,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
15
15
 
16
16
  var _linkUtils = require("../core/models/utils/linkUtils");
17
17
 
18
- var _services = require("../core/services");
19
-
20
18
  var _resourcePermissionUtil = require("./utils/resourcePermissionUtil");
21
19
 
22
20
  // import "./utils/__tests__/resourcePermissionUtil.test";
@@ -32,7 +30,7 @@ function addLinkData(_x, _x2) {
32
30
 
33
31
  function _addLinkData() {
34
32
  _addLinkData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(oldLinks, nodes) {
35
- var links;
33
+ var links, networkLinks, otherLinks;
36
34
  return _regenerator["default"].wrap(function _callee$(_context) {
37
35
  while (1) {
38
36
  switch (_context.prev = _context.next) {
@@ -48,18 +46,24 @@ function _addLinkData() {
48
46
  }
49
47
 
50
48
  return true;
51
- });
49
+ }); // 如果是网络链路,补充详情信息
50
+
52
51
  _context.next = 3;
53
- return (0, _linkUtils.getLinksDetail)(links, nodes);
52
+ return (0, _linkUtils.getLinksDetail)(links.filter(function (link) {
53
+ return !link.ciType;
54
+ }), nodes);
54
55
 
55
56
  case 3:
56
- links = _context.sent;
57
+ networkLinks = _context.sent;
58
+ otherLinks = links.filter(function (link) {
59
+ return !!link.ciType;
60
+ });
57
61
  return _context.abrupt("return", {
58
- links: links,
62
+ links: [].concat(networkLinks, otherLinks),
59
63
  linkGroups: []
60
64
  });
61
65
 
62
- case 5:
66
+ case 6:
63
67
  case "end":
64
68
  return _context.stop();
65
69
  }
@@ -88,7 +92,7 @@ function buildData(_x3) {
88
92
 
89
93
  function _buildData() {
90
94
  _buildData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(data) {
91
- var newData, nodes, _yield$Promise$all, nodeCis, linkData;
95
+ var newData, nodes, _yield$Promise$all, linkData;
92
96
 
93
97
  return _regenerator["default"].wrap(function _callee2$(_context2) {
94
98
  while (1) {
@@ -105,34 +109,18 @@ function _buildData() {
105
109
  });
106
110
  });
107
111
  _context2.next = 4;
108
- return Promise.all([// 查询节点属性
109
- (0, _services.queryCisByIds)(nodes.map(function (node) {
110
- return node.id;
111
- })), addLinkData(data.links || [], nodes)]);
112
+ return Promise.all([addLinkData(data.links || [], nodes)]);
112
113
 
113
114
  case 4:
114
115
  _yield$Promise$all = _context2.sent;
115
- nodeCis = _yield$Promise$all[0];
116
- linkData = _yield$Promise$all[1];
117
- nodes = nodes.map(function (node) {
118
- var _node$attributes$find;
119
-
120
- return (0, _extends2["default"])({}, node, {
121
- ipAddress: Array.isArray(node.attributes) ? (_node$attributes$find = node.attributes.find(function (item) {
122
- return item.code === 'ipAddress';
123
- })) === null || _node$attributes$find === void 0 ? void 0 : _node$attributes$find.value : null,
124
- attributes: nodeCis.find(function (ci) {
125
- return ci.id === node.id;
126
- }).attributes
127
- });
128
- });
116
+ linkData = _yield$Promise$all[0];
129
117
  newData = (0, _extends2["default"])({}, newData, {
130
118
  nodes: nodes
131
119
  }, linkData);
132
120
  newData = (0, _resourcePermissionUtil.addTopoDataResourcePermission)(newData);
133
121
  return _context2.abrupt("return", newData);
134
122
 
135
- case 11:
123
+ case 9:
136
124
  case "end":
137
125
  return _context2.stop();
138
126
  }
@@ -17,8 +17,6 @@ var _dialog = _interopRequireDefault(require("@alifd/next/lib/dialog"));
17
17
 
18
18
  var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
19
19
 
20
- var _linkUtils = require("../../../core/models/utils/linkUtils");
21
-
22
20
  var _link = _interopRequireDefault(require("../../services/link"));
23
21
 
24
22
  var _resourcePermissionUtil = require("../../utils/resourcePermissionUtil");
@@ -64,8 +62,7 @@ var _default = function _default(_ref) {
64
62
  switch (_context.prev = _context.next) {
65
63
  case 0:
66
64
  id = link.id;
67
- isGroup = false; // isAggLink(link);
68
-
65
+ isGroup = false;
69
66
  _context.next = 4;
70
67
  return _link["default"].deleteLink(id);
71
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "7.0.0-dev.13",
3
+ "version": "7.0.0-dev.15",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -116,6 +116,6 @@
116
116
  "access": "public"
117
117
  },
118
118
  "license": "MIT",
119
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@7.0.0-dev.13/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@7.0.0-dev.15/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }
@@ -1,10 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- export default function addEdgeProps(Component) {
4
- return function AdapterEdgeProps(props) {
5
- var selectionElement = props.selectionElement;
6
- return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
7
- edge: selectionElement
8
- }));
9
- };
10
- }
@@ -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
- }