@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
@@ -17,9 +17,9 @@ export default function LinkTopoCard(props) {
17
17
 
18
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) || ''; // 该资源监控模板
19
19
 
20
- var isCrucial = data === null || data === void 0 ? void 0 : data.attributes['network_link.is_crucial'];
20
+ var isCrucial = data === null || data === void 0 ? void 0 : data.attributes['network_link.is_crucial']; //是不是关键链路
21
21
 
22
- var _useState = useState(-1),
22
+ var _useState = useState(null),
23
23
  openFlow = _useState[0],
24
24
  setOpenFlow = _useState[1];
25
25
 
@@ -39,7 +39,7 @@ export default function LinkTopoCard(props) {
39
39
  case 2:
40
40
  checkMenus = _context.sent;
41
41
 
42
- if (!(checkMenus[0].passed == 'PASS')) {
42
+ if (!(checkMenus[0].passed == 'PASS' && isCrucial)) {
43
43
  _context.next = 10;
44
44
  break;
45
45
  }
@@ -55,12 +55,12 @@ export default function LinkTopoCard(props) {
55
55
  //判断是不是有流量分析
56
56
  if (isOpen) {
57
57
  setOpenFlow({
58
- name: '跳转关键链路详情',
58
+ name: '查看流量构成',
59
59
  url: linkDetailsUrl
60
60
  });
61
61
  } else {
62
62
  setOpenFlow({
63
- name: '跳转流量分析配置',
63
+ name: '配置流量分析',
64
64
  url: analysisUrl
65
65
  });
66
66
  }
@@ -101,7 +101,9 @@ export default function LinkTopoCard(props) {
101
101
  })
102
102
  }, /*#__PURE__*/React.createElement(LinkTopo, {
103
103
  data: data,
104
- linkMetricCodes: metricCodes,
104
+ linkMetricCodes: openFlow && openFlow.name == '查看流量构成' ? metricCodes : metricCodes.filter(function (i) {
105
+ return i != 'netDelayRatio' && i != 'retansRatio';
106
+ }),
105
107
  openFlow: openFlow
106
108
  }));
107
109
  }
@@ -1,18 +1,18 @@
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, queryLastestValue } from "../services";
4
+ import { queryLinkInterfacesLatestMetrics, queryLinkLatestMetrics, queryRetansRatioNetDelayRatio } 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 = [];
11
+ var arr = ['netDelayRatio', 'retansRatio'];
12
+ var codes = [];
13
+ var retansRatioNetDelayRatioCodes = [];
14
14
  linkMetricCodes.map(function (item) {
15
- arr.indexOf(item) > -1 ? newCodes.push(item) : oldCodes.push(item);
15
+ arr.indexOf(item) > -1 ? retansRatioNetDelayRatioCodes.push(item) : codes.push(item);
16
16
  });
17
17
 
18
18
  var _useState = useState({
@@ -26,53 +26,15 @@ export default function useMetricPolling(_ref) {
26
26
  data = _useState[0],
27
27
  setData = _useState[1];
28
28
 
29
- var queryLastestValues = useRequest(queryLastestValue, {
29
+ var queryLastestValues = useRequest(queryRetansRatioNetDelayRatio, {
30
30
  pollingInterval: 1000 * 15,
31
31
  pollingWhenHidden: false,
32
32
  debounceInterval: 200,
33
33
  manual: true,
34
34
  onSuccess: function onSuccess(result) {
35
- var datas = {
36
- linkOther: []
37
- };
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));
35
+ setData(_extends({}, data, {
36
+ linkOther: result
37
+ }));
76
38
  }
77
39
  }); // 轮询hooks
78
40
 
@@ -96,26 +58,36 @@ export default function useMetricPolling(_ref) {
96
58
  rlog.info('链路拓扑指标轮询 queryInterfaceMetricsRequest 结果', result);
97
59
  }
98
60
  });
99
- var linkMetricCodesStr = oldCodes.map(function (item) {
61
+ var linkMetricCodesStr = codes.map(function (item) {
100
62
  return item;
101
63
  }).sort().join(',');
102
64
  useEffect(function () {
103
65
  if (linkId) {
104
66
  rlog.info('链路拓扑指标轮询 切换', {
105
67
  linkCi: linkCi,
106
- oldCodes: oldCodes
68
+ codes: codes
107
69
  });
108
- queryLinkMetricsRequest.run(linkCi, oldCodes);
109
-
110
- if (newCodes.length > 0) {
111
- queryLastestValues.run({
112
- 'id': linkCi.attributes.name
113
- });
114
- }
70
+ queryLinkMetricsRequest.run(linkCi, codes);
115
71
  }
116
72
 
117
73
  return function () {};
118
74
  }, [linkId, linkMetricCodesStr]);
75
+ var retansRatioNetDelayRatioCodesStr = retansRatioNetDelayRatioCodes.map(function (item) {
76
+ return item;
77
+ }).sort().join(',');
78
+ useEffect(function () {
79
+ if (linkId) {
80
+ rlog.info('链路拓扑指标勾选rtt|重传率 轮询', {
81
+ linkCi: linkCi,
82
+ retansRatioNetDelayRatioCodes: retansRatioNetDelayRatioCodes
83
+ });
84
+ queryLastestValues.run({
85
+ 'id': linkCi.attributes.name
86
+ }, retansRatioNetDelayRatioCodes);
87
+ }
88
+
89
+ return function () {};
90
+ }, [linkId, retansRatioNetDelayRatioCodesStr]);
119
91
  useEffect(function () {
120
92
  if (linkId) {
121
93
  rlog.info('链路拓扑指标轮询 queryInterfaceMetricsRequest 开始', {
@@ -245,7 +245,7 @@ export function isOpenFlow(_x6) {
245
245
  return _isOpenFlow.apply(this, arguments);
246
246
  }
247
247
  /**
248
- * @name isOpenFlow 查指标值
248
+ * @name queryLastestValue 查指标值
249
249
  * @returns
250
250
  */
251
251
 
@@ -287,4 +287,60 @@ function _queryLastestValue() {
287
287
  }, _callee7);
288
288
  }));
289
289
  return _queryLastestValue.apply(this, arguments);
290
+ }
291
+
292
+ export function queryRetansRatioNetDelayRatio(_x8, _x9) {
293
+ return _queryRetansRatioNetDelayRatio.apply(this, arguments);
294
+ }
295
+
296
+ function _queryRetansRatioNetDelayRatio() {
297
+ _queryRetansRatioNetDelayRatio = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(params, retansRatioNetDelayRatioCodes) {
298
+ var result, linkOther;
299
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
300
+ while (1) {
301
+ switch (_context8.prev = _context8.next) {
302
+ case 0:
303
+ if (retansRatioNetDelayRatioCodes.length) {
304
+ _context8.next = 2;
305
+ break;
306
+ }
307
+
308
+ return _context8.abrupt("return", []);
309
+
310
+ case 2:
311
+ _context8.next = 4;
312
+ return queryLastestValue(params);
313
+
314
+ case 4:
315
+ result = _context8.sent;
316
+ linkOther = [];
317
+
318
+ if (retansRatioNetDelayRatioCodes.includes('netDelayRatio')) {
319
+ linkOther.push({
320
+ 'code': 'netDelayRatio',
321
+ 'name': 'RTT时延',
322
+ 'ts': result.time,
323
+ 'value': (result.upNetDelayRatio * 1).toFixed(2) + ' ms' + '|' + (result.downNetDelayRatio * 1).toFixed(2) + ' ms'
324
+ });
325
+ }
326
+
327
+ if (retansRatioNetDelayRatioCodes.includes('retansRatio')) {
328
+ linkOther.push({
329
+ 'code': 'retansRatio',
330
+ 'name': '重传率',
331
+ 'ts': result.time,
332
+ 'value': result.upRetransRatio + ' %' + '|' + result.downRetansRatio + ' %'
333
+ });
334
+ }
335
+
336
+ return _context8.abrupt("return", linkOther);
337
+
338
+ case 9:
339
+ case "end":
340
+ return _context8.stop();
341
+ }
342
+ }
343
+ }, _callee8);
344
+ }));
345
+ return _queryRetansRatioNetDelayRatio.apply(this, arguments);
290
346
  }
@@ -3,7 +3,6 @@ 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";
7
6
  /**
8
7
  * 概览指标定义
9
8
  * @param {*} props
@@ -35,7 +34,7 @@ var useMetricModels = function useMetricModels(props) {
35
34
 
36
35
  function _fetchData() {
37
36
  _fetchData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
38
- var monitorMetrics, ciMonitorMetricModels, checkMenus, isOpen, displayMetricModels, _metricCodes;
37
+ var monitorMetrics, ciMonitorMetricModels, displayMetricModels, _metricCodes;
39
38
 
40
39
  return _regeneratorRuntime.wrap(function _callee$(_context) {
41
40
  while (1) {
@@ -51,67 +50,29 @@ var useMetricModels = function useMetricModels(props) {
51
50
  return item === m.code;
52
51
  });
53
52
  });
54
- _context.next = 6;
55
- return checkMenu();
56
53
 
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({
54
+ if (resourceData.attributes['network_link.is_crucial']) {
55
+ ciMonitorMetricModels.unshift({
94
56
  changeValue: null,
95
- code: "upNetDelayRatio",
96
- id: "upNetDelayRatio",
57
+ code: "netDelayRatio",
58
+ id: "netDelayRatio",
97
59
  isGoldMetric: true,
98
60
  key: null,
99
- name: "上行RTT时延",
61
+ name: "RTT时延",
100
62
  unit: "ms"
101
63
  });
102
- ciMonitorMetricModels.push({
64
+ ciMonitorMetricModels.unshift({
103
65
  changeValue: null,
104
- code: "upRetransRatio",
105
- id: "upRetransRatio",
66
+ code: "retansRatio",
67
+ id: "retansRatio",
106
68
  isGoldMetric: true,
107
69
  key: null,
108
- name: "上行重传率",
70
+ name: "重传率",
109
71
  unit: "%"
110
72
  });
111
- }
73
+ } // 未监控不显示指标,临时在这里处理
74
+
112
75
 
113
- case 12:
114
- // 未监控不显示指标,临时在这里处理
115
76
  if (!isMonite) {
116
77
  ciMonitorMetricModels = [];
117
78
  }
@@ -143,7 +104,7 @@ var useMetricModels = function useMetricModels(props) {
143
104
 
144
105
  return _context.abrupt("return", displayMetricModels);
145
106
 
146
- case 17:
107
+ case 10:
147
108
  case "end":
148
109
  return _context.stop();
149
110
  }
@@ -5,15 +5,15 @@ import { getLinksBetweenNodes } from "../utils/linkUtil"; // network_link.actual
5
5
 
6
6
  function calcEdgeWidth(actualBandwidth) {
7
7
  if (!actualBandwidth) {
8
- return 2;
8
+ return 3;
9
9
  } else if (actualBandwidth <= 100) {
10
- return 2;
11
- } else if (actualBandwidth <= 1000) {
12
10
  return 3;
13
- } else if (actualBandwidth <= 10000) {
11
+ } else if (actualBandwidth <= 1000) {
14
12
  return 4;
15
- } else if (actualBandwidth > 10000) {
13
+ } else if (actualBandwidth <= 10000) {
16
14
  return 5;
15
+ } else if (actualBandwidth > 10000) {
16
+ return 6;
17
17
  }
18
18
  }
19
19
 
@@ -3,8 +3,8 @@
3
3
 
4
4
  .tabs {
5
5
  height: 100%;
6
-
7
- }
6
+ display: flex;
7
+ }
8
8
 
9
9
  // 导航
10
10
  .nav {
@@ -49,17 +49,23 @@
49
49
 
50
50
  // 标签页内容区
51
51
  .content {
52
- width: 260px;
52
+ // width: 260px;
53
53
  height: 100%;
54
54
  border-left: none !important;
55
- border-right: 1px solid var(--tab-wrapped-border-line-color);
56
55
  transition: width .1s linear;
56
+ overflow: initial !important;
57
57
 
58
58
  :global {
59
59
  .#{$css-prefix}tabs-tabpane {
60
- width: 100%;
60
+ position: absolute;
61
+ left: 0;
62
+ top: 0;
63
+ z-index: 1;
64
+ // width: 250px;
61
65
  height: 100%;
62
66
  overflow: auto;
67
+ background: #FFF;
68
+ border-right: 1px solid var(--tab-wrapped-border-line-color);
63
69
  }
64
70
  }
65
71
 
@@ -26,7 +26,8 @@ function GraphViewPanel(props) {
26
26
  themeName: themeName,
27
27
  hideBackgroundColor: hideBackgroundColor
28
28
  }),
29
- canvasColor = _useCanvasTheme.canvasColor;
29
+ canvasColor = _useCanvasTheme.canvasColor,
30
+ canvasbackgroundImage = _useCanvasTheme.canvasbackgroundImage;
30
31
 
31
32
  (0, _react.useEffect)(function () {
32
33
  // eslint-disable-next-line no-underscore-dangle
@@ -45,7 +46,7 @@ function GraphViewPanel(props) {
45
46
  return /*#__PURE__*/_react["default"].createElement("div", {
46
47
  className: _TopoViewModule["default"].viewPanel,
47
48
  style: {
48
- background: canvasColor
49
+ background: canvasColor || "url(" + canvasbackgroundImage + ")"
49
50
  },
50
51
  onFocus: onFocus
51
52
  }, props.children);
