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

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,53 @@ 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; // 跳转3D机房定位设备
639
+
640
+ if (owned_computer_room && owned_cabinet) {
641
+ // /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
642
+ roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
643
+ value = /*#__PURE__*/_react["default"].createElement("span", {
644
+ onClick: onClose
645
+ }, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
646
+ className: _indexModule["default"].link,
647
+ title: address,
648
+ to: roomLink,
649
+ target: "_blank"
650
+ }, address));
651
+ } else {
652
+ value = address;
653
+ }
640
654
 
641
- case 30:
655
+ contentTitle = address;
656
+ return _context5.abrupt("break", 37);
657
+
658
+ case 32:
642
659
  node = topo.getDataModel().getDataByTag(id);
643
660
  value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
644
661
  contentTitle = value;
645
- return _context5.abrupt("break", 35);
662
+ return _context5.abrupt("break", 37);
646
663
 
647
- case 34:
648
- return _context5.abrupt("break", 35);
664
+ case 36:
665
+ return _context5.abrupt("break", 37);
649
666
 
650
- case 35:
667
+ case 37:
651
668
  // 拿翻译字段属性数据
652
669
  if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
653
670
  value = attributeMap[item.dataIndex + ".name"];
@@ -683,15 +700,15 @@ function ResourceOverview(props) {
683
700
  contentTitle: contentTitle
684
701
  }));
685
702
 
686
- case 44:
703
+ case 46:
687
704
  _context5.next = 11;
688
705
  break;
689
706
 
690
- case 46:
707
+ case 48:
691
708
  settBaseInfoInitLoading(false);
692
709
  setBaseInfo(infoData);
693
710
 
694
- case 48:
711
+ case 50:
695
712
  case "end":
696
713
  return _context5.stop();
697
714
  }
@@ -727,8 +744,8 @@ function ResourceOverview(props) {
727
744
  condition: "id('" + id + "')",
728
745
  refAttribute: true,
729
746
  orders: [{
730
- name: "CREATED_TIME",
731
- type: "asc"
747
+ name: 'CREATED_TIME',
748
+ type: 'asc'
732
749
  }],
733
750
  pageIndex: 1,
734
751
  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.23",
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.23/build/index.html",
119
119
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
120
120
  }