@riil-frontend/component-topology 9.0.0-a.1 → 9.0.0-a.10
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/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +17 -17
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +1 -1
- package/es/core/event/topoEventListener.js +22 -0
- package/es/core/hooks/useAlarm.js +18 -12
- package/es/core/hooks/useCiAttributeChange.js +60 -0
- package/es/core/hooks/usePolling.js +163 -60
- package/es/core/hooks/useTopoEventListener.js +4 -18
- package/es/core/models/Alarm.js +4 -13
- package/es/core/models/AttributeMetricDisplay.js +44 -127
- package/es/core/models/TopoApp.js +4 -2
- package/es/core/models/attributeFormatter/index.js +5 -6
- package/es/core/models/cache/CiCache.d.ts +18 -0
- package/es/core/models/cache/CiCache.js +78 -0
- package/es/core/models/utils/linkUtils.js +10 -13
- package/es/core/store/models/topoBizMod.js +4 -0
- package/es/core/store/models/viewer/resourceDetail.js +7 -0
- package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +10 -9
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +100 -46
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +8 -6
- 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 -52
- package/es/style.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +1 -1
- package/lib/core/event/topoEventListener.js +27 -0
- package/lib/core/hooks/useAlarm.js +19 -12
- package/lib/core/hooks/useCiAttributeChange.js +70 -0
- package/lib/core/hooks/usePolling.js +166 -61
- package/lib/core/hooks/useTopoEventListener.js +3 -17
- package/lib/core/models/Alarm.js +5 -16
- package/lib/core/models/AttributeMetricDisplay.js +44 -126
- package/lib/core/models/TopoApp.js +4 -1
- package/lib/core/models/attributeFormatter/index.js +5 -7
- package/lib/core/models/cache/CiCache.d.ts +18 -0
- package/lib/core/models/cache/CiCache.js +89 -0
- package/lib/core/models/utils/linkUtils.js +10 -12
- package/lib/core/store/models/topoBizMod.js +4 -0
- package/lib/core/store/models/viewer/resourceDetail.js +7 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +10 -9
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +99 -45
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +8 -6
- 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 -53
- package/lib/style.js +1 -1
- package/package.json +3 -3
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* Ci缓存
|
3
|
+
*/
|
4
|
+
declare class CiCache {
|
5
|
+
/**
|
6
|
+
* @param {object<string, object>}
|
7
|
+
*/
|
8
|
+
ciMap: {};
|
9
|
+
/**
|
10
|
+
*
|
11
|
+
* @param ids {string[]}
|
12
|
+
* @returns {Promise<Object>}
|
13
|
+
*/
|
14
|
+
load(ids: string[]): Promise<Object>;
|
15
|
+
getCi(id: string): Object;
|
16
|
+
}
|
17
|
+
declare const _default: CiCache;
|
18
|
+
export default _default;
|
@@ -0,0 +1,89 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
9
|
+
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
11
|
+
|
12
|
+
var _services = require("../../services");
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Ci缓存
|
16
|
+
*/
|
17
|
+
var CiCache = /*#__PURE__*/function () {
|
18
|
+
function CiCache() {
|
19
|
+
this.ciMap = {};
|
20
|
+
}
|
21
|
+
|
22
|
+
var _proto = CiCache.prototype;
|
23
|
+
|
24
|
+
/**
|
25
|
+
*
|
26
|
+
* @param ids {string[]}
|
27
|
+
* @returns {Promise<Object>}
|
28
|
+
*/
|
29
|
+
_proto.load =
|
30
|
+
/*#__PURE__*/
|
31
|
+
function () {
|
32
|
+
var _load = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(ids) {
|
33
|
+
var _this = this;
|
34
|
+
|
35
|
+
var unloadCiIds, cis, map;
|
36
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
37
|
+
while (1) {
|
38
|
+
switch (_context.prev = _context.next) {
|
39
|
+
case 0:
|
40
|
+
unloadCiIds = ids.filter(function (id) {
|
41
|
+
return !_this.ciMap[id];
|
42
|
+
});
|
43
|
+
|
44
|
+
if (!unloadCiIds.length) {
|
45
|
+
_context.next = 6;
|
46
|
+
break;
|
47
|
+
}
|
48
|
+
|
49
|
+
_context.next = 4;
|
50
|
+
return (0, _services.queryCisByIds)(unloadCiIds);
|
51
|
+
|
52
|
+
case 4:
|
53
|
+
cis = _context.sent;
|
54
|
+
cis.forEach(function (ci) {
|
55
|
+
_this.ciMap[ci.id] = ci;
|
56
|
+
});
|
57
|
+
|
58
|
+
case 6:
|
59
|
+
map = {};
|
60
|
+
ids.forEach(function (id) {
|
61
|
+
map[id] = _this.ciMap[id];
|
62
|
+
});
|
63
|
+
return _context.abrupt("return", this.ciMap);
|
64
|
+
|
65
|
+
case 9:
|
66
|
+
case "end":
|
67
|
+
return _context.stop();
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}, _callee, this);
|
71
|
+
}));
|
72
|
+
|
73
|
+
function load(_x) {
|
74
|
+
return _load.apply(this, arguments);
|
75
|
+
}
|
76
|
+
|
77
|
+
return load;
|
78
|
+
}();
|
79
|
+
|
80
|
+
_proto.getCi = function getCi(id) {
|
81
|
+
return this.ciMap[id];
|
82
|
+
};
|
83
|
+
|
84
|
+
return CiCache;
|
85
|
+
}();
|
86
|
+
|
87
|
+
var _default = new CiCache();
|
88
|
+
|
89
|
+
exports["default"] = _default;
|
@@ -27,6 +27,8 @@ var _htElementUtils = require("../../../utils/htElementUtils");
|
|
27
27
|
|
28
28
|
var _CiTypeCache = _interopRequireDefault(require("../cache/CiTypeCache"));
|
29
29
|
|
30
|
+
var _CiCache = _interopRequireDefault(require("../cache/CiCache"));
|
31
|
+
|
30
32
|
// 查询所有连线
|
31
33
|
// const interfaceTypeMap = {
|
32
34
|
// "network.interface": {
|
@@ -56,10 +58,10 @@ function isExitLink(link) {
|
|
56
58
|
return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes['destination_id']);
|
57
59
|
}
|
58
60
|
|
59
|
-
function mergeLinksData(links, linkCis, nodes,
|
61
|
+
function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
|
60
62
|
var linkCiMap = (0, _keyBy["default"])(links, 'id');
|
61
63
|
return links.map(function (link) {
|
62
|
-
var
|
64
|
+
var _interfaceCiMap$attri, _interfaceCiMap$attri2;
|
63
65
|
|
64
66
|
var linkCi = linkCiMap[link.id];
|
65
67
|
var attributes = (0, _extends2["default"])({}, linkCi === null || linkCi === void 0 ? void 0 : linkCi.attributes);
|
@@ -84,14 +86,10 @@ function mergeLinksData(links, linkCis, nodes, interfaceCis, interfaceDoc) {
|
|
84
86
|
destination_type_object: interfaceDoc[attributes.destination_type],
|
85
87
|
// 源/目的接口
|
86
88
|
source_id_object: {
|
87
|
-
displayName: (
|
88
|
-
return node.id === attributes.source_id;
|
89
|
-
})) === null || _interfaceCis$find === void 0 ? void 0 : _interfaceCis$find.attributes['display_name']
|
89
|
+
displayName: (_interfaceCiMap$attri = interfaceCiMap[attributes.source_id]) === null || _interfaceCiMap$attri === void 0 ? void 0 : _interfaceCiMap$attri.attributes['display_name']
|
90
90
|
},
|
91
91
|
destination_id_object: {
|
92
|
-
displayName: (
|
93
|
-
return node.id === attributes.destination_id;
|
94
|
-
})) === null || _interfaceCis$find2 === void 0 ? void 0 : _interfaceCis$find2.attributes['display_name']
|
92
|
+
displayName: (_interfaceCiMap$attri2 = interfaceCiMap[attributes.destination_id]) === null || _interfaceCiMap$attri2 === void 0 ? void 0 : _interfaceCiMap$attri2.attributes['display_name']
|
95
93
|
}
|
96
94
|
})
|
97
95
|
});
|
@@ -104,7 +102,7 @@ function getLinksDetail(_x, _x2) {
|
|
104
102
|
|
105
103
|
function _getLinksDetail() {
|
106
104
|
_getLinksDetail = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(links, nodes) {
|
107
|
-
var linkCis, interfaceIds, interfaceTypes,
|
105
|
+
var linkCis, interfaceIds, interfaceTypes, interfaceCiMap, interfaceDoc;
|
108
106
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
109
107
|
while (1) {
|
110
108
|
switch (_context.prev = _context.next) {
|
@@ -134,16 +132,16 @@ function _getLinksDetail() {
|
|
134
132
|
return item !== 'ip';
|
135
133
|
});
|
136
134
|
_context.next = 7;
|
137
|
-
return
|
135
|
+
return _CiCache["default"].load(interfaceIds);
|
138
136
|
|
139
137
|
case 7:
|
140
|
-
|
138
|
+
interfaceCiMap = _context.sent;
|
141
139
|
_context.next = 10;
|
142
140
|
return _CiTypeCache["default"].getCiTypeMap(interfaceTypes);
|
143
141
|
|
144
142
|
case 10:
|
145
143
|
interfaceDoc = _context.sent;
|
146
|
-
return _context.abrupt("return", mergeLinksData(links, linkCis, nodes,
|
144
|
+
return _context.abrupt("return", mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc));
|
147
145
|
|
148
146
|
case 12:
|
149
147
|
case "end":
|
@@ -98,9 +98,7 @@ function ResourceDetailDrawer(props) {
|
|
98
98
|
}, []); // 解决切换拓扑图隐藏概览
|
99
99
|
|
100
100
|
(0, _react.useEffect)(function () {
|
101
|
-
|
102
|
-
visible: false
|
103
|
-
}); // TODO 其他数据重置
|
101
|
+
close(); // TODO 其他数据重置
|
104
102
|
}, [topoId]);
|
105
103
|
|
106
104
|
function getUser() {
|
@@ -176,6 +174,12 @@ function ResourceDetailDrawer(props) {
|
|
176
174
|
}
|
177
175
|
}
|
178
176
|
|
177
|
+
function close() {
|
178
|
+
resourceDetailDispatchers.update({
|
179
|
+
visible: false
|
180
|
+
});
|
181
|
+
}
|
182
|
+
|
179
183
|
function init(data, targetType) {
|
180
184
|
// console.log('初始化基本信息', data, targetType);
|
181
185
|
var id = data.id,
|
@@ -236,7 +240,8 @@ function ResourceDetailDrawer(props) {
|
|
236
240
|
topo: topo,
|
237
241
|
userId: userId,
|
238
242
|
activeData: activeData,
|
239
|
-
resourceData: resourceData
|
243
|
+
resourceData: resourceData,
|
244
|
+
onClose: close
|
240
245
|
}));
|
241
246
|
};
|
242
247
|
|
@@ -250,11 +255,7 @@ function ResourceDetailDrawer(props) {
|
|
250
255
|
})),
|
251
256
|
width: 580,
|
252
257
|
hasMask: false,
|
253
|
-
onClose:
|
254
|
-
return resourceDetailDispatchers.update({
|
255
|
-
visible: false
|
256
|
-
});
|
257
|
-
}
|
258
|
+
onClose: close
|
258
259
|
}, visible && resourceData && renderContent()));
|
259
260
|
}
|
260
261
|
|
@@ -523,32 +523,39 @@ function ResourceOverview(props) {
|
|
523
523
|
switch (_context5.prev = _context5.next) {
|
524
524
|
case 0:
|
525
525
|
_context5.t0 = item.dataIndex;
|
526
|
-
_context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ?
|
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:
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
530
|
+
// 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
|
531
|
+
if (attributeMap.support_templates) {
|
532
|
+
link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
|
533
|
+
|
534
|
+
value = /*#__PURE__*/_react["default"].createElement("span", {
|
535
|
+
onClick: onClose
|
536
|
+
}, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
537
|
+
className: _indexModule["default"].link,
|
538
|
+
disabled: true,
|
539
|
+
title: attributeMap.display_name || '',
|
540
|
+
to: formatUrl(link)
|
541
|
+
}, attributeMap.display_name || '-'));
|
542
|
+
} else {
|
543
|
+
value = attributeMap.display_name || '-';
|
544
|
+
}
|
545
|
+
|
539
546
|
contentTitle = attributeMap.display_name || '-';
|
540
|
-
return _context5.abrupt("break",
|
547
|
+
return _context5.abrupt("break", 21);
|
541
548
|
|
542
|
-
case
|
549
|
+
case 6:
|
543
550
|
value = ciTypeMeta.displayName;
|
544
551
|
contentTitle = value;
|
545
|
-
return _context5.abrupt("break",
|
552
|
+
return _context5.abrupt("break", 21);
|
546
553
|
|
547
|
-
case
|
548
|
-
_context5.next =
|
554
|
+
case 9:
|
555
|
+
_context5.next = 11;
|
549
556
|
return getAddressFormat(attributeMap);
|
550
557
|
|
551
|
-
case
|
558
|
+
case 11:
|
552
559
|
address = _context5.sent;
|
553
560
|
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
554
561
|
|
@@ -568,18 +575,18 @@ function ResourceOverview(props) {
|
|
568
575
|
}
|
569
576
|
|
570
577
|
contentTitle = address;
|
571
|
-
return _context5.abrupt("break",
|
578
|
+
return _context5.abrupt("break", 21);
|
572
579
|
|
573
|
-
case
|
580
|
+
case 16:
|
574
581
|
node = topo.getDataModel().getDataByTag(id);
|
575
582
|
value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
|
576
583
|
contentTitle = value;
|
577
|
-
return _context5.abrupt("break",
|
584
|
+
return _context5.abrupt("break", 21);
|
578
585
|
|
579
|
-
case
|
580
|
-
return _context5.abrupt("break",
|
586
|
+
case 20:
|
587
|
+
return _context5.abrupt("break", 21);
|
581
588
|
|
582
|
-
case
|
589
|
+
case 21:
|
583
590
|
case "end":
|
584
591
|
return _context5.stop();
|
585
592
|
}
|
@@ -768,7 +775,9 @@ function ResourceOverview(props) {
|
|
768
775
|
case 11:
|
769
776
|
metricList = _context8.sent;
|
770
777
|
_context8.next = 14;
|
771
|
-
return (
|
778
|
+
return queryMetricList({
|
779
|
+
'name': data.attributes.display_name
|
780
|
+
}, {
|
772
781
|
'id': data.attributes.name
|
773
782
|
});
|
774
783
|
|
@@ -812,36 +821,81 @@ function ResourceOverview(props) {
|
|
812
821
|
return _metricColChange.apply(this, arguments);
|
813
822
|
}
|
814
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) {
|
832
|
+
while (1) {
|
833
|
+
switch (_context9.prev = _context9.next) {
|
834
|
+
case 0:
|
835
|
+
if (!(ciType !== 'network_link')) {
|
836
|
+
_context9.next = 2;
|
837
|
+
break;
|
838
|
+
}
|
839
|
+
|
840
|
+
return _context9.abrupt("return", []);
|
841
|
+
|
842
|
+
case 2:
|
843
|
+
_context9.next = 4;
|
844
|
+
return (0, _services2.checkMenu)();
|
845
|
+
|
846
|
+
case 4:
|
847
|
+
checkMenus = _context9.sent;
|
848
|
+
|
849
|
+
if (!(checkMenus[0].passed == 'PASS')) {
|
850
|
+
_context9.next = 14;
|
851
|
+
break;
|
852
|
+
}
|
853
|
+
|
854
|
+
_context9.next = 8;
|
855
|
+
return (0, _services2.isOpenFlow)(data);
|
856
|
+
|
857
|
+
case 8:
|
858
|
+
isOpen = _context9.sent;
|
859
|
+
|
860
|
+
if (!isOpen) {
|
861
|
+
_context9.next = 14;
|
862
|
+
break;
|
863
|
+
}
|
864
|
+
|
865
|
+
_context9.next = 12;
|
866
|
+
return (0, _services2.queryLastestValue)(param);
|
867
|
+
|
868
|
+
case 12:
|
869
|
+
list = _context9.sent;
|
870
|
+
return _context9.abrupt("return", list);
|
871
|
+
|
872
|
+
case 14:
|
873
|
+
return _context9.abrupt("return", []);
|
874
|
+
|
875
|
+
case 15:
|
876
|
+
case "end":
|
877
|
+
return _context9.stop();
|
878
|
+
}
|
879
|
+
}
|
880
|
+
}, _callee9);
|
881
|
+
}));
|
882
|
+
return _queryMetricList.apply(this, arguments);
|
883
|
+
}
|
884
|
+
|
815
885
|
var getNewMetricList = function getNewMetricList(data) {
|
816
886
|
return [{
|
817
887
|
errorMsg: null,
|
818
|
-
mainCiId: "
|
819
|
-
metricCode: "
|
820
|
-
metricValue: data.downNetDelayRatio,
|
821
|
-
subCiId: '',
|
822
|
-
subCiType: null,
|
823
|
-
mainCiType: null
|
824
|
-
}, {
|
825
|
-
errorMsg: null,
|
826
|
-
mainCiId: "downRetansRatio",
|
827
|
-
metricCode: "downRetansRatio",
|
828
|
-
metricValue: data.downRetansRatio,
|
829
|
-
subCiId: '',
|
830
|
-
subCiType: null,
|
831
|
-
mainCiType: null
|
832
|
-
}, {
|
833
|
-
errorMsg: null,
|
834
|
-
mainCiId: "upNetDelayRatio",
|
835
|
-
metricCode: "upNetDelayRatio",
|
836
|
-
metricValue: data.upNetDelayRatio,
|
888
|
+
mainCiId: "netDelayRatio",
|
889
|
+
metricCode: "netDelayRatio",
|
890
|
+
metricValue: data.upNetDelayRatio + ' ms' + '|' + data.downNetDelayRatio + ' ms',
|
837
891
|
subCiId: '',
|
838
892
|
subCiType: null,
|
839
893
|
mainCiType: null
|
840
894
|
}, {
|
841
895
|
errorMsg: null,
|
842
|
-
mainCiId: "
|
843
|
-
metricCode: "
|
844
|
-
metricValue: data.upRetransRatio,
|
896
|
+
mainCiId: "retansRatio",
|
897
|
+
metricCode: "retansRatio",
|
898
|
+
metricValue: data.upRetransRatio + ' %' + '|' + data.downRetansRatio + ' %',
|
845
899
|
subCiId: '',
|
846
900
|
subCiType: null,
|
847
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
|
|
@@ -57,7 +57,7 @@ function LinkTopoCard(props) {
|
|
57
57
|
case 2:
|
58
58
|
checkMenus = _context.sent;
|
59
59
|
|
60
|
-
if (!(checkMenus[0].passed == 'PASS')) {
|
60
|
+
if (!(checkMenus[0].passed == 'PASS' && isCrucial)) {
|
61
61
|
_context.next = 10;
|
62
62
|
break;
|
63
63
|
}
|
@@ -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
|
}
|
@@ -24,7 +24,7 @@ function useMetricPolling(_ref) {
|
|
24
24
|
var linkCi = _ref.linkCi,
|
25
25
|
linkMetricCodes = _ref.linkMetricCodes;
|
26
26
|
var linkId = linkCi.id;
|
27
|
-
var arr = ['
|
27
|
+
var arr = ['netDelayRatio', 'retansRatio'];
|
28
28
|
var oldCodes = [];
|
29
29
|
var newCodes = [];
|
30
30
|
linkMetricCodes.map(function (item) {
|
@@ -52,39 +52,21 @@ function useMetricPolling(_ref) {
|
|
52
52
|
linkOther: []
|
53
53
|
};
|
54
54
|
|
55
|
-
if (newCodes.includes('
|
55
|
+
if (newCodes.includes('netDelayRatio')) {
|
56
56
|
datas.linkOther.push({
|
57
|
-
'code': '
|
57
|
+
'code': 'netDelayRatio',
|
58
58
|
'name': '下行RTT时延',
|
59
59
|
'ts': result.time,
|
60
|
-
'value': result.downNetDelayRatio + ' ms'
|
60
|
+
'value': result.upNetDelayRatio + ' ms' + '|' + result.downNetDelayRatio + ' ms'
|
61
61
|
});
|
62
62
|
}
|
63
63
|
|
64
|
-
if (newCodes.includes('
|
64
|
+
if (newCodes.includes('retansRatio')) {
|
65
65
|
datas.linkOther.push({
|
66
|
-
'code': '
|
67
|
-
'name': '
|
66
|
+
'code': 'retansRatio',
|
67
|
+
'name': '重传率',
|
68
68
|
'ts': result.time,
|
69
|
-
'value': result.downRetansRatio + ' %'
|
70
|
-
});
|
71
|
-
}
|
72
|
-
|
73
|
-
if (newCodes.includes('upNetDelayRatio')) {
|
74
|
-
datas.linkOther.push({
|
75
|
-
'code': 'upNetDelayRatio',
|
76
|
-
'name': '上行RTT时延',
|
77
|
-
'ts': result.time,
|
78
|
-
'value': result.upNetDelayRatio + ' ms'
|
79
|
-
});
|
80
|
-
}
|
81
|
-
|
82
|
-
if (newCodes.includes('upRetransRatio')) {
|
83
|
-
datas.linkOther.push({
|
84
|
-
'code': 'upRetransRatio',
|
85
|
-
'name': '上行重传率',
|
86
|
-
'ts': result.time,
|
87
|
-
'value': result.upRetransRatio + ' %'
|
69
|
+
'value': result.upRetransRatio + ' %' + '|' + result.downRetansRatio + ' %'
|
88
70
|
});
|
89
71
|
}
|
90
72
|
|
@@ -15,8 +15,6 @@ var _react = require("react");
|
|
15
15
|
|
16
16
|
var _getCiDisplayMetricModels = require("../../../getCiDisplayMetricModels");
|
17
17
|
|
18
|
-
var _services = require("../components/LinkTopo/services");
|
19
|
-
|
20
18
|
/**
|
21
19
|
* 概览指标定义
|
22
20
|
* @param {*} props
|
@@ -47,7 +45,7 @@ var useMetricModels = function useMetricModels(props) {
|
|
47
45
|
|
48
46
|
function _fetchData() {
|
49
47
|
_fetchData = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
50
|
-
var monitorMetrics, ciMonitorMetricModels,
|
48
|
+
var monitorMetrics, ciMonitorMetricModels, displayMetricModels, _metricCodes;
|
51
49
|
|
52
50
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
53
51
|
while (1) {
|
@@ -63,67 +61,29 @@ var useMetricModels = function useMetricModels(props) {
|
|
63
61
|
return item === m.code;
|
64
62
|
});
|
65
63
|
});
|
66
|
-
_context.next = 6;
|
67
|
-
return (0, _services.checkMenu)();
|
68
|
-
|
69
|
-
case 6:
|
70
|
-
checkMenus = _context.sent;
|
71
|
-
|
72
|
-
if (!(checkMenus[0].passed == 'PASS' && resourceData.attributes.display_name && resourceData.attributes['network_link.is_crucial'])) {
|
73
|
-
_context.next = 12;
|
74
|
-
break;
|
75
|
-
}
|
76
|
-
|
77
|
-
_context.next = 10;
|
78
|
-
return (0, _services.isOpenFlow)({
|
79
|
-
'name': resourceData.attributes.display_name
|
80
|
-
});
|
81
64
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
//
|
86
|
-
if (isOpen) {
|
87
|
-
ciMonitorMetricModels.push({
|
65
|
+
if (resourceData.attributes['network_link.is_crucial']) {
|
66
|
+
ciMonitorMetricModels.unshift({
|
88
67
|
changeValue: null,
|
89
|
-
code: "
|
90
|
-
id: "
|
68
|
+
code: "netDelayRatio",
|
69
|
+
id: "netDelayRatio",
|
91
70
|
isGoldMetric: true,
|
92
71
|
key: null,
|
93
|
-
name: "
|
72
|
+
name: "RTT时延",
|
94
73
|
unit: "ms"
|
95
74
|
});
|
96
|
-
ciMonitorMetricModels.
|
75
|
+
ciMonitorMetricModels.unshift({
|
97
76
|
changeValue: null,
|
98
|
-
code: "
|
99
|
-
id: "
|
77
|
+
code: "retansRatio",
|
78
|
+
id: "retansRatio",
|
100
79
|
isGoldMetric: true,
|
101
80
|
key: null,
|
102
|
-
name: "
|
81
|
+
name: "重传率",
|
103
82
|
unit: "%"
|
104
83
|
});
|
105
|
-
|
106
|
-
|
107
|
-
code: "upNetDelayRatio",
|
108
|
-
id: "upNetDelayRatio",
|
109
|
-
isGoldMetric: true,
|
110
|
-
key: null,
|
111
|
-
name: "上行RTT时延",
|
112
|
-
unit: "ms"
|
113
|
-
});
|
114
|
-
ciMonitorMetricModels.push({
|
115
|
-
changeValue: null,
|
116
|
-
code: "upRetransRatio",
|
117
|
-
id: "upRetransRatio",
|
118
|
-
isGoldMetric: true,
|
119
|
-
key: null,
|
120
|
-
name: "上行重传率",
|
121
|
-
unit: "%"
|
122
|
-
});
|
123
|
-
}
|
84
|
+
} // 未监控不显示指标,临时在这里处理
|
85
|
+
|
124
86
|
|
125
|
-
case 12:
|
126
|
-
// 未监控不显示指标,临时在这里处理
|
127
87
|
if (!isMonite) {
|
128
88
|
ciMonitorMetricModels = [];
|
129
89
|
}
|
@@ -155,7 +115,7 @@ var useMetricModels = function useMetricModels(props) {
|
|
155
115
|
|
156
116
|
return _context.abrupt("return", displayMetricModels);
|
157
117
|
|
158
|
-
case
|
118
|
+
case 10:
|
159
119
|
case "end":
|
160
120
|
return _context.stop();
|
161
121
|
}
|
package/lib/style.js
CHANGED
@@ -3,10 +3,10 @@ require('@alifd/next/lib/box/style');
|
|
3
3
|
require('@alifd/next/lib/message/style');
|
4
4
|
require('@riil-frontend/component-topology-utils/lib/style');
|
5
5
|
require('@riil-frontend/component-riil-event-emitter/lib/style');
|
6
|
+
require('@riil-frontend/utils/lib/style');
|
6
7
|
require('@alifd/next/lib/drawer/style');
|
7
8
|
require('@alifd/next/lib/menu-button/style');
|
8
9
|
require('@alifd/next/lib/search/style');
|
9
|
-
require('@riil-frontend/utils/lib/style');
|
10
10
|
require('@alifd/next/lib/tab/style');
|
11
11
|
require('@alifd/next/lib/table/style');
|
12
12
|
require('@riil-frontend/component-table-layout/lib/style');
|