@riil-frontend/component-topology 12.0.0-dev.34 → 12.0.0-dev.35

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.
@@ -32,8 +32,8 @@ function AlarmListItem(props) {
32
32
  // 传入参数
33
33
  var topo = props.topo,
34
34
  alarmInfo = props.alarmInfo,
35
- onClick = props.onClick; // console.log("AlarmListPanel", topo, alarmInfo);
36
-
35
+ onClick = props.onClick;
36
+ console.log("AlarmListPanel", topo, alarmInfo);
37
37
  return /*#__PURE__*/React.createElement(_List.Item, {
38
38
  className: styles.AlarmListItem,
39
39
  media: /*#__PURE__*/React.createElement(_Icon, {
@@ -77,29 +77,6 @@ export function isNodeAllEdges(topo) {
77
77
  });
78
78
  return inEdges;
79
79
  }
80
- /**
81
- * 遍历连线及子连线
82
- * @param {*} topo
83
- * @param {*} edges
84
- * @param {*} operateEdgeFn
85
- */
86
-
87
- export function loopEdgesAndChildren(topo, edges, operateEdgeFn) {
88
- var htTopo = topo.getHtTopo();
89
- edges.forEach(function (edge) {
90
- operateEdgeFn(edge);
91
-
92
- if (edge.isEdgeGroupAgent()) {
93
- // 连线组折叠时同时设置子连线
94
- var edgeChildren = edge.getEdgeGroup().getEdges().toArray();
95
- htTopo.toggleEdgeGroup(edge.getSource(), edge.getTarget(), true);
96
- edgeChildren.forEach(function (edgeChild) {
97
- operateEdgeFn(edgeChild);
98
- });
99
- htTopo.toggleEdgeGroup(edge.getSource(), edge.getTarget(), false);
100
- }
101
- });
102
- }
103
80
  /**
104
81
  * 设置连线及子连线。带回退事务控制
105
82
  * @param {*} topo
@@ -95,10 +95,6 @@ var useTopoEdit = function useTopoEdit(params) {
95
95
  return topoDispatchers.setTopoType(TPL_TREE);
96
96
 
97
97
  case 7:
98
- // 更新配置
99
- // resourceConfig.updateConfig(config);
100
- // 更新配置对应的资源、链路
101
- // editDispatchers.fetchDataByConfig();
102
98
  topo.historyManager.endTransaction();
103
99
 
104
100
  case 8:
@@ -459,14 +459,14 @@ var Alarm = /*#__PURE__*/function () {
459
459
  console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
460
460
 
461
461
  if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
462
- _context8.next = 25;
462
+ _context8.next = 27;
463
463
  break;
464
464
  }
465
465
 
466
466
  sendAl = [];
467
467
  idsList = [].concat(nodeIdsList, linkIdsList);
468
- operations = []; // console.log('idsList---------', idsList)
469
-
468
+ operations = [];
469
+ console.log('idsList---------', idsList);
470
470
  idsList.forEach(function (idItem) {
471
471
  if (idItem.operation === null) {
472
472
  operations.push(idItem.ciId);
@@ -492,21 +492,22 @@ var Alarm = /*#__PURE__*/function () {
492
492
  if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
493
493
  sendAl.push(obj);
494
494
  }
495
- }); // console.log("before-combAlarmData", sendAl, idsList);
495
+ });
496
+ console.log("before-combAlarmData", sendAl, idsList);
496
497
 
497
498
  if (!(sendAl.length > 0)) {
498
- _context8.next = 25;
499
+ _context8.next = 27;
499
500
  break;
500
501
  }
501
502
 
502
503
  rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
503
- _context8.prev = 13;
504
- _context8.next = 16;
504
+ _context8.prev = 15;
505
+ _context8.next = 18;
505
506
  return alarmDispatchers.combAlarmData({
506
507
  alarmdata: sendAl
507
508
  });
508
509
 
509
- case 16:
510
+ case 18:
510
511
  _yield$alarmDispatche2 = _context8.sent;
511
512
  eqFlag = _yield$alarmDispatche2.eqFlag;
512
513
  alarmlist = _yield$alarmDispatche2.alarmlist;
@@ -527,19 +528,19 @@ var Alarm = /*#__PURE__*/function () {
527
528
  }
528
529
  }
529
530
 
530
- _context8.next = 25;
531
+ _context8.next = 27;
531
532
  break;
532
533
 
533
- case 22:
534
- _context8.prev = 22;
535
- _context8.t0 = _context8["catch"](13);
534
+ case 24:
535
+ _context8.prev = 24;
536
+ _context8.t0 = _context8["catch"](15);
536
537
  rlog.error('告警发送异常', _context8.t0);
537
538
 
538
- case 25:
539
+ case 27:
539
540
  case "end":
540
541
  return _context8.stop();
541
542
  }
