@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.
@@ -539,7 +539,7 @@ export default function ResourceOverview(props) {
539
539
  _baseInfoColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(col) {
540
540
  var _col;
541
541
 
542
- var infoData, attributeMap, _iterator, _step, item, value, contentTitle, link, node, _data, _ref2, _ref2$, _item, _attributeMap, object, _object, displayName, attr;
542
+ 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;
543
543
 
544
544
  return _regeneratorRuntime.wrap(function _callee5$(_context5) {
545
545
  while (1) {
@@ -569,7 +569,7 @@ export default function ResourceOverview(props) {
569
569
 
570
570
  case 11:
571
571
  if ((_step = _iterator()).done) {
572
- _context5.next = 46;
572
+ _context5.next = 48;
573
573
  break;
574
574
  }
575
575
 
@@ -577,7 +577,7 @@ export default function ResourceOverview(props) {
577
577
  value = formatMetric(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
578
578
  contentTitle = value;
579
579
  _context5.t0 = item.dataIndex;
580
- _context5.next = _context5.t0 === 'display_name' ? 18 : _context5.t0 === 'ciName' ? 22 : _context5.t0 === 'res_address' ? 25 : _context5.t0 === 'imageName' ? 30 : 34;
580
+ _context5.next = _context5.t0 === 'display_name' ? 18 : _context5.t0 === 'ciName' ? 22 : _context5.t0 === 'res_address' ? 25 : _context5.t0 === 'imageName' ? 32 : 36;
581
581
  break;
582
582
 
583
583
  case 18:
@@ -587,36 +587,52 @@ export default function ResourceOverview(props) {
587
587
  onClick: onClose
588
588
  }, /*#__PURE__*/React.createElement(Link, {
589
589
  className: styles.link,
590
- title: attributeMap.display_name || "",
590
+ title: attributeMap.display_name || '',
591
591
  to: formatUrl(link)
592
- }, attributeMap.display_name || "-"));
593
- contentTitle = attributeMap.display_name || "-";
594
- return _context5.abrupt("break", 35);
592
+ }, attributeMap.display_name || '-'));
593
+ contentTitle = attributeMap.display_name || '-';
594
+ return _context5.abrupt("break", 37);
595
595
 
596
596
  case 22:
597
597
  value = ciTypeMeta.displayName;
598
598
  contentTitle = value;
599
- return _context5.abrupt("break", 35);
599
+ return _context5.abrupt("break", 37);
600
600
 
601
601
  case 25:
602
602
  _context5.next = 27;
603
603
  return getAddressFormat(attributeMap);
604
604
 
605
605
  case 27:
606
- value = _context5.sent;
607
- contentTitle = value;
608
- return _context5.abrupt("break", 35);
606
+ address = _context5.sent;
607
+ owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet;
608
+
609
+ if (owned_computer_room && owned_cabinet) {
610
+ roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&device_id=" + owned_cabinet;
611
+ value = /*#__PURE__*/React.createElement("span", {
612
+ onClick: onClose
613
+ }, /*#__PURE__*/React.createElement(Link, {
614
+ className: styles.link,
615
+ title: address,
616
+ to: roomLink,
617
+ target: "_blank"
618
+ }, address));
619
+ } else {
620
+ value = address;
621
+ }
609
622
 
610
- case 30:
623
+ contentTitle = address;
624
+ return _context5.abrupt("break", 37);
625
+
626
+ case 32:
611
627
  node = topo.getDataModel().getDataByTag(id);
612
628
  value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
613
629
  contentTitle = value;
614
- return _context5.abrupt("break", 35);
630
+ return _context5.abrupt("break", 37);
615
631
 
616
- case 34:
617
- return _context5.abrupt("break", 35);
632
+ case 36:
633
+ return _context5.abrupt("break", 37);
618
634
 
619
- case 35:
635
+ case 37:
620
636
  // 拿翻译字段属性数据
621
637
  if (attributeMap[item.dataIndex] && attributeMap[item.dataIndex + ".name"]) {
622
638
  value = attributeMap[item.dataIndex + ".name"];
@@ -652,15 +668,15 @@ export default function ResourceOverview(props) {
652
668
  contentTitle: contentTitle
653
669
  }));
654
670
 
655
- case 44:
671
+ case 46:
656
672
  _context5.next = 11;
657
673
  break;
658
674
 
659
- case 46:
675
+ case 48:
660
676
  settBaseInfoInitLoading(false);
661
677
  setBaseInfo(infoData);
662
678
 
663
- case 48:
679
+ case 50:
664
680
  case "end":
665
681
  return _context5.stop();
666
682
  }
@@ -696,8 +712,8 @@ export default function ResourceOverview(props) {
696
712
  condition: "id('" + id + "')",
697
713
  refAttribute: true,
698
714
  orders: [{
699
- name: "CREATED_TIME",
700
- type: "asc"
715
+ name: 'CREATED_TIME',
716
+ type: 'asc'
701
717
  }],
702
718
  pageIndex: 1,
703
719
  pageSize: 100000
@@ -1,12 +1,50 @@
1
1
  import React from 'react';
2
2
  import CrucialLinkTopo from '@riil-frontend/component-crucial-link-topo';
3
+ import { request } from '@riil-frontend/component-topology-utils';
3
4
  import styles from "./LinkTopo.module.scss";
4
5
  export default function LinkTopo(props) {
6
+ var data = props.data; // 资源节点上方色块展示资源的发送速率发送带宽利用率、接收速率发送接收利用率、总错包数
7
+
8
+ var sourceMetrics = {
9
+ out_rate: '5M/s',
10
+ // 发送速率
11
+ out_bandwidth_utilization: '20%',
12
+ // 发送带宽利用率
13
+ in_rate: '6M/s',
14
+ // 接收速率
15
+ in_bandwidth_utilization: '15%',
16
+ // 接收带宽利用率
17
+ total_errors_packets: '151' // 总错包数
18
+
19
+ };
20
+ var destinationMetrics = {
21
+ out_rate: '5M/s',
22
+ // 发送速率
23
+ out_bandwidth_utilization: '20%',
24
+ // 发送带宽利用率
25
+ in_rate: '6M/s',
26
+ // 接收速率
27
+ in_bandwidth_utilization: '15%',
28
+ // 接收带宽利用率
29
+ total_errors_packets: '151' // 总错包数
30
+
31
+ };
32
+ var linkMetrics = [{
33
+ code: 'xxxx',
34
+ name: '端到端ping时延',
35
+ value: '500ms'
36
+ }];
5
37
  return /*#__PURE__*/React.createElement("div", {
6
38
  className: styles.container
7
39
  }, /*#__PURE__*/React.createElement(CrucialLinkTopo, {
8
- request: null,
9
- data: null // 链路ci数据
40
+ request: request,
41
+ data: data // 链路ci数据
42
+ ,
43
+ sourceMetrics: sourceMetrics // 源设备指标列表
44
+ ,
45
+ destinationMetrics: destinationMetrics // 目的设备指标列表
46
+ ,
47
+ linkMetrics: linkMetrics // 链路指标列表
10
48
 
11
49
  }));
12
50
  }