@riil-frontend/component-topology 8.0.8 → 9.0.0-a.1

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.
Files changed (16) hide show
  1. package/build/index.js +1 -1
  2. package/es/core/models/TopoApp.js +1 -1
  3. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +74 -35
  4. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +5 -2
  5. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +75 -2
  6. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +68 -6
  7. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +80 -0
  8. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +65 -3
  9. package/lib/core/models/TopoApp.js +1 -1
  10. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +74 -34
  11. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +5 -2
  12. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +82 -2
  13. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +67 -5
  14. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +86 -0
  15. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +66 -3
  16. package/package.json +2 -2
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
23
23
  import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
25
25
 
26
- var version = typeof "8.0.8" === 'string' ? "8.0.8" : null;
26
+ var version = typeof "9.0.0-a.1" === 'string' ? "9.0.0-a.1" : null;
27
27
  console.info("\u62D3\u6251\u7248\u672C: " + version);
28
28
  /**
29
29
  * 拓扑显示和编辑
@@ -29,7 +29,8 @@ import useCiAttrAndMetricData from "./useCiAttrAndMetricData";
29
29
  import Configurator from "./components/Configurator";
30
30
  import { formatMetric } from "../../../../../../models/attributeFormatter";
31
31
  import LinkTopoCard from "./components/LinkTopo/LinkTopoCard";
32
- import EventsCard from "./EventsCard"; // url 处理,UICBB 的地址需截取前缀
32
+ import EventsCard from "./EventsCard";
33
+ import { queryLastestValue } from "./components/LinkTopo/services"; // url 处理,UICBB 的地址需截取前缀
33
34
 
34
35
  function formatUrl(url) {
35
36
  var _window, _window$location;
@@ -133,7 +134,8 @@ export default function ResourceOverview(props) {
133
134
  isMonite: data.manageStatus !== 0,
134
135
  ciTypeMeta: ciTypeMeta,
135
136
  topo: topo,
136
- resourceOverviewProps: resourceOverviewProps
137
+ resourceOverviewProps: resourceOverviewProps,
138
+ resourceData: data
137
139
  }),
138
140
  monitorMetricModels = _useMetricModels.metricModels;
139
141
 
@@ -487,39 +489,32 @@ export default function ResourceOverview(props) {
487
489
  switch (_context5.prev = _context5.next) {
488
490
  case 0:
489
491
  _context5.t0 = item.dataIndex;
490
- _context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 6 : _context5.t0 === 'res_address' ? 9 : _context5.t0 === 'imageName' ? 16 : 20;
492
+ _context5.next = _context5.t0 === 'display_name' ? 3 : _context5.t0 === 'ciName' ? 7 : _context5.t0 === 'res_address' ? 10 : _context5.t0 === 'imageName' ? 17 : 21;
491
493
  break;
492
494
 
493
495
  case 3:
494
- // 无监控模板不能跳转详情。跳转前需判定资源实例数据属性中是否包含support_templates属性。若不包含,则不能跳转
495
- if (attributeMap.support_templates) {
496
- link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
497
-
498
- value = /*#__PURE__*/React.createElement("span", {
499
- onClick: onClose
500
- }, /*#__PURE__*/React.createElement(Link, {
501
- className: styles.link,
502
- disabled: true,
503
- title: attributeMap.display_name || '',
504
- to: formatUrl(link)
505
- }, attributeMap.display_name || '-'));
506
- } else {
507
- value = attributeMap.display_name || '-';
508
- }
509
-
496
+ link = "/default/pagecenter/resDetail/view/" + id + "?resId=" + id + "&domainCode=" + ciTypeMeta.domain + "&title=" + attributeMap.display_name + "&ciCode=" + ciType; // 资源跳转链接
497
+
498
+ value = /*#__PURE__*/React.createElement("span", {
499
+ onClick: onClose
500
+ }, /*#__PURE__*/React.createElement(Link, {
501
+ className: styles.link,
502
+ title: attributeMap.display_name || '',
503
+ to: formatUrl(link)
504
+ }, attributeMap.display_name || '-'));
510
505
  contentTitle = attributeMap.display_name || '-';
511
- return _context5.abrupt("break", 21);
506
+ return _context5.abrupt("break", 22);
512
507
 