542
- }, _callee8, this, [[13, 22]]);
543
+ }, _callee8, this, [[15, 24]]);
543
544
  }));
544
545
 
545
546
  function handleAlarmEvent(_x6) {
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel";
25
25
  import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
26
26
 
27
- var version = typeof "12.0.0-dev.34" === 'string' ? "12.0.0-dev.34" : null;
27
+ var version = typeof "12.0.0-dev.35" === 'string' ? "12.0.0-dev.35" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -2,8 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import keyBy from "lodash/keyBy";
5
- import _ from "lodash";
6
- import { queryCisByIds, queryModelAsset } from "../../services"; // 查询所有连线
5
+ import _ from "lodash"; // 查询所有连线
7
6
 
8
7
  import { getEdges } from "../../../utils/htElementUtils";
9
8
  import CiTypeCache from "../cache/CiTypeCache";
@@ -32,7 +31,20 @@ export function isCrucialLink(link) {
32
31
  */
33
32
 
34
33
  export function isExitLink(link) {
35
- return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes["destination_id"]);
34
+ var _link$attributes;
35
+
36
+ return (link === null || link === void 0 ? void 0 : (_link$attributes = link.attributes) === null || _link$attributes === void 0 ? void 0 : _link$attributes.destination_type) === "ip";
37
+ }
38
+ /**
39
+ * 是否聚合链路
40
+ * @param {*} link
41
+ * @returns
42
+ */
43
+
44
+ export function isAggLink(link) {
45
+ var _link$attributes2, _link$attributes3;
46
+
47
+ return (link === null || link === void 0 ? void 0 : (_link$attributes2 = link.attributes) === null || _link$attributes2 === void 0 ? void 0 : _link$attributes2.destination_type) === "network.agg_interface" && (link === null || link === void 0 ? void 0 : (_link$attributes3 = link.attributes) === null || _link$attributes3 === void 0 ? void 0 : _link$attributes3.source_type) === "network.agg_interface";
36
48
  }
37
49
  export function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
38
50
  var linkCiMap = keyBy(links, "id");
@@ -83,7 +95,7 @@ function _getLinksDetail() {
83
95
  return _regeneratorRuntime.wrap(function _callee$(_context) {
84
96
  while (1) switch (_context.prev = _context.next) {
85
97
  case 0:
86
- if (!(!links || !links.length)) {
98
+ if (links !== null && links !== void 0 && links.length) {
87
99
  _context.next = 2;
88
100
  break;
89
101
  }
@@ -91,9 +103,6 @@ function _getLinksDetail() {
91
103
  return _context.abrupt("return", []);
92
104
 
93
105
  case 2:
94
- // const linkCis = await topoService.relation.batchQueryRelation(
95
- // links.map((link) => link.id)
96
- // );
97
106
  linkCis = links;
98
107
  interfaceIds = [].concat(linkCis.map(function (item) {
99
108
  return item.attributes.source_id;
@@ -171,17 +180,15 @@ export var showLinkByConfig = function showLinkByConfig(props) {
171
180
  if (showType === 1 || showType === true) {
172
181
  // 单链路全部显示
173
182
  // console.log("单链路全部显示", edge);
174
- edge.s("2d.visible", true);
183
+ edge.s("x.visible", true);
175
184
  } else {
176
- var _d$attributes, _d$attributes2;
177
-
178
185
  var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
179
186
 
180
- if ((d === null || d === void 0 ? void 0 : (_d$attributes = d.attributes) === null || _d$attributes === void 0 ? void 0 : _d$attributes.destination_type) === "network.agg_interface" && (d === null || d === void 0 ? void 0 : (_d$attributes2 = d.attributes) === null || _d$attributes2 === void 0 ? void 0 : _d$attributes2.source_type) === "network.agg_interface") {
181
- edge.s("2d.visible", showAgg);
187
+ if (isAggLink(d)) {
188
+ edge.s("x.visible", showAgg);
182
189
  } else {
183
190
  // console.log("edge", edge, d, showAgg);
184
- edge.s("2d.visible", showPhy);
191
+ edge.s("x.visible", showPhy);
185
192
  }
186
193
  }
187
194
  });
@@ -35,11 +35,9 @@ function formatUrl(url) {
35
35
 
36
36
  var prefix = '/default/pagecenter';
37
37
 
38
- if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
38
+ if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) !== '-1' && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) !== '-1') {
39
39
  return url.split(prefix)[1];
40
- } else {
41
- return url;
42
- }
40
+ } else {}
43
41
  }
44
42
  /**
45
43
  * 资源概览。
@@ -337,9 +335,9 @@ export default function ResourceOverview(props) {
337
335
  type: record.icon,
338
336
  size: "xs",
339
337
  className: styles['alarm-color-icon'] + " " + record.className
340
- }), /*#__PURE__*/React.createElement(Link, {
338
+ }), /*#__PURE__*/React.createElement("a", {
341
339
  className: styles.link,
342
- to: formatUrl(record.link)
340
+ href: formatUrl(record.link)
343
341
  }, value));
344
342
  }
345
343
  }, {
@@ -50,8 +50,8 @@ function AlarmListItem(props) {
50
50
  // 传入参数
51
51
  var topo = props.topo,
52
52
  alarmInfo = props.alarmInfo,
53
- onClick = props.onClick; // console.log("AlarmListPanel", topo, alarmInfo);
54
-
53
+ onClick = props.onClick;
54
+ console.log("AlarmListPanel", topo, alarmInfo);
55
55
  return /*#__PURE__*/_react["default"].createElement(_list["default"].Item, {
56
56
  className: _indexModule["default"].AlarmListItem,
57
57
  media: /*#__PURE__*/_react["default"].createElement(_icon["default"], {
@@ -3,7 +3,6 @@
3
3
  exports.__esModule = true;
4
4
  exports.getEdgesBySelection = getEdgesBySelection;
5
5
  exports.isNodeAllEdges = isNodeAllEdges;
6
- exports.loopEdgesAndChildren = loopEdgesAndChildren;
7
6
  exports.setEdgesType = setEdgesType;
8
7
  exports.updateEdgesData = updateEdgesData;
9
8
 
@@ -89,30 +88,6 @@ function isNodeAllEdges(topo) {
89
88
  });
90
89
  return inEdges;
91
90
  }
92
- /**
93
- * 遍历连线及子连线
94
- * @param {*} topo
95
- * @param {*} edges
96
- * @param {*} operateEdgeFn
97
- */
98
-
99
-
100
- function loopEdgesAndChildren(topo, edges, operateEdgeFn) {
101
- var htTopo = topo.getHtTopo();
102
- edges.forEach(function (edge) {
103
- operateEdgeFn(edge);
104
-
105
- if (edge.isEdgeGroupAgent()) {
106
- // 连线组折叠时同时设置子连线
107
- var edgeChildren = edge.getEdgeGroup().getEdges().toArray();
108
- htTopo.toggleEdgeGroup(edge.getSource(), edge.getTarget(), true);
109
- edgeChildren.forEach(function (edgeChild) {
110
- operateEdgeFn(edgeChild);
111
- });
112
- htTopo.toggleEdgeGroup(edge.getSource(), edge.getTarget(), false);
113
- }
114
- });
115
- }
116
91
  /**
117
92
  * 设置连线及子连线。带回退事务控制
118
93
  * @param {*} topo
@@ -127,10 +127,6 @@ var useTopoEdit = function useTopoEdit(params) {
127
127
  return topoDispatchers.setTopoType(_template.TPL_TREE);
128
128
 
129
129
  case 7:
130
- // 更新配置
131
- // resourceConfig.updateConfig(config);
132
- // 更新配置对应的资源、链路
133
- // editDispatchers.fetchDataByConfig();
134
130
  topo.historyManager.endTransaction();
135
131
 
136
132
  case 8:
@@ -481,14 +481,14 @@ var Alarm = /*#__PURE__*/function () {
481
481
  console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
482
482
 
483
483
  if (!((0, _utils.isAvailableArray)(alertData) && (0, _utils.isAvailableArray)(resIdsList))) {
484
- _context8.next = 25;
484
+ _context8.next = 27;
485
485
  break;
486
486
  }
487
487
 
488
488
  sendAl = [];
489
489
  idsList = [].concat(nodeIdsList, linkIdsList);
490
- operations = []; // console.log('idsList---------', idsList)
491
-
490
+ operations = [];
491
+ console.log('idsList---------', idsList);
492
492
  idsList.forEach(function (idItem) {
493
493
  if (idItem.operation === null) {
494
494
  operations.push(idItem.ciId);
@@ -514,22 +514,23 @@ var Alarm = /*#__PURE__*/function () {
514
514
  if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
515
515
  sendAl.push(obj);
516
516
  }
517
- }); // console.log("before-combAlarmData", sendAl, idsList);
517
+ });
518
+ console.log("before-combAlarmData", sendAl, idsList);
518
519
 
519
520
  if (!(sendAl.length > 0)) {
520
- _context8.next = 25;
521
+ _context8.next = 27;
521
522
  break;
522
523
  }
523
524
 
524
525
  _componentTopologyUtils.rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
525
526
 
526
- _context8.prev = 13;
527
- _context8.next = 16;
527
+ _context8.prev = 15;
528
+ _context8.next = 18;
528
529
  return alarmDispatchers.combAlarmData({
529
530
  alarmdata: sendAl
530
531
  });
531
532
 
532
- case 16:
533
+ case 18:
533
534
  _yield$alarmDispatche2 = _context8.sent;
534
535
  eqFlag = _yield$alarmDispatche2.eqFlag;
535
536
  alarmlist = _yield$alarmDispatche2.alarmlist;
@@ -550,20 +551,20 @@ var Alarm = /*#__PURE__*/function () {
550
551
  }
551
552
  }
552
553
 
553
- _context8.next = 25;
554
+ _context8.next = 27;
554
555
  break;
555
556
 
556
- case 22:
557
- _context8.prev = 22;
558
- _context8.t0 = _context8["catch"](13);
557
+ case 24:
558
+ _context8.prev = 24;
559
+ _context8.t0 = _context8["catch"](15);
559
560
 
560
561
  _componentTopologyUtils.rlog.error('告警发送异常', _context8.t0);
561
562
 
562
- case 25:
563
+ case 27:
563
564
  case "end":
564
565
  return _context8.stop();
565
566
  }
566
- }, _callee8, this, [[13, 22]]);
567
+ }, _callee8, this, [[15, 24]]);
567
568
  }));
