@riil-frontend/component-topology 9.0.0-a.2 → 9.0.0-a.20

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 (55) hide show
  1. package/build/index.css +1 -1
  2. package/build/index.js +2 -2
  3. package/es/components/VerticalIconTab/VerticalIconTab.module.scss +11 -5
  4. package/es/core/components/TopoView/GraphViewPanel.js +3 -2
  5. package/es/core/editor/components/BackgroundView/index.module.scss +3 -0
  6. package/es/core/editor/components/Sidebar/Sidebar.module.scss +7 -7
  7. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +1 -1
  8. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +1 -0
  9. package/es/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
  10. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
  11. package/es/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
  12. package/es/core/editor/config/themes.js +53 -2
  13. package/es/core/event/topoEventListener.js +22 -0
  14. package/es/core/hooks/useAlarm.js +18 -12
  15. package/es/core/hooks/useCanvasTheme.js +8 -1
  16. package/es/core/hooks/useTopoEventListener.js +4 -18
  17. package/es/core/models/Alarm.js +4 -13
  18. package/es/core/models/TopoApp.js +1 -1
  19. package/es/core/store/models/viewer/resourceDetail.js +7 -0
  20. package/es/core/test/Test.js +52 -0
  21. package/es/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +10 -9
  22. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +11 -35
  23. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +14 -0
  24. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +8 -6
  25. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +28 -56
  26. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +57 -1
  27. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +13 -52
  28. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +5 -5
  29. package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +11 -5
  30. package/lib/core/components/TopoView/GraphViewPanel.js +3 -2
  31. package/lib/core/editor/components/BackgroundView/index.module.scss +3 -0
  32. package/lib/core/editor/components/Sidebar/Sidebar.module.scss +7 -7
  33. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +1 -1
  34. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +1 -0
  35. package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +1 -1
  36. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
  37. package/lib/core/editor/components/Sidebar/views/LinkPanel.js +1 -1
  38. package/lib/core/editor/config/themes.js +53 -2
  39. package/lib/core/event/topoEventListener.js +27 -0
  40. package/lib/core/hooks/useAlarm.js +19 -12
  41. package/lib/core/hooks/useCanvasTheme.js +8 -1
  42. package/lib/core/hooks/useTopoEventListener.js +3 -17
  43. package/lib/core/models/Alarm.js +5 -16
  44. package/lib/core/models/TopoApp.js +1 -1
  45. package/lib/core/store/models/viewer/resourceDetail.js +7 -0
  46. package/lib/core/test/Test.js +52 -0
  47. package/lib/core/viewer/components/plugins/ResourceDetail/ResourceDetailDrawer.js +10 -9
  48. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +10 -35
  49. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopo.js +14 -0
  50. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +8 -6
  51. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +28 -55
  52. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +58 -1
  53. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +13 -53
  54. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +5 -5
  55. package/package.json +3 -3
@@ -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, checkMenus, isOpen, displayMetricModels, _metricCodes;
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
- case 10:
83
- isOpen = _context.sent;
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: "downNetDelayRatio",
90
- id: "downNetDelayRatio",
68
+ code: "netDelayRatio",
69
+ id: "netDelayRatio",
91
70
  isGoldMetric: true,
92
71
  key: null,
93
- name: "下行RTT时延",
72
+ name: "RTT时延",
94
73
  unit: "ms"
95
74
  });
96
- ciMonitorMetricModels.push({
75
+ ciMonitorMetricModels.unshift({
97
76
  changeValue: null,
98
- code: "downRetansRatio",
99
- id: "downRetansRatio",
77
+ code: "retansRatio",
78
+ id: "retansRatio",
100
79
  isGoldMetric: true,
101
80
  key: null,
102
- name: "下行重传率",
81
+ name: "重传率",
103
82
  unit: "%"
104
83
  });
105
- ciMonitorMetricModels.push({
106
- changeValue: null,
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 17:
118
+ case 10:
159
119
  case "end":
160
120
  return _context.stop();
161
121
  }
@@ -16,15 +16,15 @@ var _linkUtil = require("../utils/linkUtil");
16
16
  // network_link.actual_bandwidth
17
17
  function calcEdgeWidth(actualBandwidth) {
18
18
  if (!actualBandwidth) {
19
- return 2;
19
+ return 3;
20
20
  } else if (actualBandwidth <= 100) {
21
- return 2;
22
- } else if (actualBandwidth <= 1000) {
23
21
  return 3;
24
- } else if (actualBandwidth <= 10000) {
22
+ } else if (actualBandwidth <= 1000) {
25
23
  return 4;
26
- } else if (actualBandwidth > 10000) {
24
+ } else if (actualBandwidth <= 10000) {
27
25
  return 5;
26
+ } else if (actualBandwidth > 10000) {
27
+ return 6;
28
28
  }
29
29
  }
30
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riil-frontend/component-topology",
3
- "version": "9.0.0-a.2",
3
+ "version": "9.0.0-a.20",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "devDependencies": {
57
57
  "@alifd/next": "1.21.16",
58
- "@alifd/theme-19926": "^0.39.0",
58
+ "@alifd/theme-19926": "^0.48.2",
59
59
  "@formily/next": "1.3.13",
60
60
  "@formily/next-components": "1.3.13",
61
61
  "@iceworks/spec": "^1.0.0",
@@ -116,6 +116,6 @@
116
116
  "access": "public"
117
117
  },
118
118
  "license": "MIT",
119
- "homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.0-a.2/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.0-a.20/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }