@riil-frontend/component-topology 8.0.3 → 8.0.5
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.css +1 -1
- package/build/index.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +14 -9
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/utils/graphLinkUtil.js +11 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +19 -12
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +7 -0
- package/es/networkTopo/hooks/useLinkDynamicStyle.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +14 -9
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/utils/graphLinkUtil.js +11 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +19 -12
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/index.module.scss +7 -0
- package/lib/networkTopo/hooks/useLinkDynamicStyle.js +1 -1
- package/package.json +2 -2
@@ -76,16 +76,21 @@ function getValuesByEdges(topo) {
|
|
76
76
|
})[0] || 'nil';
|
77
77
|
}
|
78
78
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
79
|
+
function getEdgesValues(edges) {
|
80
|
+
var edgeValues = [];
|
81
|
+
edges.forEach(function (edge) {
|
82
|
+
edgeValues.push({
|
83
|
+
lineButton: edge.s('edge.type'),
|
84
|
+
startPoint: getStartPoint(edge),
|
85
|
+
endPoint: getEndPoint(edge),
|
86
|
+
lineMold: edge.a('lineMode') || 'solidLine'
|
87
|
+
});
|
87
88
|
});
|
88
|
-
|
89
|
+
return edgeValues;
|
90
|
+
}
|
91
|
+
|
92
|
+
var selectionEdges = getEdgesBySelection(topo);
|
93
|
+
var edgeValues = getEdgesValues(selectionEdges);
|
89
94
|
var values = {
|
90
95
|
lineButton: undefined,
|
91
96
|
startPoint: undefined,
|
@@ -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.
|
26
|
+
var version = typeof "8.0.5" === 'string' ? "8.0.5" : null;
|
27
27
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
28
28
|
/**
|
29
29
|
* 拓扑显示和编辑
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { getEdges } from "../../utils/htElementUtils";
|
2
2
|
/**
|
3
|
-
*
|
3
|
+
* 连线两端节点变更时更新显示。如果两端互相切换,切换两端样式
|
4
4
|
* @param {*} topo
|
5
5
|
*/
|
6
6
|
|
@@ -10,13 +10,22 @@ export function fixLink(topo) {
|
|
10
10
|
var edges = getEdges(dm);
|
11
11
|
edges.forEach(function (edge) {
|
12
12
|
var source = edge.getSource();
|
13
|
+
var target = edge.getTarget();
|
13
14
|
var linkData = linkDatas.find(function (data) {
|
14
15
|
return data.id === edge.getTag();
|
15
|
-
});
|
16
|
+
}); // TODO 判断两端互相切换
|
17
|
+
// const isChange =
|
16
18
|
|
17
19
|
if (linkData && source.getTag() !== linkData.source) {
|
18
20
|
var node = dm.getDataByTag(linkData.source);
|
19
21
|
edge.setSource(node);
|
20
22
|
}
|
23
|
+
|
24
|
+
if (linkData && linkData.target && target.getTag() !== linkData.target) {
|
25
|
+
var _node = dm.getDataByTag(linkData.target);
|
26
|
+
|
27
|
+
edge.setTarget(_node);
|
28
|
+
} // TODO 两端互相切换,交换两端样式
|
29
|
+
|
21
30
|
});
|
22
31
|
}
|
@@ -155,7 +155,12 @@ export default function ResourceOverview(props) {
|
|
155
155
|
|
156
156
|
function onClose() {
|
157
157
|
isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
|
158
|
-
}
|
158
|
+
}
|
159
|
+
|
160
|
+
var jump = function jump(roomLink) {
|
161
|
+
onClose();
|
162
|
+
roomLink && window.open("" + window.location.origin + roomLink);
|
163
|
+
}; // 基本信息可选项
|
159
164
|
|
160
165
|
|
161
166
|
var baseInfoCol = useMemo(function () {
|
@@ -409,7 +414,7 @@ export default function ResourceOverview(props) {
|
|
409
414
|
_baseInfoColChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(col) {
|
410
415
|
var _col;
|
411
416
|
|
412
|
-
var infoData, attributeMap, _iterator, _step, item, value, contentTitle, link, address, owned_computer_room, owned_cabinet,
|
417
|
+
var infoData, attributeMap, _iterator, _step, item, value, contentTitle, link, address, owned_computer_room, owned_cabinet, node, _data, _ref2, _ref2$, _item, _attributeMap, object, _object, displayName, attr;
|
413
418
|
|
414
419
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
415
420
|
while (1) {
|
@@ -477,16 +482,18 @@ export default function ResourceOverview(props) {
|
|
477
482
|
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
478
483
|
|
479
484
|
if (owned_computer_room && owned_cabinet) {
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
485
|
+
(function () {
|
486
|
+
// /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
|
487
|
+
var roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
|
488
|
+
value = /*#__PURE__*/React.createElement("span", {
|
489
|
+
onClick: function onClick() {
|
490
|
+
jump(roomLink);
|
491
|
+
}
|
492
|
+
}, /*#__PURE__*/React.createElement("span", {
|
493
|
+
className: styles.link,
|
494
|
+
title: address
|
495
|
+
}, address));
|
496
|
+
})();
|
490
497
|
} else {
|
491
498
|
value = address;
|
492
499
|
}
|
@@ -30,6 +30,13 @@
|
|
30
30
|
overflow: hidden;
|
31
31
|
text-overflow: ellipsis;
|
32
32
|
white-space: nowrap;
|
33
|
+
color: var(--color-link-1);
|
34
|
+
cursor: pointer;
|
35
|
+
}
|
36
|
+
.link:hover{
|
37
|
+
color: var(--btn-text-primary-color-hover);
|
38
|
+
background-color: transparent;
|
39
|
+
border-color: transparent;
|
33
40
|
}
|
34
41
|
}
|
35
42
|
}
|
@@ -16,7 +16,7 @@ export default function useLinkDynamicStyle(props) {
|
|
16
16
|
var topoModState = topo.store.useModelState('topoMod');
|
17
17
|
var graphLoaded = topoModState.graphLoaded,
|
18
18
|
topoData = topoModState.data;
|
19
|
-
var displayConfig = topo.store.
|
19
|
+
var displayConfig = topo.store.useModelState('displayConfig');
|
20
20
|
var autoChangeEdgeWidth = displayConfig.autoChangeEdgeWidth !== false;
|
21
21
|
useEffect(function () {
|
22
22
|
// 拓扑图加载完成时刷新
|
@@ -94,16 +94,21 @@ function getValuesByEdges(topo) {
|
|
94
94
|
})[0] || 'nil';
|
95
95
|
}
|
96
96
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
97
|
+
function getEdgesValues(edges) {
|
98
|
+
var edgeValues = [];
|
99
|
+
edges.forEach(function (edge) {
|
100
|
+
edgeValues.push({
|
101
|
+
lineButton: edge.s('edge.type'),
|
102
|
+
startPoint: getStartPoint(edge),
|
103
|
+
endPoint: getEndPoint(edge),
|
104
|
+
lineMold: edge.a('lineMode') || 'solidLine'
|
105
|
+
});
|
105
106
|
});
|
106
|
-
|
107
|
+
return edgeValues;
|
108
|
+
}
|
109
|
+
|
110
|
+
var selectionEdges = (0, _edgeTypeStyleUtil.getEdgesBySelection)(topo);
|
111
|
+
var edgeValues = getEdgesValues(selectionEdges);
|
107
112
|
var values = {
|
108
113
|
lineButton: undefined,
|
109
114
|
startPoint: undefined,
|
@@ -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.
|
57
|
+
var version = typeof "8.0.5" === 'string' ? "8.0.5" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
@@ -6,7 +6,7 @@ exports.fixLink = fixLink;
|
|
6
6
|
var _htElementUtils = require("../../utils/htElementUtils");
|
7
7
|
|
8
8
|
/**
|
9
|
-
*
|
9
|
+
* 连线两端节点变更时更新显示。如果两端互相切换,切换两端样式
|
10
10
|
* @param {*} topo
|
11
11
|
*/
|
12
12
|
function fixLink(topo) {
|
@@ -15,13 +15,22 @@ function fixLink(topo) {
|
|
15
15
|
var edges = (0, _htElementUtils.getEdges)(dm);
|
16
16
|
edges.forEach(function (edge) {
|
17
17
|
var source = edge.getSource();
|
18
|
+
var target = edge.getTarget();
|
18
19
|
var linkData = linkDatas.find(function (data) {
|
19
20
|
return data.id === edge.getTag();
|
20
|
-
});
|
21
|
+
}); // TODO 判断两端互相切换
|
22
|
+
// const isChange =
|
21
23
|
|
22
24
|
if (linkData && source.getTag() !== linkData.source) {
|
23
25
|
var node = dm.getDataByTag(linkData.source);
|
24
26
|
edge.setSource(node);
|
25
27
|
}
|
28
|
+
|
29
|
+
if (linkData && linkData.target && target.getTag() !== linkData.target) {
|
30
|
+
var _node = dm.getDataByTag(linkData.target);
|
31
|
+
|
32
|
+
edge.setTarget(_node);
|
33
|
+
} // TODO 两端互相切换,交换两端样式
|
34
|
+
|
26
35
|
});
|
27
36
|
}
|
@@ -188,7 +188,12 @@ function ResourceOverview(props) {
|
|
188
188
|
|
189
189
|
function onClose() {
|
190
190
|
isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
|
191
|
-
}
|
191
|
+
}
|
192
|
+
|
193
|
+
var jump = function jump(roomLink) {
|
194
|
+
onClose();
|
195
|
+
roomLink && window.open("" + window.location.origin + roomLink);
|
196
|
+
}; // 基本信息可选项
|
192
197
|
|
193
198
|
|
194
199
|
var baseInfoCol = (0, _react.useMemo)(function () {
|
@@ -442,7 +447,7 @@ function ResourceOverview(props) {
|
|
442
447
|
_baseInfoColChange = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(col) {
|
443
448
|
var _col;
|
444
449
|
|
445
|
-
var infoData, attributeMap, _iterator, _step, item, value, contentTitle, link, address, owned_computer_room, owned_cabinet,
|
450
|
+
var infoData, attributeMap, _iterator, _step, item, value, contentTitle, link, address, owned_computer_room, owned_cabinet, node, _data, _ref2, _ref2$, _item, _attributeMap, object, _object, displayName, attr;
|
446
451
|
|
447
452
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
448
453
|
while (1) {
|
@@ -510,16 +515,18 @@ function ResourceOverview(props) {
|
|
510
515
|
owned_computer_room = attributeMap.owned_computer_room, owned_cabinet = attributeMap.owned_cabinet; // 跳转3D机房定位设备
|
511
516
|
|
512
517
|
if (owned_computer_room && owned_cabinet) {
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
518
|
+
(function () {
|
519
|
+
// /visual/room/index_runtime.html?type=preview&room_id=00000000383e3381&rack_id=11&device_id=122
|
520
|
+
var roomLink = "/visual/room/index_runtime.html?type=preview&room_id=" + owned_computer_room + "&rack_id=" + owned_cabinet + "&device_id=" + id;
|
521
|
+
value = /*#__PURE__*/_react["default"].createElement("span", {
|
522
|
+
onClick: function onClick() {
|
523
|
+
jump(roomLink);
|
524
|
+
}
|
525
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
526
|
+
className: _indexModule["default"].link,
|
527
|
+
title: address
|
528
|
+
}, address));
|
529
|
+
})();
|
523
530
|
} else {
|
524
531
|
value = address;
|
525
532
|
}
|
@@ -30,6 +30,13 @@
|
|
30
30
|
overflow: hidden;
|
31
31
|
text-overflow: ellipsis;
|
32
32
|
white-space: nowrap;
|
33
|
+
color: var(--color-link-1);
|
34
|
+
cursor: pointer;
|
35
|
+
}
|
36
|
+
.link:hover{
|
37
|
+
color: var(--btn-text-primary-color-hover);
|
38
|
+
background-color: transparent;
|
39
|
+
border-color: transparent;
|
33
40
|
}
|
34
41
|
}
|
35
42
|
}
|
@@ -24,7 +24,7 @@ function useLinkDynamicStyle(props) {
|
|
24
24
|
var topoModState = topo.store.useModelState('topoMod');
|
25
25
|
var graphLoaded = topoModState.graphLoaded,
|
26
26
|
topoData = topoModState.data;
|
27
|
-
var displayConfig = topo.store.
|
27
|
+
var displayConfig = topo.store.useModelState('displayConfig');
|
28
28
|
var autoChangeEdgeWidth = displayConfig.autoChangeEdgeWidth !== false;
|
29
29
|
(0, _react.useEffect)(function () {
|
30
30
|
// 拓扑图加载完成时刷新
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "8.0.
|
3
|
+
"version": "8.0.5",
|
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@8.0.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@8.0.5/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|