513
- case 6:
508
+ case 7:
514
509
  value = ciTypeMeta.displayName;
515
510
  contentTitle = value;
516
- return _context5.abrupt("break", 21);
511
+ return _context5.abrupt("break", 22);
517
512
 
518
- case 9:
519
- _context5.next = 11;
513
+ case 10:
514
+ _context5.next = 12;
520
515
  return getAddressFormat(attributeMap);
521
516
 
522
- case 11:
517
+ case 12:
523
518
  address = _context5.sent;
524
519
  owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
525
520
 
@@ -539,18 +534,18 @@ export default function ResourceOverview(props) {
539
534
  }
540
535
 
541
536
  contentTitle = address;
542
- return _context5.abrupt("break", 21);
537
+ return _context5.abrupt("break", 22);
543
538
 
544
- case 16:
539
+ case 17:
545
540
  node = topo.getDataModel().getDataByTag(id);
546
541
  value = (node === null || node === void 0 ? void 0 : node.a('customName')) || (node === null || node === void 0 ? void 0 : node.a('name')) || '-';
547
542
  contentTitle = value;
548
- return _context5.abrupt("break", 21);
549
-
550
- case 20:
551
- return _context5.abrupt("break", 21);
543
+ return _context5.abrupt("break", 22);
552
544
 
553
545
  case 21:
546
+ return _context5.abrupt("break", 22);
547
+
548
+ case 22:
554
549
  case "end":
555
550
  return _context5.stop();
556
551
  }
