@riil-frontend/component-topology 10.0.26 → 10.0.28
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/index.js +1 -1
- package/es/core/hooks/useCanvasTheme.js +1 -2
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/tagstips/ElementTagTipConfig.js +1 -1
- package/es/networkTopo/utils/edgeGroupTagUtil.js +38 -3
- package/lib/core/hooks/useCanvasTheme.js +1 -2
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/tagstips/ElementTagTipConfig.js +1 -1
- package/lib/networkTopo/utils/edgeGroupTagUtil.js +42 -3
- package/package.json +2 -2
@@ -54,8 +54,7 @@ export default function useCanvasTheme(props) {
|
|
54
54
|
// 设置
|
55
55
|
if (graphLoaded) {
|
56
56
|
try {
|
57
|
-
topo.getHtTopo().getGraphView().dm().setBackground(canvasColor);
|
58
|
-
topo.getHtTopo().getGraphView().dm().setBackground(canvasbackgroundImage);
|
57
|
+
topo.getHtTopo().getGraphView().dm().setBackground(canvasColor); // topo.getHtTopo().getGraphView().dm().setBackground(canvasbackgroundImage)
|
59
58
|
} catch (error) {
|
60
59
|
console.error('切换主题失败', error);
|
61
60
|
}
|
@@ -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 "10.0.
|
27
|
+
var version = typeof "10.0.28" === 'string' ? "10.0.28" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
@@ -149,7 +149,7 @@ var ElementTagTipConfig = /*#__PURE__*/function () {
|
|
149
149
|
var ciType = this.mtCiTypeMap[mtCode];
|
150
150
|
var ciTypeModel = this.topo.ciTyeCache.getCiType(ciType);
|
151
151
|
var metrics = ciTypeModel.metrics.filter(function (m) {
|
152
|
-
return !!_this2.mtMetricsMap[mtCode][m.code];
|
152
|
+
return _this2.mtMetricsMap[mtCode] && !!_this2.mtMetricsMap[mtCode][m.code];
|
153
153
|
});
|
154
154
|
return metrics;
|
155
155
|
};
|
@@ -1,10 +1,45 @@
|
|
1
1
|
// 获得连线组标注配置的链路id。无配置时取默认链路
|
2
2
|
export function getEdgeGroupLinkIdConfig(edgeGroup, topo) {
|
3
|
-
var _links$;
|
4
|
-
|
5
3
|
// const { } = options
|
6
4
|
var sourceId = edgeGroup.getSource().getTag();
|
7
5
|
var targetId = edgeGroup.getTarget().getTag();
|
8
6
|
var links = topo.dataModel.getEdgesBetweenTwoNodes(sourceId, targetId);
|
9
|
-
|
7
|
+
|
8
|
+
if (!links.length) {
|
9
|
+
return null;
|
10
|
+
}
|
11
|
+
|
12
|
+
return getEdgeGroupLinkConfig({
|
13
|
+
htElement: edgeGroup,
|
14
|
+
topo: topo,
|
15
|
+
links: links
|
16
|
+
});
|
17
|
+
}
|
18
|
+
export function getEdgeGroupConfigId(links) {
|
19
|
+
var link = links[0];
|
20
|
+
var sourceId = link.attributes['network_link.source_device_id'];
|
21
|
+
var targetId = link.attributes.destination_type === 'ip' ? link.attributes['network_link.destination_device_ipv4'] : link.attributes['network_link.destination_device_id'];
|
22
|
+
return [sourceId, targetId].sort().join(',');
|
23
|
+
}
|
24
|
+
/**
|
25
|
+
* 默认选中/显示标注为按名称排序第一条
|
26
|
+
* @param {*} links
|
27
|
+
* @returns
|
28
|
+
*/
|
29
|
+
|
30
|
+
function getDefaultLinkId(links) {
|
31
|
+
var sortedLinks = links.sort(function (a, b) {
|
32
|
+
return a.attributes.display_name.localeCompare(b.attributes.display_name);
|
33
|
+
});
|
34
|
+
return sortedLinks[0].id;
|
35
|
+
}
|
36
|
+
|
37
|
+
export function getEdgeGroupLinkConfig(_ref) {
|
38
|
+
var htElement = _ref.htElement,
|
39
|
+
topo = _ref.topo,
|
40
|
+
links = _ref.links;
|
41
|
+
var displayConfig = topo.store.getModelState('displayConfig');
|
42
|
+
var edgeGroupShowLinkTag = displayConfig.edgeGroupShowLinkTag || {};
|
43
|
+
var edgeGroupId = getEdgeGroupConfigId(links);
|
44
|
+
return edgeGroupShowLinkTag[edgeGroupId] || getDefaultLinkId(links);
|
10
45
|
}
|
@@ -68,8 +68,7 @@ function useCanvasTheme(props) {
|
|
68
68
|
// 设置
|
69
69
|
if (graphLoaded) {
|
70
70
|
try {
|
71
|
-
topo.getHtTopo().getGraphView().dm().setBackground(canvasColor);
|
72
|
-
topo.getHtTopo().getGraphView().dm().setBackground(canvasbackgroundImage);
|
71
|
+
topo.getHtTopo().getGraphView().dm().setBackground(canvasColor); // topo.getHtTopo().getGraphView().dm().setBackground(canvasbackgroundImage)
|
73
72
|
} catch (error) {
|
74
73
|
console.error('切换主题失败', error);
|
75
74
|
}
|
@@ -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 "10.0.
|
59
|
+
var version = typeof "10.0.28" === 'string' ? "10.0.28" : null;
|
60
60
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
61
61
|
/**
|
62
62
|
* 拓扑显示和编辑
|
@@ -162,7 +162,7 @@ var ElementTagTipConfig = /*#__PURE__*/function () {
|
|
162
162
|
var ciType = this.mtCiTypeMap[mtCode];
|
163
163
|
var ciTypeModel = this.topo.ciTyeCache.getCiType(ciType);
|
164
164
|
var metrics = ciTypeModel.metrics.filter(function (m) {
|
165
|
-
return !!_this2.mtMetricsMap[mtCode][m.code];
|
165
|
+
return _this2.mtMetricsMap[mtCode] && !!_this2.mtMetricsMap[mtCode][m.code];
|
166
166
|
});
|
167
167
|
return metrics;
|
168
168
|
};
|
@@ -1,15 +1,54 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
+
exports.getEdgeGroupConfigId = getEdgeGroupConfigId;
|
5
|
+
exports.getEdgeGroupLinkConfig = getEdgeGroupLinkConfig;
|
4
6
|
exports.getEdgeGroupLinkIdConfig = getEdgeGroupLinkIdConfig;
|
5
7
|
|
6
8
|
// 获得连线组标注配置的链路id。无配置时取默认链路
|
7
9
|
function getEdgeGroupLinkIdConfig(edgeGroup, topo) {
|
8
|
-
var _links$;
|
9
|
-
|
10
10
|
// const { } = options
|
11
11
|
var sourceId = edgeGroup.getSource().getTag();
|
12
12
|
var targetId = edgeGroup.getTarget().getTag();
|
13
13
|
var links = topo.dataModel.getEdgesBetweenTwoNodes(sourceId, targetId);
|
14
|
-
|
14
|
+
|
15
|
+
if (!links.length) {
|
16
|
+
return null;
|
17
|
+
}
|
18
|
+
|
19
|
+
return getEdgeGroupLinkConfig({
|
20
|
+
htElement: edgeGroup,
|
21
|
+
topo: topo,
|
22
|
+
links: links
|
23
|
+
});
|
24
|
+
}
|
25
|
+
|
26
|
+
function getEdgeGroupConfigId(links) {
|
27
|
+
var link = links[0];
|
28
|
+
var sourceId = link.attributes['network_link.source_device_id'];
|
29
|
+
var targetId = link.attributes.destination_type === 'ip' ? link.attributes['network_link.destination_device_ipv4'] : link.attributes['network_link.destination_device_id'];
|
30
|
+
return [sourceId, targetId].sort().join(',');
|
31
|
+
}
|
32
|
+
/**
|
33
|
+
* 默认选中/显示标注为按名称排序第一条
|
34
|
+
* @param {*} links
|
35
|
+
* @returns
|
36
|
+
*/
|
37
|
+
|
38
|
+
|
39
|
+
function getDefaultLinkId(links) {
|
40
|
+
var sortedLinks = links.sort(function (a, b) {
|
41
|
+
return a.attributes.display_name.localeCompare(b.attributes.display_name);
|
42
|
+
});
|
43
|
+
return sortedLinks[0].id;
|
44
|
+
}
|
45
|
+
|
46
|
+
function getEdgeGroupLinkConfig(_ref) {
|
47
|
+
var htElement = _ref.htElement,
|
48
|
+
topo = _ref.topo,
|
49
|
+
links = _ref.links;
|
50
|
+
var displayConfig = topo.store.getModelState('displayConfig');
|
51
|
+
var edgeGroupShowLinkTag = displayConfig.edgeGroupShowLinkTag || {};
|
52
|
+
var edgeGroupId = getEdgeGroupConfigId(links);
|
53
|
+
return edgeGroupShowLinkTag[edgeGroupId] || getDefaultLinkId(links);
|
15
54
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "10.0.
|
3
|
+
"version": "10.0.28",
|
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@10.0.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@10.0.28/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|