@@ -1,8 +1,11 @@
1
1
  @import "~@alifd/next/variables.scss";
2
2
 
3
3
  .background-view {
4
+ width: 260px;
4
5
  padding: 16px;
5
6
  background: #fff;
7
+ height: 100%;
8
+ overflow: auto;
6
9
  .option {
7
10
  text-align: right;
8
11
  button {
@@ -1,19 +1,19 @@
1
1
  .sidebar {
2
2
  // border-right: 1px solid #E6E7EB;
3
3
  position: relative;
4
- width: 60px;
4
+ // width: 60px;
5
5
 
6
6
  .tabsContainer {
7
- position: absolute;
8
- width: 60px;
7
+ // position: absolute;
8
+ // left: 0;
9
+ // top: 0;
10
+ // z-index: 1;
11
+ // width: 60px;
9
12
  height: 100%;
10
- left: 0;
11
- top: 0;
12
- z-index: 1;
13
13
  background: #FFF;
14
14
 
15
15
  &.expanded {
16
- width: 320px;
16
+ // width: 320px;
17
17
  }
18
18
  }
19
19
  }
@@ -36,7 +36,7 @@ function CanvasPanel(props) {
36
36
  }, /*#__PURE__*/_react["default"].createElement(_tag["default"].Selectable, {
37
37
  className: _CanvasPanelModule["default"].tag,
38
38
  style: {
39
- background: item.color
39
+ background: item.color || "url(" + item.backgroundImageThumbnail + ")"
40
40
  },
41
41
  checked: item.name === canvasThemeName,
42
42
  onChange: function onChange(checked) {
@@ -1,6 +1,7 @@
1
1
  @import "~@alifd/next/variables.scss";
2
2
 
3
3
  .canvasToggle {
4
+ width: 260px;
4
5
  display: flex;
5
6
  flex-wrap: wrap;
6
7
  .canvas {
@@ -46,7 +46,7 @@ function ComponentPanel(props) {
46
46
  return /*#__PURE__*/_react["default"].createElement("div", {
47
47
  ref: divRef,
48
48
  style: {
49
- width: '100%',
49
+ width: '260px',
50
50
  height: '100%'
51
51
  }
52
52
  });
@@ -46,7 +46,8 @@ function ImagePanel(props) {
46
46
  accordion: true,
47
47
  defaultExpandedKeys: ['资源图片'],
48
48
  style: {
49
- border: 'none'
49
+ border: 'none',
50
+ minWidth: '300px'
50
51
  },
51
52
  fullheight: true,
52
53
  noContentPadding: true
@@ -46,7 +46,7 @@ function LinkPanel(props) {
46
46
  return /*#__PURE__*/_react["default"].createElement("div", {
47
47
  ref: divRef,
48
48
  style: {
49
- width: '100%',
49
+ width: '260px',
50
50
  height: '100%'
51
51
  }
52
52
  });
@@ -30,7 +30,9 @@ var baseLightTheme = {
30
30
  'group.title.color': '#4D6277',
31
31
  // 标题文字颜色
32
32
  'group.background': 'rgba(255, 255, 255, 0.9)',
33
- 'group.border.color': '#E4E9EE' // 边框颜色
33
+ 'group.border.color': '#E4E9EE',
34
+ // 边框颜色
35
+ 'group.splitLine': false // 标题底部边框
34
36
 
35
37
  }
36
38
  },
@@ -92,7 +94,56 @@ var THEMES = [(0, _extends2["default"])({}, baseLightTheme, {
92
94
  'group.title.color': '#FFFFFF',
93
95
  // 标题文字颜色
94
96
  'group.background': 'rgba(29,55,113,0.6)',
95
- 'group.border.color': 'rgba(8,165,244,0.8)' // 边框颜色
97
+ 'group.border.color': 'rgba(8,165,244,0.8)',
98
+ // 边框颜色
99
+ 'group.splitLine': false // 标题底部边框
100
+
101
+ }
102
+ },
103
+ cluster: {
104
+ style: {
105
+ 'group.title.color': '#FFFFFF',
106
+ // 标题文字颜色
107
+ 'group.title.background': 'rgba(14,44,69,1)',
108
+ // 标题背景颜色 #0E2C45
109
+ 'group.background': 'rgba(14,44,69,1)',
110
+ // #0E2C45
111
+ 'group.border.color': '#08A5F4',
112
+ // 边框颜色
113
+ 'group.border.radius': 3
114
+ }
115
+ }
116
+ }, {
117
+ name: 'poly',
118
+ label: 'Poly',
119
+ toolsTheme: 'black',
120
+ backgroundImage: '/img/topo/themes/poly.png',
121
+ backgroundImageThumbnail: '/img/topo/themes/poly_thumbnail.png',
122
+ globalNodeLabelStyle: {
123
+ color: '#ffffff'
124
+ },
125
+ globalEdgeTagStyle: {
126
+ color: '#E4E9EE',
127
+ background: 'rgba(6, 54, 88, 1)',
128
+ // 背景色,不传使用默认内置 @V1.2 index.js:1 #063658
129
+ borderColor: '#08A5F4' // 边框颜色,不传使用默认内置。用于主题切换 @V1.2
130
+
131
+ },
132
+ text: {
133
+ color: '#ffffff'
134
+ },
135
+ group: {
136
+ style: {
137
+ 'group.title.background': 'rgba(0,0,0,0.01)',
138
+ // 标题背景颜色 #08A5F4
139
+ 'group.title.color': '#8FECFF',
140
+ // 标题文字颜色
141
+ 'group.title.border.color': '#ffffff',
142
+ // 边框颜色
143
+ 'group.background': 'rgba(0,0,0,0.01)',
144
+ 'group.border.color': '#ffffff',
145
+ // 边框颜色
146
+ 'group.splitLine': true // 标题底部边框
96
147
 
97
148
  }
98
149
  },
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.createTopoEventListener = createTopoEventListener;
5
+ var n = 0;
6
+
7
+ function createTopoEventListener(type, onMessage) {
8
+ var eventListenerName = "topo_" + n++;
9
+ var EE = window.EE;
10
+
11
+ if (EE) {
12
+ EE.on('topo', eventListenerName, function (data) {
13
+ if (data.type === type) {
14
+ onMessage(data.data);
15
+ }
16
+ });
17
+ }
18
+
19
+ return {
20
+ eventListenerName: eventListenerName,
21
+ close: function close() {
22
+ if (EE) {
23
+ window.EE.removeListener('topo', eventListenerName);
24
+ }
25
+ }
26
+ };
27
+ }
@@ -11,10 +11,10 @@ var _react = require("react");
11
11
 
12
12
  var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
13
13
 
14
- var _componentRiilEventEmitter = require("@riil-frontend/component-riil-event-emitter");
15
-
16
14
  var _useGraphAlarmDisplay = _interopRequireDefault(require("./useGraphAlarmDisplay"));
17
15
 
16
+ var _useTopoEventListener = _interopRequireDefault(require("./useTopoEventListener"));
17
+
18
18
  /**
19
19
  *
20
20
  *
@@ -117,20 +117,27 @@ function useAlarm(options) {
117
117
  received: data,
118
118
  all: relateTopoAlarm
119
119
  });
120
- };
120
+ }; // 订阅消息
121
121
 
122
- (0, _componentRiilEventEmitter.useCbbEventListener)("topo", {
123
- name: "topo",
122
+
123
+ (0, _useTopoEventListener["default"])({
124
+ type: 'alarm',
124
125
  onMessage: function onMessage(data) {
125
126
  _rlog["default"].debug("Topoget--AlertMesage------------", topo, data);
126
127
 
127
- if (data.type === "alarm") {
128
- topo.alarm.handleAlarmEvent(data.data);
129
- } else if (data.type === "risk") {
130
- handleRiskData(data.data);
131
- } else if (data.type === "relateTopoAlarm") {
132
- handleRelateTopoAlarm(data.data);
133
- }
128
+ topo.alarm.handleAlarmEvent(data);
129
+ }
130
+ });
131
+ (0, _useTopoEventListener["default"])({
132
+ type: 'risk',
133
+ onMessage: function onMessage(data) {
134
+ handleRiskData(data);
135
+ }
136
+ });
137
+ (0, _useTopoEventListener["default"])({
138
+ type: 'relateTopoAlarm',
139
+ onMessage: function onMessage(data) {
140
+ handleRelateTopoAlarm(data);
134
141
  }
135
142
  });
136
143
  }