@@ -690,7 +685,7 @@ export default function ResourceOverview(props) {
690
685
  _metricColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(col) {
691
686
  var _col2, _col3;
692
687
 
693
- var codes, endTime, params, _ref5, times, metricList;
688
+ var codes, endTime, params, _ref5, times, metricList, newMetricList, metricLists;
694
689
 
695
690
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
696
691
  while (1) {
@@ -738,7 +733,15 @@ export default function ResourceOverview(props) {
738
733
 
739
734
  case 11:
740
735
  metricList = _context8.sent;
741
- rlog.debug('metricColChange', metricList, monitorMetricModels);
736
+ _context8.next = 14;
737
+ return queryLastestValue({
738
+ 'id': data.attributes.name
739
+ });
740
+
741
+ case 14:
742
+ newMetricList = _context8.sent;
743
+ metricLists = metricList.concat(getNewMetricList(newMetricList));
744
+ rlog.debug('metricColChange', metricLists, monitorMetricModels);
742
745
  setMetric(col.map(function (item, key) {
743
746
  return {
744
747
  code: item.dataIndex,
@@ -748,7 +751,7 @@ export default function ResourceOverview(props) {
748
751
  metricItem: monitorMetricModels.find(function (m_item) {
749
752
  return m_item.code === item.dataIndex;
750
753
  }),
751
- list: metricList.filter(function (m_item) {
754
+ list: metricLists.filter(function (m_item) {
752
755
  return m_item.metricCode === item.dataIndex;
753
756
  })
754
757
  };
@@ -763,7 +766,7 @@ export default function ResourceOverview(props) {
763
766
  }, 60000);
764
767
  }
765
768
 
766
- case 16:
769
+ case 20:
767
770
  case "end":
768
771
  return _context8.stop();
769
772
  }
@@ -773,6 +776,42 @@ export default function ResourceOverview(props) {
773
776
  return _metricColChange.apply(this, arguments);
774
777
  }
775
778
 
779
+ var getNewMetricList = function getNewMetricList(data) {
780
+ return [{
781
+ errorMsg: null,
782
+ mainCiId: "downNetDelayRatio",
783
+ metricCode: "downNetDelayRatio",
784
+ metricValue: data.downNetDelayRatio,
785
+ subCiId: '',
786
+ subCiType: null,
787
+ mainCiType: null
788
+ }, {
789
+ errorMsg: null,
790
+ mainCiId: "downRetansRatio",
791
+ metricCode: "downRetansRatio",
792
+ metricValue: data.downRetansRatio,
793
+ subCiId: '',
794
+ subCiType: null,
795
+ mainCiType: null
796
+ }, {
797
+ errorMsg: null,
798
+ mainCiId: "upNetDelayRatio",
799
+ metricCode: "upNetDelayRatio",
800
+ metricValue: data.upNetDelayRatio,
801
+ subCiId: '',
802
+ subCiType: null,
803
+ mainCiType: null
804
+ }, {
805
+ errorMsg: null,
806
+ mainCiId: "upRetransRatio",
807
+ metricCode: "upRetransRatio",
808
+ metricValue: data.upRetransRatio,
809
+ subCiId: '',
810
+ subCiType: null,
811
+ mainCiType: null
812
+ }];
813
+ };
814
+
776
815
  var defaultCols = useMemo(function () {
777
816
  var baseInfo = [];
778
817
  var keyIndicators = [];
@@ -6,7 +6,8 @@ import useMetricPolling from "./hooks/useMetricPolling";
6
6
  import styles from "./LinkTopo.module.scss";
7
7
  export default function LinkTopo(props) {
8
8
  var data = props.data,
9
- linkMetricCodes = props.linkMetricCodes;
9
+ linkMetricCodes = props.linkMetricCodes,
10
+ openFlow = props.openFlow;
10
11
  var metricData = useMetricPolling({
11
12
  linkCi: data,
12
13
  linkMetricCodes: linkMetricCodes
@@ -19,5 +20,7 @@ export default function LinkTopo(props) {
19
20
  ,
20
21
  isNarrow: true,
21
22
  jumpto: getHistory().push
22
- }, metricData)));
23
+ }, metricData, {
24
+ openFlow: openFlow
25
+ })));
23
26
  }
@@ -1,7 +1,10 @@
1
- import React from 'react';
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ import React, { useEffect, useState } from 'react';
2
4
  import BlockBox from "../../BlockBox";
3
5
  import Configurator from "../Configurator";
4
6
  import LinkTopo from "./LinkTopo";
7
+ import { isOpenFlow, checkMenu } from "./services";
5
8
  export default function LinkTopoCard(props) {
6
9
  var _data$attributes;
7
10
 
@@ -15,6 +18,75 @@ export default function LinkTopoCard(props) {
15
18
  var supportTemplates = (data === null || data === void 0 ? void 0 : (_data$attributes = data.attributes) === null || _data$attributes === void 0 ? void 0 : _data$attributes.support_templates) || ''; // 该资源监控模板
16
19
 
17
20
  var isCrucial = data === null || data === void 0 ? void 0 : data.attributes['network_link.is_crucial'];
21
+
22
+ var _useState = useState(-1),
23
+ openFlow = _useState[0],
24
+ setOpenFlow = _useState[1];
25
+
26
+ var analysisUrl = "../../default/trafficControl/linkConfigure?id=" + data.attributes.name + "&num=0";
27
+ var linkDetailsUrl = "/default/pagecenter/linkDetail/view/" + data.id + "?resId=" + data.id + "&domainCode=network&title=" + data.attributes.name + "&ciCode=network_link&tabByComType=uicbb-res-crucial-link-flow";
28
+
29
+ var isOpenFlows = /*#__PURE__*/function () {
30
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
31
+ var checkMenus, isOpen;
32
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
33
+ while (1) {
34
+ switch (_context.prev = _context.next) {
35
+ case 0:
36
+ _context.next = 2;
37
+ return checkMenu();
38
+
39
+ case 2:
40
+ checkMenus = _context.sent;
41
+
42
+ if (!(checkMenus[0].passed == 'PASS')) {
43
+ _context.next = 10;
44
+ break;
45
+ }
46
+
47
+ _context.next = 6;
48
+ return isOpenFlow({
49
+ 'name': data.attributes.display_name
50
+ });
51
+
52
+ case 6:
53
+ isOpen = _context.sent;
54
+
55
+ //判断是不是有流量分析
56
+ if (isOpen) {
57
+ setOpenFlow({
58
+ name: '跳转关键链路详情',
59
+ url: linkDetailsUrl
60
+ });
61
+ } else {
62
+ setOpenFlow({
63
+ name: '跳转流量分析配置',
64
+ url: analysisUrl
65
+ });
66
+ }
67
+
68
+ _context.next = 11;
69
+ break;
70
+
71
+ case 10:
72
+ setOpenFlow(null);
73
+
74
+ case 11:
75
+ case "end":
76
+ return _context.stop();
77
+ }
78
+ }
79
+ }, _callee);
80
+ }));
81
+
82
+ return function isOpenFlows() {
83
+ return _ref.apply(this, arguments);
84
+ };
85
+ }();
86
+
87
+ useEffect(function () {
88
+ isOpenFlows();
89
+ }, [data]);
18
90
  return /*#__PURE__*/React.createElement(BlockBox, {
19
91
  headerTitle: "\u8FD0\u884C\u60C5\u51B5",
20
92
  headerExtra: /*#__PURE__*/React.createElement(Configurator, {
@@ -29,6 +101,7 @@ export default function LinkTopoCard(props) {
29
101
  })
30
102
  }, /*#__PURE__*/React.createElement(LinkTopo, {
31
103
  data: data,
32
- linkMetricCodes: metricCodes
104
+ linkMetricCodes: metricCodes,
105
+ openFlow: openFlow
33
106
  }));
34
107
  }
@@ -1,24 +1,80 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useEffect, useState } from 'react';
3
3
  import { useRequest } from 'ahooks';
4
- import { queryLinkInterfacesLatestMetrics, queryLinkLatestMetrics } from "../services";
4
+ import { queryLinkInterfacesLatestMetrics, queryLinkLatestMetrics, queryLastestValue } from "../services";
5
5
  import rlog from '@riil-frontend/component-topology-utils/es/rlog'; // 资源节点上方色块展示资源的发送速率发送带宽利用率、接收速率发送接收利用率、总错包数
6
6
 
7
7
  export default function useMetricPolling(_ref) {
8
8
  var linkCi = _ref.linkCi,
9
9
  linkMetricCodes = _ref.linkMetricCodes;
10
10
  var linkId = linkCi.id;
11
+ var arr = ['downNetDelayRatio', 'downRetansRatio', 'upNetDelayRatio', 'upRetransRatio'];
12
+ var oldCodes = [];
13
+ var newCodes = [];
14
+ linkMetricCodes.map(function (item) {
15
+ arr.indexOf(item) > -1 ? newCodes.push(item) : oldCodes.push(item);
16
+ });
11
17
 
12
18
  var _useState = useState({
13
19
  sourceMetrics: null,
14
20
  destinationMetrics: null,
15
21
  // 链路指标列表
16
22
  linkMetrics: [],
17
- linkMetricsTs: null
23
+ linkMetricsTs: null,
24
+ linkOther: []
18
25
  }),
19
26
  data = _useState[0],
20
- setData = _useState[1]; // 轮询hooks
27
+ setData = _useState[1];
28
+
29
+ var queryLastestValues = useRequest(queryLastestValue, {
30
+ pollingInterval: 1000 * 15,
31
+ pollingWhenHidden: false,
32
+ debounceInterval: 200,
33
+ manual: true,
34
+ onSuccess: function onSuccess(result) {
35
+ var datas = {
36
+ linkOther: []
37
+ };
21
38
 
39
+ if (newCodes.includes('downNetDelayRatio')) {
40
+ datas.linkOther.push({
41
+ 'code': 'downNetDelayRatio',
42
+ 'name': '下行RTT时延',
43
+ 'ts': result.time,
44
+ 'value': result.downNetDelayRatio + ' ms'
45
+ });
46
+ }
47
+
48
+ if (newCodes.includes('downRetansRatio')) {
49
+ datas.linkOther.push({
50
+ 'code': 'downRetansRatio',
51
+ 'name': '下行重传率',
52
+ 'ts': result.time,
53
+ 'value': result.downRetansRatio + ' %'
54
+ });
55
+ }
56
+
57
+ if (newCodes.includes('upNetDelayRatio')) {
58
+ datas.linkOther.push({
59
+ 'code': 'upNetDelayRatio',
60
+ 'name': '上行RTT时延',
61
+ 'ts': result.time,
62
+ 'value': result.upNetDelayRatio + ' ms'
63
+ });
64
+ }
65
+
66
+ if (newCodes.includes('upRetransRatio')) {
67
+ datas.linkOther.push({
68
+ 'code': 'upRetransRatio',
69
+ 'name': '上行重传率',
70
+ 'ts': result.time,
71
+ 'value': result.upRetransRatio + ' %'
72
+ });
73
+ }
74
+
75
+ setData(_extends({}, data, datas));
76
+ }
77
+ }); // 轮询hooks
22
78
 
23
79
  var queryLinkMetricsRequest = useRequest(queryLinkLatestMetrics, {
24
80
  pollingInterval: 60 * 1000,
@@ -40,16 +96,22 @@ export default function useMetricPolling(_ref) {
40
96
  rlog.info('链路拓扑指标轮询 queryInterfaceMetricsRequest 结果', result);
41
97
  }
42
98
  });
43
- var linkMetricCodesStr = linkMetricCodes.map(function (item) {
99
+ var linkMetricCodesStr = oldCodes.map(function (item) {
44
100
  return item;
45
101
  }).sort().join(',');
46
102
  useEffect(function () {
47
103
  if (linkId) {
48
104
  rlog.info('链路拓扑指标轮询 切换', {
49
105
  linkCi: linkCi,
50
- linkMetricCodes: linkMetricCodes
106
+ oldCodes: oldCodes
51
107
  });
52
- queryLinkMetricsRequest.run(linkCi, linkMetricCodes);
108
+ queryLinkMetricsRequest.run(linkCi, oldCodes);
109
+
110
+ if (newCodes.length > 0) {
111
+ queryLastestValues.run({
112
+ 'id': linkCi.attributes.name
113
+ });
114
+ }
53
115
  }
54
116
 
55
117
  return function () {};
@@ -132,6 +132,10 @@ function _queryLinkLatestMetrics() {
132
132
  export function queryLinkInterfacesLatestMetrics(_x5) {
133
133
  return _queryLinkInterfacesLatestMetrics.apply(this, arguments);
134
134
  }
135
+ /**
136
+ * @name checkMenu 判断当前流量监控权限
137
+ * @returns
138
+ */
135
139
 
136
140
  function _queryLinkInterfacesLatestMetrics() {
137
141
  _queryLinkInterfacesLatestMetrics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(linkCi) {
@@ -207,4 +211,80 @@ function _queryLinkInterfacesLatestMetrics() {
207
211
  }, _callee4);
208
212
  }));
209
213
  return _queryLinkInterfacesLatestMetrics.apply(this, arguments);
214
+ }
215
+
216
+ export function checkMenu() {
217
+ return _checkMenu.apply(this, arguments);
218
+ }
219
+ /**
220
+ * @name isOpenFlow 是否配置流量分析
221
+ * @returns
222
+ */
223
+
224
+ function _checkMenu() {
225
+ _checkMenu = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
226
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
227
+ while (1) {
228
+ switch (_context5.prev = _context5.next) {
229
+ case 0:
230
+ return _context5.abrupt("return", request.post('/authorization/v1/api/authority/check/checkMenuAuthentication', [{
231
+ "url": "/default/trafficControl"
232
+ }]));
233
+
234
+ case 1:
235
+ case "end":
236
+ return _context5.stop();
237
+ }
238
+ }
239
+ }, _callee5);
240
+ }));
241
+ return _checkMenu.apply(this, arguments);
242
+ }
243
+
244
+ export function isOpenFlow(_x6) {
245
+ return _isOpenFlow.apply(this, arguments);
246
+ }
247
+ /**
248
+ * @name isOpenFlow 查指标值
249
+ * @returns
250
+ */
251
+
252
+ function _isOpenFlow() {
253
+ _isOpenFlow = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(params) {
254
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
255
+ while (1) {
256
+ switch (_context6.prev = _context6.next) {
257
+ case 0:
258
+ return _context6.abrupt("return", request.post('/flow/v1/api/link/isOpenFlowMonitorByName', params));
259
+
260
+ case 1:
261
+ case "end":
262
+ return _context6.stop();
263
+ }
264
+ }
265
+ }, _callee6);
266
+ }));
267
+ return _isOpenFlow.apply(this, arguments);
268
+ }
269
+
270
+ export function queryLastestValue(_x7) {
271
+ return _queryLastestValue.apply(this, arguments);
272
+ }
273
+
274
+ function _queryLastestValue() {
275
+ _queryLastestValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(params) {
276
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
277
+ while (1) {
278
+ switch (_context7.prev = _context7.next) {
279
+ case 0:
280
+ return _context7.abrupt("return", request.post('/flow/v1/api/LinkAnalyse/queryLastestValue', params));
281
+
282
+ case 1:
283
+ case "end":
284
+ return _context7.stop();
285
+ }
286
+ }
287
+ }, _callee7);
288
+ }));
289
+ return _queryLastestValue.apply(this, arguments);
210
290
  }
@@ -3,6 +3,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
3
  import { useRequest } from 'ahooks';
4
4
  import { useEffect, useState } from 'react';
5
5
  import { queryCiMonitorMetricCodes } from "../../../getCiDisplayMetricModels";
6
+ import { checkMenu, isOpenFlow } from "../components/LinkTopo/services";
6
7
  /**
7
8
  * 概览指标定义
8
9
  * @param {*} props
@@ -15,6 +16,7 @@ var useMetricModels = function useMetricModels(props) {
15
16
  ciType = _props$data.ciType,
16
17
  isMonite = props.isMonite,
17
18
  ciTypeMeta = props.ciTypeMeta,
19
+ resourceData = props.resourceData,
18
20
  topo = props.topo,
19
21
  resourceOverviewProps = props.resourceOverviewProps;
20
22
 
@@ -33,7 +35,7 @@ var useMetricModels = function useMetricModels(props) {
33
35
 
34
36
  function _fetchData() {
35
37
  _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
36
- var monitorMetrics, ciMonitorMetricModels, displayMetricModels, _metricCodes;
38
+ var monitorMetrics, ciMonitorMetricModels, checkMenus, isOpen, displayMetricModels, _metricCodes;
37
39
 
38
40
  return _regeneratorRuntime.wrap(function _callee$(_context) {
39
41
  while (1) {
@@ -48,8 +50,68 @@ var useMetricModels = function useMetricModels(props) {
48
50
  return !!monitorMetrics.find(function (item) {
49
51
  return item === m.code;
50
52
  });
51
- }); // 未监控不显示指标,临时在这里处理
53
+ });
54
+ _context.next = 6;
55
+ return checkMenu();
52
56
 
57
+ case 6:
58
+ checkMenus = _context.sent;
59
+
60
+ if (!(checkMenus[0].passed == 'PASS' && resourceData.attributes.display_name && resourceData.attributes['network_link.is_crucial'])) {
61
+ _context.next = 12;
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({
76
+ changeValue: null,
77
+ code: "downNetDelayRatio",
78
+ id: "downNetDelayRatio",
79
+ isGoldMetric: true,
80
+ key: null,
81
+ name: "下行RTT时延",
82
+ unit: "ms"
83
+ });
84
+ ciMonitorMetricModels.push({
85
+ changeValue: null,
86
+ code: "downRetansRatio",
87
+ id: "downRetansRatio",
88
+ isGoldMetric: true,
89
+ key: null,
90
+ name: "下行重传率",
91
+ unit: "%"
92
+ });
93
+ ciMonitorMetricModels.push({
94
+ changeValue: null,
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
+ }
112
+
113
+ case 12:
114
+ // 未监控不显示指标,临时在这里处理
53
115
  if (!isMonite) {
54
116
  ciMonitorMetricModels = [];
55
117
  }
@@ -81,7 +143,7 @@ var useMetricModels = function useMetricModels(props) {
81
143
 
82
144
  return _context.abrupt("return", displayMetricModels);
83
145
 
84
- case 9:
146
+ case 17:
85
147
  case "end":
86
148
  return _context.stop();
87
149
  }
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
54
54
  var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
55
55
 
56
56
  // eslint-disable-next-line no-undef
57
- var version = typeof "8.0.8" === 'string' ? "8.0.8" : null;
57
+ var version = typeof "9.0.0-a.1" === 'string' ? "9.0.0-a.1" : null;
58
58
  console.info("\u62D3\u6251\u7248\u672C: " + version);
59
59
  /**
60
60
  * 拓扑显示和编辑