568
569
 
569
570
  function handleAlarmEvent(_x6) {
@@ -54,7 +54,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
54
54
  var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
55
55
 
56
56
  // eslint-disable-next-line no-undef
57
- var version = typeof "12.0.0-dev.34" === 'string' ? "12.0.0-dev.34" : null;
57
+ var version = typeof "12.0.0-dev.35" === 'string' ? "12.0.0-dev.35" : null;
58
58
  console.info("\u62D3\u6251\u7248\u672C: " + version);
59
59
  /**
60
60
  * 拓扑显示和编辑
@@ -6,6 +6,7 @@ exports.__esModule = true;
6
6
  exports.buildTopoLinkData = buildTopoLinkData;
7
7
  exports.compatibleWith = void 0;
8
8
  exports.getLinksDetail = getLinksDetail;
9
+ exports.isAggLink = isAggLink;
9
10
  exports.isCrucialLink = isCrucialLink;
10
11
  exports.isExitLink = isExitLink;
11
12
  exports.mergeExportLinkData = void 0;
@@ -22,8 +23,6 @@ var _keyBy = _interopRequireDefault(require("lodash/keyBy"));
22
23
 
23
24
  var _lodash = _interopRequireDefault(require("lodash"));
24
25
 
25
- var _services = require("../../services");
26
-
27
26
  var _htElementUtils = require("../../../utils/htElementUtils");
28
27
 
29
28
  var _CiTypeCache = _interopRequireDefault(require("../cache/CiTypeCache"));
@@ -56,7 +55,21 @@ function isCrucialLink(link) {
56
55
 
57
56
 
58
57
  function isExitLink(link) {
59
- return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes["destination_id"]);
58
+ var _link$attributes;
59
+
60
+ return (link === null || link === void 0 ? void 0 : (_link$attributes = link.attributes) === null || _link$attributes === void 0 ? void 0 : _link$attributes.destination_type) === "ip";
61
+ }
62
+ /**
63
+ * 是否聚合链路
64
+ * @param {*} link
65
+ * @returns
66
+ */
67
+
68
+
69
+ function isAggLink(link) {
70
+ var _link$attributes2, _link$attributes3;
71
+
72
+ return (link === null || link === void 0 ? void 0 : (_link$attributes2 = link.attributes) === null || _link$attributes2 === void 0 ? void 0 : _link$attributes2.destination_type) === "network.agg_interface" && (link === null || link === void 0 ? void 0 : (_link$attributes3 = link.attributes) === null || _link$attributes3 === void 0 ? void 0 : _link$attributes3.source_type) === "network.agg_interface";
60
73
  }
61
74
 
62
75
  function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
@@ -107,7 +120,7 @@ function _getLinksDetail() {
107
120
  return _regenerator["default"].wrap(function _callee$(_context) {
108
121
  while (1) switch (_context.prev = _context.next) {
109
122
  case 0:
110
- if (!(!links || !links.length)) {
123
+ if (links !== null && links !== void 0 && links.length) {
111
124
  _context.next = 2;
112
125
  break;
113
126
  }
@@ -115,9 +128,6 @@ function _getLinksDetail() {
115
128
  return _context.abrupt("return", []);
116
129
 
117
130
  case 2:
118
- // const linkCis = await topoService.relation.batchQueryRelation(
119
- // links.map((link) => link.id)
120
- // );
121
131
  linkCis = links;
122
132
  interfaceIds = [].concat(linkCis.map(function (item) {
123
133
  return item.attributes.source_id;
@@ -200,17 +210,15 @@ var showLinkByConfig = function showLinkByConfig(props) {
200
210
  if (showType === 1 || showType === true) {
201
211
  // 单链路全部显示
202
212
  // console.log("单链路全部显示", edge);
203
- edge.s("2d.visible", true);
213
+ edge.s("x.visible", true);
204
214
  } else {
205
- var _d$attributes, _d$attributes2;
206
-
207
215
  var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
208
216
 
209
- if ((d === null || d === void 0 ? void 0 : (_d$attributes = d.attributes) === null || _d$attributes === void 0 ? void 0 : _d$attributes.destination_type) === "network.agg_interface" && (d === null || d === void 0 ? void 0 : (_d$attributes2 = d.attributes) === null || _d$attributes2 === void 0 ? void 0 : _d$attributes2.source_type) === "network.agg_interface") {
210
- edge.s("2d.visible", showAgg);
217
+ if (isAggLink(d)) {
218
+ edge.s("x.visible", showAgg);
211
219
  } else {
212
220
  // console.log("edge", edge, d, showAgg);
213
- edge.s("2d.visible", showPhy);
221
+ edge.s("x.visible", showPhy);
214
222
  }
215
223
  }
216
224
  });
@@ -69,11 +69,9 @@ function formatUrl(url) {
69
69
 
70
70
  var prefix = '/default/pagecenter';
71
71
 
72
- if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
72
+ if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) !== '-1' && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) !== '-1') {
73
73
  return url.split(prefix)[1];
74
- } else {
75
- return url;
76
- }
74
+ } else {}
77
75
  }
78
76
  /**
79
77
  * 资源概览。
@@ -371,9 +369,9 @@ function ResourceOverview(props) {
371
369
  type: record.icon,
372
370
  size: "xs",
373
371
  className: _indexModule["default"]['alarm-color-icon'] + " " + record.className
374
- }), /*#__PURE__*/_react["default"].createElement(_Link["default"], {
372
+ }), /*#__PURE__*/_react["default"].createElement("a", {
375
373
  className: _indexModule["default"].link,
376
- to: formatUrl(record.link)
374
+ href: formatUrl(record.link)
377
375
  }, value));
378
376
  }
379
377
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "12.0.0-dev.34",
3
+ "version": "12.0.0-dev.35",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -123,6 +123,6 @@
123
123
  "access": "public"
124
124
  },
125
125
  "license": "MIT",
126
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@12.0.0-dev.34/build/index.html",
126
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@12.0.0-dev.35/build/index.html",
127
127
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
128
128
  }