@riil-frontend/component-topology 7.0.0-dev.12 → 7.0.0-dev.14

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 (29) hide show
  1. package/build/index.css +1 -1
  2. package/build/index.js +1 -1
  3. package/es/core/editor/components/Toolbar/buttons.js +2 -2
  4. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +9 -2
  5. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
  6. package/es/core/hooks/usePolling.js +1 -6
  7. package/es/core/hooks/useTopoEdit.js +3 -1
  8. package/es/core/models/Alarm.js +12 -24
  9. package/es/core/models/TopoApp.js +1 -1
  10. package/es/core/models/utils/linkUtils.js +0 -3
  11. package/es/core/store/models/topoMod.js +7 -6
  12. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -25
  13. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
  14. package/es/networkTopo/getTopoData.js +16 -27
  15. package/es/networkTopo/hooks/editor/useDeleteEdges.js +1 -3
  16. package/lib/core/editor/components/Toolbar/buttons.js +2 -2
  17. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +9 -3
  18. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +5 -0
  19. package/lib/core/hooks/usePolling.js +1 -6
  20. package/lib/core/hooks/useTopoEdit.js +3 -1
  21. package/lib/core/models/Alarm.js +12 -24
  22. package/lib/core/models/TopoApp.js +1 -1
  23. package/lib/core/models/utils/linkUtils.js +0 -5
  24. package/lib/core/store/models/topoMod.js +9 -6
  25. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +28 -26
  26. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +1 -0
  27. package/lib/networkTopo/getTopoData.js +16 -28
  28. package/lib/networkTopo/hooks/editor/useDeleteEdges.js +1 -4
  29. package/package.json +2 -2
@@ -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
  };
@@ -13,8 +13,6 @@ var _table = _interopRequireDefault(require("@alifd/next/lib/table"));
13
13
 
14
14
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
15
15
 
16
- var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
17
-
18
16
  var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
19
17
 
20
18
  var _react = _interopRequireDefault(require("react"));
@@ -75,30 +73,34 @@ function EventsCard(props) {
75
73
  title: (0, _moment["default"])(value).format('YYYY-MM-DD HH:mm:ss')
76
74
  }, (0, _moment["default"])(value).format('YYYY-MM-DD HH:mm:ss'));
77
75
  }
78
- }, {
79
- title: '操作',
80
- dataIndex: 'status',
81
- key: 'status',
82
- width: 64,
83
- cell: function cell(status, index, record) {
84
- if (record.type === 'alarm') {
85
- return status === 'toDeal' ? /*#__PURE__*/_react["default"].createElement(_button["default"], {
86
- text: true,
87
- type: "primary",
88
- onClick: function onClick() {
89
- return alarmRiskOperation(record.type, record.params);
90
- }
91
- }, "\u53D7\u7406") : /*#__PURE__*/_react["default"].createElement(_button["default"], {
92
- disabled: true,
93
- text: true,
94
- type: "primary"
95
- }, "\u5DF2\u53D7\u7406");
96
- } else {
97
- // return <Button text type="primary" onClick={() => alarmRiskOperation(record.type, record)}>受理</Button>
98
- return '';
99
- }
100
- }
101
- }]; // 告警/风险 操作 (受理)
76
+ } // 临时屏蔽告警操作列,后续版本按权限显示 2023-3-6 20:23:45
77
+ // {
78
+ // title: '操作',
79
+ // dataIndex: 'status',
80
+ // key: 'status',
81
+ // width: 64,
82
+ // cell: (status, index, record) => {
83
+ // if (record.type === 'alarm') {
84
+ // return status === 'toDeal' ? (
85
+ // <Button
86
+ // text
87
+ // type="primary"
88
+ // onClick={() => alarmRiskOperation(record.type, record.params)}
89
+ // >
90
+ // 受理
91
+ // </Button>
92
+ // ) : (
93
+ // <Button disabled text type="primary">
94
+ // 已受理
95
+ // </Button>
96
+ // );
97
+ // } else {
98
+ // // return <Button text type="primary" onClick={() => alarmRiskOperation(record.type, record)}>受理</Button>
99
+ // return '';
100
+ // }
101
+ // },
102
+ // },
103
+ ]; // 告警/风险 操作 (受理)
102
104
 
103
105
  function alarmRiskOperation(_x, _x2) {
104
106
  return _alarmRiskOperation.apply(this, arguments);
@@ -101,6 +101,7 @@
101
101
  }
102
102
  .alarm {
103
103
  margin-top: 12px;
104
+ margin-bottom: 16px;
104
105
  .alarm-title {
105
106
  overflow: hidden;
106
107
  text-overflow: ellipsis;
@@ -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.12",
3
+ "version": "7.0.0-dev.14",
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.12/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@7.0.0-dev.14/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }