@riil-frontend/component-topology 5.0.0-alpha.21 → 5.0.0-alpha.22

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.
@@ -570,7 +570,7 @@ function ResourceOverview(props) {
570
570
  _baseInfoColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(col) {
571
571
  var _col;
572
572
 
573
- var infoData, attributeMap, _iterator, _step, item, value, contentTitle, link, node, _data, _ref2, _ref2$, _item, _attributeMap, object, _object, displayName, attr;
573
+ var infoData, attributeMap, _iterator, _step, item, value, contentTitle, link, address, owned_computer_room, owned_cabinet, roomLink, node, _data, _ref2, _ref2$, _item, _attributeMap, object, _object, displayName, attr;
574
574
 
575
575
  return _regenerator["default"].wrap(function _callee5$(_context5) {
576
576
  while (1) {
@@ -600,7 +600,7 @@ function ResourceOverview(props) {
600
600
 
601
601
  case 11:
602
602
  if ((_step = _iterator()).done) {
603
- _context5.next = 46;
603
+ _context5.next = 48;
604
604
  break;
605
605
  }
606
606
 
@@ -608,7 +608,7 @@ function ResourceOverview(props) {
608
608
  value = (0, _attributeFormatter.formatMetric)(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
609
609
  contentTitle = value;
610
610
  _context5.t0 = item.dataIndex;
611
- _context5.next = _context5.t0 === 'display_name' ? 18 : _context5.t0 === 'ciName' ? 22 : _context5.t0 === 'res_address' ? 25 : _context5.t0 === 'imageName' ? 30 : 34;
611
+ _context5.next = _context5.t0 === 'display_name' ? 18 : _context5.t0 === 'ciName' ? 22 : _context5.t0 === 'res_address' ? 25 : _context5.t0 === 'imageName' ? 32 : 36;
612
612
  break;
613
613
 
614
614
  case 18:
@@ -618,36 +618,52 @@ function ResourceOverview(props) {
618
618
  onClick: onClose
619
619
  }, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
620
620
  className: _indexModule["default"].link,
621
- title: attributeMap.display_name || "",
621
+ title: attributeMap.display_name || '',
622
622
  to: formatUrl(link)
623
- }, attributeMap.display_name || "-"));
624
- contentTitle = attributeMap.display_name || "-";
625
- return _context5.abrupt("break", 35);
623
+ }, attributeMap.display_name || '-'));
624
+ contentTitle = attributeMap.display_name || '-';
625
+ return _context5.abrupt("break", 37);
626
626
 
627
627
  case 22:
628
628
  value = ciTypeMeta.displayName;
629
629
  contentTitle = value;
630
- return _context5.abrupt("break", 35);
630
+ return _context5.abrupt("break", 37);
631
631
 
632
632
  case 25:
633
633
  _context5.next = 27;
634
634
  return getAddressFormat(attributeMap);
635
635
 
636
636
  case 27:
637
- value = _context5.sent;
638
- contentTitle = value;
639
- return _context5.abrupt("break", 35);
637
+ address = _context5.sent;
638
+ owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet;
639
+
640
+ if (owned_computer_room && owned_cabinet) {
641
+ roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&device_id=" + owned_cabinet;
642
+ value = /*#__PURE__*/_react["default"].createElement("span", {
643
+ onClick: onClose
644
+ }, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
645
+ className: _indexModule["default"].link,
646
+ title: address,
647
+ to: roomLink,
648
+ target: "_blank"
649
+ }, address));
650
+ } else {
651
+ value = address;
652
+ }
640
653
 
641
- case 30:
654
+ contentTitle = address;
655
+ return _context5.abrupt("break", 37);
656
+
657
+ case 32:
642
658
  node = topo.getDataModel().getDataByTag(id);
643
659
  value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
644
660
  contentTitle = value;
645
- return _context5.abrupt("break", 35);
661
+ return _context5.abrupt("break", 37);
646
662
 
647
- case 34:
648
- return _context5.abrupt("break", 35);
663
+ case 36:
664
+ return _context5.abrupt("break", 37);
649
665
 
650
- case 35:
666
+ case 37:
651
667
  // 拿翻译字段属性数据
652
668
  if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
653
669
  value = attributeMap[item.dataIndex + ".name"];
@@ -683,15 +699,15 @@ function ResourceOverview(props) {
683
699
  contentTitle: contentTitle
684
700
  }));
685
701
 
686
- case 44:
702
+ case 46:
687
703
  _context5.next = 11;
688
704
  break;
689
705
 
690
- case 46:
706
+ case 48:
691
707
  settBaseInfoInitLoading(false);
692
708
  setBaseInfo(infoData);
693
709
 
694
- case 48:
710
+ case 50:
695
711
  case "end":
696
712
  return _context5.stop();
697
713
  }
@@ -727,8 +743,8 @@ function ResourceOverview(props) {
727
743
  condition: "id('" + id + "')",
728
744
  refAttribute: true,
729
745
  orders: [{
730
- name: "CREATED_TIME",
731
- type: "asc"
746
+ name: 'CREATED_TIME',
747
+ type: 'asc'
732
748
  }],
733
749
  pageIndex: 1,
734
750
  pageSize: 100000
@@ -9,14 +9,53 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _componentCrucialLinkTopo = _interopRequireDefault(require("@riil-frontend/component-crucial-link-topo"));
11
11
 
12
+ var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
13
+
12
14
  var _LinkTopoModule = _interopRequireDefault(require("./LinkTopo.module.scss"));
13
15
 
14
16
  function LinkTopo(props) {
17
+ var data = props.data; // 资源节点上方色块展示资源的发送速率发送带宽利用率、接收速率发送接收利用率、总错包数
18
+
19
+ var sourceMetrics = {
20
+ out_rate: '5M/s',
21
+ // 发送速率
22
+ out_bandwidth_utilization: '20%',
23
+ // 发送带宽利用率
24
+ in_rate: '6M/s',
25
+ // 接收速率
26
+ in_bandwidth_utilization: '15%',
27
+ // 接收带宽利用率
28
+ total_errors_packets: '151' // 总错包数
29
+
30
+ };
31
+ var destinationMetrics = {
32
+ out_rate: '5M/s',
33
+ // 发送速率
34
+ out_bandwidth_utilization: '20%',
35
+ // 发送带宽利用率
36
+ in_rate: '6M/s',
37
+ // 接收速率
38
+ in_bandwidth_utilization: '15%',
39
+ // 接收带宽利用率
40
+ total_errors_packets: '151' // 总错包数
41
+
42
+ };
43
+ var linkMetrics = [{
44
+ code: 'xxxx',
45
+ name: '端到端ping时延',
46
+ value: '500ms'
47
+ }];
15
48
  return /*#__PURE__*/_react["default"].createElement("div", {
16
49
  className: _LinkTopoModule["default"].container
17
50
  }, /*#__PURE__*/_react["default"].createElement(_componentCrucialLinkTopo["default"], {
18
- request: null,
19
- data: null // 链路ci数据
51
+ request: _componentTopologyUtils.request,
52
+ data: data // 链路ci数据
53
+ ,
54
+ sourceMetrics: sourceMetrics // 源设备指标列表
55
+ ,
56
+ destinationMetrics: destinationMetrics // 目的设备指标列表
57
+ ,
58
+ linkMetrics: linkMetrics // 链路指标列表
20
59
 
21
60
  }));
22
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "5.0.0-alpha.21",
3
+ "version": "5.0.0-alpha.22",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -115,6 +115,6 @@
115
115
  "access": "public"
116
116
  },
117
117
  "license": "MIT",
118
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@5.0.0-alpha.21/build/index.html",
118
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@5.0.0-alpha.22/build/index.html",
119
119
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
120
120
  }