@riil-frontend/component-topology 9.0.0-a.16 → 9.0.0-a.18

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.
@@ -12,7 +12,8 @@ export default function GraphViewPanel(props) {
12
12
  themeName: themeName,
13
13
  hideBackgroundColor: hideBackgroundColor
14
14
  }),
15
- canvasColor = _useCanvasTheme.canvasColor;
15
+ canvasColor = _useCanvasTheme.canvasColor,
16
+ canvasbackgroundImage = _useCanvasTheme.canvasbackgroundImage;
16
17
 
17
18
  useEffect(function () {
18
19
  // eslint-disable-next-line no-underscore-dangle
@@ -31,7 +32,7 @@ export default function GraphViewPanel(props) {
31
32
  return /*#__PURE__*/React.createElement("div", {
32
33
  className: styles.viewPanel,
33
34
  style: {
34
- background: canvasColor
35
+ background: canvasColor || "url(" + canvasbackgroundImage + ")"
35
36
  },
36
37
  onFocus: onFocus
37
38
  }, props.children);
@@ -21,7 +21,7 @@ export default function CanvasPanel(props) {
21
21
  }, /*#__PURE__*/React.createElement(_Tag.Selectable, {
22
22
  className: styles.tag,
23
23
  style: {
24
- background: item.color
24
+ background: item.color || "url(" + item.backgroundImageThumbnail + ")"
25
25
  },
26
26
  checked: item.name === canvasThemeName,
27
27
  onChange: function onChange(checked) {
@@ -101,5 +101,50 @@ var THEMES = [_extends({}, baseLightTheme, {
101
101
  'group.border.radius': 3
102
102
  }
103
103
  }
104
+ }, {
105
+ name: 'poly',
106
+ label: 'Poly',
107
+ toolsTheme: 'black',
108
+ backgroundImage: '/img/topo/themes/poly.png',
109
+ backgroundImageThumbnail: '/img/topo/themes/poly_thumbnail.png',
110
+ globalNodeLabelStyle: {
111
+ color: '#ffffff'
112
+ },
113
+ globalEdgeTagStyle: {
114
+ color: '#E4E9EE',
115
+ background: 'rgba(6, 54, 88, 1)',
116
+ // 背景色,不传使用默认内置 @V1.2 index.js:1 #063658
117
+ borderColor: '#08A5F4' // 边框颜色,不传使用默认内置。用于主题切换 @V1.2
118
+
119
+ },
120
+ text: {
121
+ color: '#ffffff'
122
+ },
123
+ group: {
124
+ style: {
125
+ 'group.title.background': 'rgba(0,0,0,0)',
126
+ // 标题背景颜色 #08A5F4
127
+ 'group.title.color': '#8FECFF',
128
+ // 标题文字颜色
129
+ 'group.title.border.color': '#ffffff',
130
+ // 边框颜色
131
+ 'group.background': 'rgba(29,55,113,0.6)',
132
+ 'group.border.color': '#ffffff' // 边框颜色
133
+
134
+ }
135
+ },
136
+ cluster: {
137
+ style: {
138
+ 'group.title.color': '#FFFFFF',
139
+ // 标题文字颜色
140
+ 'group.title.background': 'rgba(14,44,69,1)',
141
+ // 标题背景颜色 #0E2C45
142
+ 'group.background': 'rgba(14,44,69,1)',
143
+ // #0E2C45
144
+ 'group.border.color': '#08A5F4',
145
+ // 边框颜色
146
+ 'group.border.radius': 3
147
+ }
148
+ }
104
149
  }];
105
150
  export default THEMES;
@@ -23,6 +23,11 @@ var themeMap = [{
23
23
  label: '深色',
24
24
  color: '#031425',
25
25
  toolsTheme: 'black'
26
+ }, {
27
+ name: 'poly',
28
+ label: 'Poly',
29
+ toolsTheme: 'black',
30
+ backgroundImage: '/img/topo/themes/poly.png'
26
31
  }].reduce(function (map, item) {
27
32
  var _extends2;
28
33
 
@@ -38,6 +43,7 @@ export default function useCanvasTheme(props) {
38
43
 
39
44
  var themeConfig = themeMap[themeName || 'white'];
40
45
  var canvasColor = hideBackgroundColor ? null : themeConfig.color;
46
+ var canvasbackgroundImage = hideBackgroundColor ? null : themeConfig.backgroundImage;
41
47
  useEffect(function () {
42
48
  // 设置
43
49
  if (graphLoaded && themeConfig) {
@@ -60,6 +66,7 @@ export default function useCanvasTheme(props) {
60
66
  }
61
67
  }, [graphLoaded, canvasColor]);
62
68
  return {
63
- canvasColor: canvasColor
69
+ canvasColor: canvasColor,
70
+ canvasbackgroundImage: canvasbackgroundImage
64
71
  };
65
72
  }
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
24
24
  import SelectionModel from "./SelectionModel";
25
25
  import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
26
26
 
27
- var version = typeof "9.0.0-a.16" === 'string' ? "9.0.0-a.16" : null;
27
+ var version = typeof "9.0.0-a.18" === 'string' ? "9.0.0-a.18" : null;
28
28
  console.info("\u62D3\u6251\u7248\u672C: " + version);
29
29
  /**
30
30
  * 拓扑显示和编辑
@@ -12,6 +12,20 @@ export default function LinkTopo(props) {
12
12
  linkCi: data,
13
13
  linkMetricCodes: linkMetricCodes
14
14
  });
15
+ var linkMetrics = [].concat(metricData.linkMetrics, metricData.linkOther);
16
+ var linkMetricsList = [];
17
+
18
+ if (linkMetrics.length > 0) {
19
+ linkMetricCodes.forEach(function (e) {
20
+ var linkMetricsData = linkMetrics.filter(function (i) {
21
+ return e == i.code;
22
+ });
23
+ if (linkMetricsData.length > 0) linkMetricsList.push(linkMetricsData[0]);
24
+ });
25
+ metricData.linkMetrics = linkMetricsList;
26
+ metricData.linkOther = [];
27
+ }
28
+
15
29
  return /*#__PURE__*/React.createElement("div", {
16
30
  className: styles.container
17
31
  }, /*#__PURE__*/React.createElement(CrucialLinkTopo, _extends({
@@ -318,7 +318,7 @@ function _queryRetansRatioNetDelayRatio() {
318
318
  if (retansRatioNetDelayRatioCodes.includes('netDelayRatio')) {
319
319
  linkOther.push({
320
320
  'code': 'netDelayRatio',
321
- 'name': '下行RTT时延',
321
+ 'name': 'RTT时延',
322
322
  'ts': result.time,
323
323
  'value': (result.upNetDelayRatio * 1).toFixed(2) + ' ms' + '|' + (result.downNetDelayRatio * 1).toFixed(2) + ' ms'
324
324
  });
@@ -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
 
@@ -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);
@@ -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) {
@@ -109,6 +109,51 @@ var THEMES = [(0, _extends2["default"])({}, baseLightTheme, {
109
109
  'group.border.radius': 3
110
110
  }
111
111
  }
112
+ }, {
113
+ name: 'poly',
114
+ label: 'Poly',
115
+ toolsTheme: 'black',
116
+ backgroundImage: '/img/topo/themes/poly.png',
117
+ backgroundImageThumbnail: '/img/topo/themes/poly_thumbnail.png',
118
+ globalNodeLabelStyle: {
119
+ color: '#ffffff'
120
+ },
121
+ globalEdgeTagStyle: {
122
+ color: '#E4E9EE',
123
+ background: 'rgba(6, 54, 88, 1)',
124
+ // 背景色,不传使用默认内置 @V1.2 index.js:1 #063658
125
+ borderColor: '#08A5F4' // 边框颜色,不传使用默认内置。用于主题切换 @V1.2
126
+
127
+ },
128
+ text: {
129
+ color: '#ffffff'
130
+ },
131
+ group: {
132
+ style: {
133
+ 'group.title.background': 'rgba(0,0,0,0)',
134
+ // 标题背景颜色 #08A5F4
135
+ 'group.title.color': '#8FECFF',
136
+ // 标题文字颜色
137
+ 'group.title.border.color': '#ffffff',
138
+ // 边框颜色
139
+ 'group.background': 'rgba(29,55,113,0.6)',
140
+ 'group.border.color': '#ffffff' // 边框颜色
141
+
142
+ }
143
+ },
144
+ cluster: {
145
+ style: {
146
+ 'group.title.color': '#FFFFFF',
147
+ // 标题文字颜色
148
+ 'group.title.background': 'rgba(14,44,69,1)',
149
+ // 标题背景颜色 #0E2C45
150
+ 'group.background': 'rgba(14,44,69,1)',
151
+ // #0E2C45
152
+ 'group.border.color': '#08A5F4',
153
+ // 边框颜色
154
+ 'group.border.radius': 3
155
+ }
156
+ }
112
157
  }];
113
158
  var _default = THEMES;
114
159
  exports["default"] = _default;
@@ -36,6 +36,11 @@ var themeMap = [{
36
36
  label: '深色',
37
37
  color: '#031425',
38
38
  toolsTheme: 'black'
39
+ }, {
40
+ name: 'poly',
41
+ label: 'Poly',
42
+ toolsTheme: 'black',
43
+ backgroundImage: '/img/topo/themes/poly.png'
39
44
  }].reduce(function (map, item) {
40
45
  var _extends2;
41
46
 
@@ -52,6 +57,7 @@ function useCanvasTheme(props) {
52
57
 
53
58
  var themeConfig = themeMap[themeName || 'white'];
54
59
  var canvasColor = hideBackgroundColor ? null : themeConfig.color;
60
+ var canvasbackgroundImage = hideBackgroundColor ? null : themeConfig.backgroundImage;
55
61
  (0, _react.useEffect)(function () {
56
62
  // 设置
57
63
  if (graphLoaded && themeConfig) {
@@ -74,6 +80,7 @@ function useCanvasTheme(props) {
74
80
  }
75
81
  }, [graphLoaded, canvasColor]);
76
82
  return {
77
- canvasColor: canvasColor
83
+ canvasColor: canvasColor,
84
+ canvasbackgroundImage: canvasbackgroundImage
78
85
  };
79
86
  }
@@ -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.16" === 'string' ? "9.0.0-a.16" : null;
59
+ var version = typeof "9.0.0-a.18" === 'string' ? "9.0.0-a.18" : null;
60
60
  console.info("\u62D3\u6251\u7248\u672C: " + version);
61
61
  /**
62
62
  * 拓扑显示和编辑
@@ -25,6 +25,20 @@ function LinkTopo(props) {
25
25
  linkCi: data,
26
26
  linkMetricCodes: linkMetricCodes
27
27
  });
28
+ var linkMetrics = [].concat(metricData.linkMetrics, metricData.linkOther);
29
+ var linkMetricsList = [];
30
+
31
+ if (linkMetrics.length > 0) {
32
+ linkMetricCodes.forEach(function (e) {
33
+ var linkMetricsData = linkMetrics.filter(function (i) {
34
+ return e == i.code;
35
+ });
36
+ if (linkMetricsData.length > 0) linkMetricsList.push(linkMetricsData[0]);
37
+ });
38
+ metricData.linkMetrics = linkMetricsList;
39
+ metricData.linkOther = [];
40
+ }
41
+
28
42
  return /*#__PURE__*/_react["default"].createElement("div", {
29
43
  className: _LinkTopoModule["default"].container
30
44
  }, /*#__PURE__*/_react["default"].createElement(_componentCrucialLinkTopo["default"], (0, _extends2["default"])({
@@ -351,7 +351,7 @@ function _queryRetansRatioNetDelayRatio() {
351
351
  if (retansRatioNetDelayRatioCodes.includes('netDelayRatio')) {
352
352
  linkOther.push({
353
353
  'code': 'netDelayRatio',
354
- 'name': '下行RTT时延',
354
+ 'name': 'RTT时延',
355
355
  'ts': result.time,
356
356
  'value': (result.upNetDelayRatio * 1).toFixed(2) + ' ms' + '|' + (result.downNetDelayRatio * 1).toFixed(2) + ' ms'
357
357
  });
@@ -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.16",
3
+ "version": "9.0.0-a.18",
4
4
  "description": "拓扑",
5
5
  "scripts": {
6
6
  "start": "build-scripts start",
@@ -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.16/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@9.0.0-a.18/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }