@riil-frontend/component-topology 9.0.0-a.4 → 9.0.0-a.6
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.
- package/build/index.js +1 -1
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +112 -122
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +7 -5
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +8 -26
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +13 -46
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +112 -122
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +7 -5
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +8 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +13 -46
- package/package.json +2 -2
@@ -35,7 +35,7 @@ var useMetricModels = function useMetricModels(props) {
|
|
35
35
|
|
36
36
|
function _fetchData() {
|
37
37
|
_fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
38
|
-
var monitorMetrics, ciMonitorMetricModels, checkMenus,
|
38
|
+
var monitorMetrics, ciMonitorMetricModels, checkMenus, displayMetricModels, _metricCodes;
|
39
39
|
|
40
40
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
41
41
|
while (1) {
|
@@ -57,61 +57,28 @@ var useMetricModels = function useMetricModels(props) {
|
|
57
57
|
case 6:
|
58
58
|
checkMenus = _context.sent;
|
59
59
|
|
60
|
-
if (
|
61
|
-
|
62
|
-
break;
|
63
|
-
}
|
64
|
-
|
65
|
-
_context.next = 10;
|
66
|
-
return isOpenFlow({
|
67
|
-
'name': resourceData.attributes.display_name
|
68
|
-
});
|
69
|
-
|
70
|
-
case 10:
|
71
|
-
isOpen = _context.sent;
|
72
|
-
|
73
|
-
//
|
74
|
-
if (isOpen) {
|
75
|
-
ciMonitorMetricModels.push({
|
60
|
+
if (checkMenus[0].passed == 'PASS' && resourceData.attributes.display_name && resourceData.attributes['network_link.is_crucial']) {
|
61
|
+
ciMonitorMetricModels.unshift({
|
76
62
|
changeValue: null,
|
77
|
-
code: "
|
78
|
-
id: "
|
63
|
+
code: "netDelayRatio",
|
64
|
+
id: "netDelayRatio",
|
79
65
|
isGoldMetric: true,
|
80
66
|
key: null,
|
81
|
-
name: "
|
67
|
+
name: "RTT时延",
|
82
68
|
unit: "ms"
|
83
69
|
});
|
84
|
-
ciMonitorMetricModels.
|
70
|
+
ciMonitorMetricModels.unshift({
|
85
71
|
changeValue: null,
|
86
|
-
code: "
|
87
|
-
id: "
|
72
|
+
code: "retansRatio",
|
73
|
+
id: "retansRatio",
|
88
74
|
isGoldMetric: true,
|
89
75
|
key: null,
|
90
|
-
name: "
|
76
|
+
name: "重传率",
|
91
77
|
unit: "%"
|
92
78
|
});
|
93
|
-
|
94
|
-
|
95
|
-
code: "upNetDelayRatio",
|
96
|
-
id: "upNetDelayRatio",
|
97
|
-
isGoldMetric: true,
|
98
|
-
key: null,
|
99
|
-
name: "上行RTT时延",
|
100
|
-
unit: "ms"
|
101
|
-
});
|
102
|
-
ciMonitorMetricModels.push({
|
103
|
-
changeValue: null,
|
104
|
-
code: "upRetransRatio",
|
105
|
-
id: "upRetransRatio",
|
106
|
-
isGoldMetric: true,
|
107
|
-
key: null,
|
108
|
-
name: "上行重传率",
|
109
|
-
unit: "%"
|
110
|
-
});
|
111
|
-
}
|
79
|
+
} // 未监控不显示指标,临时在这里处理
|
80
|
+
|
112
81
|
|
113
|
-
case 12:
|
114
|
-
// 未监控不显示指标,临时在这里处理
|
115
82
|
if (!isMonite) {
|
116
83
|
ciMonitorMetricModels = [];
|
117
84
|
}
|
@@ -143,7 +110,7 @@ var useMetricModels = function useMetricModels(props) {
|
|
143
110
|
|
144
111
|
return _context.abrupt("return", displayMetricModels);
|
145
112
|
|
146
|
-
case
|
113
|
+
case 13:
|
147
114
|
case "end":
|
148
115
|
return _context.stop();
|
149
116
|
}
|
@@ -56,7 +56,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
|
56
56
|
var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
|
57
57
|
|
58
58
|
// eslint-disable-next-line no-undef
|
59
|
-
var version = typeof "9.0.0-a.
|
59
|
+
var version = typeof "9.0.0-a.6" === 'string' ? "9.0.0-a.6" : null;
|
60
60
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
61
61
|
/**
|
62
62
|
* 拓扑显示和编辑
|
@@ -319,26 +319,26 @@ function ResourceOverview(props) {
|
|
319
319
|
|
320
320
|
|
321
321
|
function _getAddressFormat() {
|
322
|
-
_getAddressFormat = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
322
|
+
_getAddressFormat = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(_ref2) {
|
323
323
|
var owned_computer_room, owned_cabinet, start_u_location, end_u_location, address, _res$find, _res$find$attributes, _res$find2, _res$find2$attributes, res, u;
|
324
324
|
|
325
|
-
return _regenerator["default"].wrap(function
|
325
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
326
326
|
while (1) {
|
327
|
-
switch (
|
327
|
+
switch (_context3.prev = _context3.next) {
|
328
328
|
case 0:
|
329
329
|
owned_computer_room = _ref2.owned_computer_room, owned_cabinet = _ref2.owned_cabinet, start_u_location = _ref2.start_u_location, end_u_location = _ref2.end_u_location;
|
330
330
|
address = '';
|
331
331
|
|
332
332
|
if (!(owned_computer_room && owned_cabinet)) {
|
333
|
-
|
333
|
+
_context3.next = 7;
|
334
334
|
break;
|
335
335
|
}
|
336
336
|
|
337
|
-
|
337
|
+
_context3.next = 5;
|
338
338
|
return (0, _services.queryCisByIds)([owned_computer_room, owned_cabinet]);
|
339
339
|
|
340
340
|
case 5:
|
341
|
-
res =
|
341
|
+
res = _context3.sent;
|
342
342
|
address = (((_res$find = res.find(function (item) {
|
343
343
|
return item.id === owned_computer_room;
|
344
344
|
})) === null || _res$find === void 0 ? void 0 : (_res$find$attributes = _res$find.attributes) === null || _res$find$attributes === void 0 ? void 0 : _res$find$attributes.display_name) || '') + " " + (((_res$find2 = res.find(function (item) {
|
@@ -352,14 +352,14 @@ function ResourceOverview(props) {
|
|
352
352
|
u = (start_u_location || '') + "-" + (end_u_location || '');
|
353
353
|
}
|
354
354
|
|
355
|
-
return
|
355
|
+
return _context3.abrupt("return", address || u ? "" + (address || '') + (u ? " " + u : '') : '');
|
356
356
|
|
357
357
|
case 10:
|
358
358
|
case "end":
|
359
|
-
return
|
359
|
+
return _context3.stop();
|
360
360
|
}
|
361
361
|
}
|
362
|
-
},
|
362
|
+
}, _callee3);
|
363
363
|
}));
|
364
364
|
return _getAddressFormat.apply(this, arguments);
|
365
365
|
}
|
@@ -422,22 +422,22 @@ function ResourceOverview(props) {
|
|
422
422
|
}
|
423
423
|
|
424
424
|
function _alarmRiskOperation() {
|
425
|
-
_alarmRiskOperation = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
425
|
+
_alarmRiskOperation = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(type, params) {
|
426
426
|
var res;
|
427
|
-
return _regenerator["default"].wrap(function
|
427
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
428
428
|
while (1) {
|
429
|
-
switch (
|
429
|
+
switch (_context4.prev = _context4.next) {
|
430
430
|
case 0:
|
431
431
|
if (!(type === 'alarm')) {
|
432
|
-
|
432
|
+
_context4.next = 6;
|
433
433
|
break;
|
434
434
|
}
|
435
435
|
|
436
|
-
|
436
|
+
_context4.next = 3;
|
437
437
|
return _overview["default"].handleAlarm(params);
|
438
438
|
|
439
439
|
case 3:
|
440
|
-
res =
|
440
|
+
res = _context4.sent;
|
441
441
|
|
442
442
|
_message["default"].success('受理成功');
|
443
443
|
|
@@ -454,10 +454,10 @@ function ResourceOverview(props) {
|
|
454
454
|
|
455
455
|
case 6:
|
456
456
|
case "end":
|
457
|
-
return
|
457
|
+
return _context4.stop();
|
458
458
|
}
|
459
459
|
}
|
460
|
-
},
|
460
|
+
}, _callee4);
|
461
461
|
}));
|
462
462
|
return _alarmRiskOperation.apply(this, arguments);
|
463
463
|
}
|
@@ -476,31 +476,31 @@ function ResourceOverview(props) {
|
|
476
476
|
|
477
477
|
|
478
478
|
function _baseInfoColChange() {
|
479
|
-
_baseInfoColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
479
|
+
_baseInfoColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(col) {
|
480
480
|
var _col;
|
481
481
|
|
482
|
-
var infoData, attributeMap, _iterator, _step, item, value, contentTitle, _data,
|
482
|
+
var infoData, attributeMap, _iterator, _step, item, value, contentTitle, _data, _ref3, _ref3$, _item, _attributeMap, object, _object, displayName, attr;
|
483
483
|
|
484
|
-
return _regenerator["default"].wrap(function
|
484
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
485
485
|
while (1) {
|
486
|
-
switch (
|
486
|
+
switch (_context6.prev = _context6.next) {
|
487
487
|
case 0:
|
488
488
|
if ((_col = col) !== null && _col !== void 0 && _col.length) {
|
489
|
-
|
489
|
+
_context6.next = 3;
|
490
490
|
break;
|
491
491
|
}
|
492
492
|
|
493
493
|
setBaseInfo([]);
|
494
|
-
return
|
494
|
+
return _context6.abrupt("return");
|
495
495
|
|
496
496
|
case 3:
|
497
497
|
settBaseInfoInitLoading(true);
|
498
498
|
infoData = [];
|
499
|
-
|
499
|
+
_context6.next = 7;
|
500
500
|
return getAttribute(id);
|
501
501
|
|
502
502
|
case 7:
|
503
|
-
attributeMap =
|
503
|
+
attributeMap = _context6.sent;
|
504
504
|
// console.log('getAttribute', attributeMap);
|
505
505
|
col = col.filter(function (item) {
|
506
506
|
return !item.hidden;
|
@@ -509,21 +509,21 @@ function ResourceOverview(props) {
|
|
509
509
|
|
510
510
|
case 10:
|
511
511
|
if ((_step = _iterator()).done) {
|
512
|
-
|
512
|
+
_context6.next = 26;
|
513
513
|
break;
|
514
514
|
}
|
515
515
|
|
516
516
|
item = _step.value;
|
517
517
|
value = (0, _attributeFormatter.formatMetric)(attributeMap[item.dataIndex], ciTypeMeta.attributeMap[item.dataIndex]);
|
518
518
|
contentTitle = value;
|
519
|
-
return
|
519
|
+
return _context6.delegateYield( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
520
520
|
var link, address, owned_computer_room, owned_cabinet, roomLink, node;
|
521
|
-
return _regenerator["default"].wrap(function
|
521
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
522
522
|
while (1) {
|
523
|
-
switch (
|
523
|
+
switch (_context5.prev = _context5.next) {
|
524
524
|
case 0:
|
525
|
-
|
526
|
-
|
525
|
+
_context5.t0 = item.dataIndex;
|
526
|
+
_context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
|
527
527
|
break;
|
528
528
|
|
529
529
|
case 3:
|
@@ -544,19 +544,19 @@ function ResourceOverview(props) {
|
|
544
544
|
}
|
545
545
|
|
546
546
|
contentTitle = attributeMap.display_name || '-';
|
547
|
-
return
|
547
|
+
return _context5.abrupt("break", 21);
|
548
548
|
|
549
549
|
case 6:
|
550
550
|
value = ciTypeMeta.displayName;
|
551
551
|
contentTitle = value;
|
552
|
-
return
|
552
|
+
return _context5.abrupt("break", 21);
|
553
553
|
|
554
554
|
case 9:
|
555
|
-
|
555
|
+
_context5.next = 11;
|
556
556
|
return getAddressFormat(attributeMap);
|
557
557
|
|
558
558
|
case 11:
|
559
|
-
address =
|
559
|
+
address = _context5.sent;
|
560
560
|
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
561
561
|
|
562
562
|
if (owned_computer_room && owned_cabinet) {
|
@@ -575,23 +575,23 @@ function ResourceOverview(props) {
|
|
575
575
|
}
|
576
576
|
|
577
577
|
contentTitle = address;
|
578
|
-
return
|
578
|
+
return _context5.abrupt("break", 21);
|
579
579
|
|
580
580
|
case 16:
|
581
581
|
node = topo.getDataModel().getDataByTag(id);
|
582
582
|
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
583
583
|
contentTitle = value;
|
584
|
-
return
|
584
|
+
return _context5.abrupt("break", 21);
|
585
585
|
|
586
586
|
case 20:
|
587
|
-
return
|
587
|
+
return _context5.abrupt("break", 21);
|
588
588
|
|
589
589
|
case 21:
|
590
590
|
case "end":
|
591
|
-
return
|
591
|
+
return _context5.stop();
|
592
592
|
}
|
593
593
|
}
|
594
|
-
},
|
594
|
+
}, _callee5);
|
595
595
|
})(), "t0", 15);
|
596
596
|
|
597
597
|
case 15:
|
@@ -602,9 +602,9 @@ function ResourceOverview(props) {
|
|
602
602
|
}
|
603
603
|
|
604
604
|
_data = topo.attributeMetricDisplay.getData() || [];
|
605
|
-
|
605
|
+
_ref3 = [].concat(_data.filter(function (m) {
|
606
606
|
return m.id === id;
|
607
|
-
})),
|
607
|
+
})), _ref3$ = _ref3[0], _item = _ref3$ === void 0 ? {} : _ref3$;
|
608
608
|
_attributeMap = _item.attributeMap || {};
|
609
609
|
object = _attributeMap[item.dataIndex + "_object"] || {};
|
610
610
|
|
@@ -631,7 +631,7 @@ function ResourceOverview(props) {
|
|
631
631
|
}));
|
632
632
|
|
633
633
|
case 24:
|
634
|
-
|
634
|
+
_context6.next = 10;
|
635
635
|
break;
|
636
636
|
|
637
637
|
case 26:
|
@@ -640,10 +640,10 @@ function ResourceOverview(props) {
|
|
640
640
|
|
641
641
|
case 28:
|
642
642
|
case "end":
|
643
|
-
return
|
643
|
+
return _context6.stop();
|
644
644
|
}
|
645
645
|
}
|
646
|
-
},
|
646
|
+
}, _callee6);
|
647
647
|
}));
|
648
648
|
return _baseInfoColChange.apply(this, arguments);
|
649
649
|
}
|
@@ -654,44 +654,44 @@ function ResourceOverview(props) {
|
|
654
654
|
|
655
655
|
|
656
656
|
function _getAttribute() {
|
657
|
-
_getAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
658
|
-
var _yield$resourceOvervi, baseInfos, res,
|
657
|
+
_getAttribute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id) {
|
658
|
+
var _yield$resourceOvervi, baseInfos, res, _ref4, attributes;
|
659
659
|
|
660
|
-
return _regenerator["default"].wrap(function
|
660
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
661
661
|
while (1) {
|
662
|
-
switch (
|
662
|
+
switch (_context7.prev = _context7.next) {
|
663
663
|
case 0:
|
664
664
|
if (id) {
|
665
|
-
|
665
|
+
_context7.next = 2;
|
666
666
|
break;
|
667
667
|
}
|
668
668
|
|
669
|
-
return
|
669
|
+
return _context7.abrupt("return");
|
670
670
|
|
671
671
|
case 2:
|
672
672
|
if (!(resourceOverviewProps !== null && resourceOverviewProps !== void 0 && resourceOverviewProps.getData)) {
|
673
|
-
|
673
|
+
_context7.next = 9;
|
674
674
|
break;
|
675
675
|
}
|
676
676
|
|
677
|
-
|
677
|
+
_context7.next = 5;
|
678
678
|
return resourceOverviewProps === null || resourceOverviewProps === void 0 ? void 0 : resourceOverviewProps.getData({
|
679
679
|
id: id
|
680
680
|
});
|
681
681
|
|
682
682
|
case 5:
|
683
|
-
_yield$resourceOvervi =
|
683
|
+
_yield$resourceOvervi = _context7.sent;
|
684
684
|
baseInfos = _yield$resourceOvervi.baseInfos;
|
685
685
|
|
686
686
|
if (!baseInfos) {
|
687
|
-
|
687
|
+
_context7.next = 9;
|
688
688
|
break;
|
689
689
|
}
|
690
690
|
|
691
|
-
return
|
691
|
+
return _context7.abrupt("return", baseInfos);
|
692
692
|
|
693
693
|
case 9:
|
694
|
-
|
694
|
+
_context7.next = 11;
|
695
695
|
return _overview["default"].commonQueryCiData({
|
696
696
|
condition: "id('" + id + "')",
|
697
697
|
refAttribute: true,
|
@@ -704,16 +704,16 @@ function ResourceOverview(props) {
|
|
704
704
|
});
|
705
705
|
|
706
706
|
case 11:
|
707
|
-
res =
|
708
|
-
|
709
|
-
return
|
707
|
+
res = _context7.sent;
|
708
|
+
_ref4 = (res === null || res === void 0 ? void 0 : res.data[0]) || {}, attributes = _ref4.attributes;
|
709
|
+
return _context7.abrupt("return", attributes || {});
|
710
710
|
|
711
711
|
case 14:
|
712
712
|
case "end":
|
713
|
-
return
|
713
|
+
return _context7.stop();
|
714
714
|
}
|
715
715
|
}
|
716
|
-
},
|
716
|
+
}, _callee7);
|
717
717
|
}));
|
718
718
|
return _getAttribute.apply(this, arguments);
|
719
719
|
}
|
@@ -723,14 +723,14 @@ function ResourceOverview(props) {
|
|
723
723
|
}
|
724
724
|
|
725
725
|
function _metricColChange() {
|
726
|
-
_metricColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
726
|
+
_metricColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(col) {
|
727
727
|
var _col2, _col3;
|
728
728
|
|
729
|
-
var codes, endTime, params,
|
729
|
+
var codes, endTime, params, _ref5, times, metricList, newMetricList, metricLists;
|
730
730
|
|
731
|
-
return _regenerator["default"].wrap(function
|
731
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
732
732
|
while (1) {
|
733
|
-
switch (
|
733
|
+
switch (_context8.prev = _context8.next) {
|
734
734
|
case 0:
|
735
735
|
// console.log('metricColChange col', col);
|
736
736
|
col = (_col2 = col) === null || _col2 === void 0 ? void 0 : _col2.filter(function (item) {
|
@@ -738,13 +738,13 @@ function ResourceOverview(props) {
|
|
738
738
|
});
|
739
739
|
|
740
740
|
if ((_col3 = col) !== null && _col3 !== void 0 && _col3.length) {
|
741
|
-
|
741
|
+
_context8.next = 4;
|
742
742
|
break;
|
743
743
|
}
|
744
744
|
|
745
745
|
setMetric([]); // Message.error('指标未设置')
|
746
746
|
|
747
|
-
return
|
747
|
+
return _context8.abrupt("return");
|
748
748
|
|
749
749
|
case 4:
|
750
750
|
codes = col.map(function (item) {
|
@@ -760,7 +760,7 @@ function ResourceOverview(props) {
|
|
760
760
|
};
|
761
761
|
|
762
762
|
if (isAppTopo) {
|
763
|
-
|
763
|
+
_ref5 = resourceOverviewProps.metricProps || {}, times = _ref5.times;
|
764
764
|
|
765
765
|
if (times !== null && times !== void 0 && times.length) {
|
766
766
|
params.startTime = times[0];
|
@@ -769,16 +769,20 @@ function ResourceOverview(props) {
|
|
769
769
|
}
|
770
770
|
|
771
771
|
setMetricInitLoading(true);
|
772
|
-
|
772
|
+
_context8.next = 11;
|
773
773
|
return _overview["default"].getMetricList(params);
|
774
774
|
|
775
775
|
case 11:
|
776
|
-
metricList =
|
777
|
-
|
776
|
+
metricList = _context8.sent;
|
777
|
+
_context8.next = 14;
|
778
|
+
return queryMetricList({
|
778
779
|
'name': data.attributes.display_name
|
779
780
|
}, {
|
780
781
|
'id': data.attributes.name
|
781
782
|
});
|
783
|
+
|
784
|
+
case 14:
|
785
|
+
newMetricList = _context8.sent;
|
782
786
|
metricLists = metricList.concat(getNewMetricList(newMetricList));
|
783
787
|
|
784
788
|
_rlog.rlog.debug('metricColChange', metricLists, monitorMetricModels);
|
@@ -807,105 +811,91 @@ function ResourceOverview(props) {
|
|
807
811
|
}, 60000);
|
808
812
|
}
|
809
813
|
|
810
|
-
case
|
814
|
+
case 20:
|
811
815
|
case "end":
|
812
|
-
return
|
816
|
+
return _context8.stop();
|
813
817
|
}
|
814
818
|
}
|
815
|
-
},
|
819
|
+
}, _callee8);
|
816
820
|
}));
|
817
821
|
return _metricColChange.apply(this, arguments);
|
818
822
|
}
|
819
823
|
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
+
function queryMetricList(_x9, _x10) {
|
825
|
+
return _queryMetricList.apply(this, arguments);
|
826
|
+
}
|
827
|
+
|
828
|
+
function _queryMetricList() {
|
829
|
+
_queryMetricList = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(data, param) {
|
830
|
+
var checkMenus, isOpen, list;
|
831
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
824
832
|
while (1) {
|
825
|
-
switch (
|
833
|
+
switch (_context9.prev = _context9.next) {
|
826
834
|
case 0:
|
827
835
|
if (!(ciType !== 'network_link')) {
|
828
|
-
|
836
|
+
_context9.next = 2;
|
829
837
|
break;
|
830
838
|
}
|
831
839
|
|
832
|
-
return
|
840
|
+
return _context9.abrupt("return", []);
|
833
841
|
|
834
842
|
case 2:
|
835
|
-
|
843
|
+
_context9.next = 4;
|
836
844
|
return (0, _services2.checkMenu)();
|
837
845
|
|
838
846
|
case 4:
|
839
|
-
checkMenus =
|
847
|
+
checkMenus = _context9.sent;
|
840
848
|
|
841
849
|
if (!(checkMenus[0].passed == 'PASS')) {
|
842
|
-
|
850
|
+
_context9.next = 14;
|
843
851
|
break;
|
844
852
|
}
|
845
853
|
|
846
|
-
|
854
|
+
_context9.next = 8;
|
847
855
|
return (0, _services2.isOpenFlow)(data);
|
848
856
|
|
849
857
|
case 8:
|
850
|
-
isOpen =
|
858
|
+
isOpen = _context9.sent;
|
851
859
|
|
852
860
|
if (!isOpen) {
|
853
|
-
|
861
|
+
_context9.next = 14;
|
854
862
|
break;
|
855
863
|
}
|
856
864
|
|
857
|
-
|
865
|
+
_context9.next = 12;
|
858
866
|
return (0, _services2.queryLastestValue)(param);
|
859
867
|
|
860
868
|
case 12:
|
861
|
-
|
862
|
-
|
863
|
-
case 13:
|
864
|
-
return _context3.abrupt("return", []);
|
869
|
+
list = _context9.sent;
|
870
|
+
return _context9.abrupt("return", list);
|
865
871
|
|
866
872
|
case 14:
|
873
|
+
return _context9.abrupt("return", []);
|
874
|
+
|
875
|
+
case 15:
|
867
876
|
case "end":
|
868
|
-
return
|
877
|
+
return _context9.stop();
|
869
878
|
}
|
870
879
|
}
|
871
|
-
},
|
880
|
+
}, _callee9);
|
872
881
|
}));
|
873
|
-
|
874
|
-
|
875
|
-
return _ref3.apply(this, arguments);
|
876
|
-
};
|
877
|
-
}();
|
882
|
+
return _queryMetricList.apply(this, arguments);
|
883
|
+
}
|
878
884
|
|
879
885
|
var getNewMetricList = function getNewMetricList(data) {
|
880
886
|
return [{
|
881
887
|
errorMsg: null,
|
882
|
-
mainCiId: "
|
883
|
-
metricCode: "
|
884
|
-
metricValue: data.downNetDelayRatio,
|
885
|
-
subCiId: '',
|
886
|
-
subCiType: null,
|
887
|
-
mainCiType: null
|
888
|
-
}, {
|
889
|
-
errorMsg: null,
|
890
|
-
mainCiId: "downRetansRatio",
|
891
|
-
metricCode: "downRetansRatio",
|
892
|
-
metricValue: data.downRetansRatio,
|
893
|
-
subCiId: '',
|
894
|
-
subCiType: null,
|
895
|
-
mainCiType: null
|
896
|
-
}, {
|
897
|
-
errorMsg: null,
|
898
|
-
mainCiId: "upNetDelayRatio",
|
899
|
-
metricCode: "upNetDelayRatio",
|
900
|
-
metricValue: data.upNetDelayRatio,
|
888
|
+
mainCiId: "netDelayRatio",
|
889
|
+
metricCode: "netDelayRatio",
|
890
|
+
metricValue: data.upNetDelayRatio + ' ms' + '|' + data.downNetDelayRatio + ' ms',
|
901
891
|
subCiId: '',
|
902
892
|
subCiType: null,
|
903
893
|
mainCiType: null
|
904
894
|
}, {
|
905
895
|
errorMsg: null,
|
906
|
-
mainCiId: "
|
907
|
-
metricCode: "
|
908
|
-
metricValue: data.upRetransRatio,
|
896
|
+
mainCiId: "retansRatio",
|
897
|
+
metricCode: "retansRatio",
|
898
|
+
metricValue: data.upRetransRatio + ' %' + '|' + data.downRetansRatio + ' %',
|
909
899
|
subCiId: '',
|
910
900
|
subCiType: null,
|
911
901
|
mainCiType: null
|
@@ -35,9 +35,9 @@ function LinkTopoCard(props) {
|
|
35
35
|
|
36
36
|
var supportTemplates = (data === null || data === void 0 ? void 0 : (_data$attributes = data.attributes) === null || _data$attributes === void 0 ? void 0 : _data$attributes.support_templates) || ''; // 该资源监控模板
|
37
37
|
|
38
|
-
var isCrucial = data === null || data === void 0 ? void 0 : data.attributes['network_link.is_crucial'];
|
38
|
+
var isCrucial = data === null || data === void 0 ? void 0 : data.attributes['network_link.is_crucial']; //是不是关键链路
|
39
39
|
|
40
|
-
var _useState = (0, _react.useState)(
|
40
|
+
var _useState = (0, _react.useState)(null),
|
41
41
|
openFlow = _useState[0],
|
42
42
|
setOpenFlow = _useState[1];
|
43
43
|
|
@@ -73,12 +73,12 @@ function LinkTopoCard(props) {
|
|
73
73
|
//判断是不是有流量分析
|
74
74
|
if (isOpen) {
|
75
75
|
setOpenFlow({
|
76
|
-
name: '
|
76
|
+
name: '查看流量构成',
|
77
77
|
url: linkDetailsUrl
|
78
78
|
});
|
79
79
|
} else {
|
80
80
|
setOpenFlow({
|
81
|
-
name: '
|
81
|
+
name: '配置流量分析',
|
82
82
|
url: analysisUrl
|
83
83
|
});
|
84
84
|
}
|
@@ -119,7 +119,9 @@ function LinkTopoCard(props) {
|
|
119
119
|
})
|
120
120
|
}, /*#__PURE__*/_react["default"].createElement(_LinkTopo["default"], {
|
121
121
|
data: data,
|
122
|
-
linkMetricCodes: metricCodes
|
122
|
+
linkMetricCodes: openFlow && openFlow.name == '查看流量构成' ? metricCodes : metricCodes.filter(function (i) {
|
123
|
+
return i != 'netDelayRatio' && i != 'retansRatio';
|
124
|
+
}),
|
123
125
|
openFlow: openFlow
|
124
126
|
}));
|
125
127
|
}
|