@riil-frontend/component-topology 13.0.0-dev.7 → 13.0.0-dev.8
Sign up to get free protection for your applications and to get access to all the features.
- package/build/index.js +7 -7
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +4 -2
- package/es/networkTopo/services/topo/basic.js +3 -2
- package/es/networkTopo/utils/__tests__/relateTopoData.js +73 -1
- package/es/networkTopo/utils/exitLinkUtil.js +2 -2
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +6 -2
- package/lib/networkTopo/services/topo/basic.js +3 -2
- package/lib/networkTopo/utils/__tests__/relateTopoData.js +73 -1
- package/lib/networkTopo/utils/exitLinkUtil.js +2 -2
- package/package.json +2 -2
@@ -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 "13.0.0-dev.
|
27
|
+
var version = typeof "13.0.0-dev.8" === 'string' ? "13.0.0-dev.8" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
CHANGED
@@ -10,11 +10,11 @@ import Link from "../../../../../../../components/Link";
|
|
10
10
|
import service from "../../../../../../services/overview";
|
11
11
|
import styles from "./index.module.scss";
|
12
12
|
import { getHistory } from '@riil-frontend/component-topology-utils';
|
13
|
+
import loglevel from 'loglevel';
|
13
14
|
|
14
15
|
function formatUrl(url) {
|
15
16
|
var _window, _window$location;
|
16
17
|
|
17
|
-
console.log(url);
|
18
18
|
var prefix = '/default/pagecenter';
|
19
19
|
|
20
20
|
if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
|
@@ -28,12 +28,14 @@ function EventsCard(props) {
|
|
28
28
|
var alarmRiskList = props.alarmRiskList,
|
29
29
|
closeDetailDrawer = props.closeDetailDrawer,
|
30
30
|
onHandleAlarm = props.onHandleAlarm;
|
31
|
+
var log = loglevel.getLogger('topo');
|
31
32
|
|
32
33
|
var jumpTo = function jumpTo(url) {
|
33
34
|
closeDetailDrawer();
|
34
35
|
|
35
36
|
if (topo.viewProps.jumpto) {
|
36
|
-
|
37
|
+
log.debug('formatUrl(url)', url);
|
38
|
+
topo.viewProps.jumpto(url);
|
37
39
|
} else {
|
38
40
|
getHistory().push(formatUrl(url));
|
39
41
|
}
|
@@ -396,10 +396,11 @@ export default _extends({
|
|
396
396
|
return _extends({}, item, {
|
397
397
|
ciType: 'network_link'
|
398
398
|
});
|
399
|
-
})
|
399
|
+
}),
|
400
|
+
serialize: result.serialize ? JSON.parse(result.serialize) : undefined
|
400
401
|
});
|
401
|
-
result = processExitLink(result);
|
402
402
|
result = processBothTopoDataUtil.processBothTopoData(result);
|
403
|
+
result = processExitLink(result);
|
403
404
|
return _context12.abrupt("return", result);
|
404
405
|
|
405
406
|
case 7:
|
@@ -1,4 +1,76 @@
|
|
1
|
-
export var topoLinks = [//
|
1
|
+
export var topoLinks = [// 子拓扑与资源间
|
2
|
+
{
|
3
|
+
"id": "1-2",
|
4
|
+
"name": "子拓扑链路",
|
5
|
+
'sourceType': 'topo',
|
6
|
+
"source": "3",
|
7
|
+
"target": "00000000010de861",
|
8
|
+
"operation": "delete",
|
9
|
+
"ciType": "network_link",
|
10
|
+
"attributes": {
|
11
|
+
"network_link.source_device_ipv4": "172.17.166.18",
|
12
|
+
"network_link.destination_ipv4": "1.5.5.5",
|
13
|
+
"network_link.work_mode": "AandS",
|
14
|
+
"support_templates": "m.ethernet_link",
|
15
|
+
"rated_bandwidth": 100,
|
16
|
+
"network_link.actual_bandwidth": 100,
|
17
|
+
"source_type": "network.interface",
|
18
|
+
"network_link.connect_type": "phy",
|
19
|
+
"display_name": "172.17.166.18(Fa 0/10) - 1.5.5.5",
|
20
|
+
"asset_status": "2",
|
21
|
+
"network_link_type": "2",
|
22
|
+
"destination_type": "ip",
|
23
|
+
"network_link.role": "master",
|
24
|
+
"network_link.network_category": "CAN",
|
25
|
+
"dcs": "331268969",
|
26
|
+
"network_link.source_ipv4": "172.17.166.18",
|
27
|
+
"name": "172.17.166.18(Fa 0/10) - 1.5.5.5",
|
28
|
+
"distance_outlet": 2147483647,
|
29
|
+
"network_link.is_crucial": false,
|
30
|
+
"source_id": "00000000010de8b2",
|
31
|
+
"network_link.source_device_id": "00000000010de861"
|
32
|
+
},
|
33
|
+
"sourceCode": null,
|
34
|
+
"level": null,
|
35
|
+
"customType": null,
|
36
|
+
"manageStatus": 3
|
37
|
+
}, // 子拓扑与IP间
|
38
|
+
{
|
39
|
+
"id": "3-2",
|
40
|
+
"name": "子拓扑链路",
|
41
|
+
'sourceType': 'topo',
|
42
|
+
"source": "3",
|
43
|
+
"target": "",
|
44
|
+
"operation": "delete",
|
45
|
+
"ciType": "network_link",
|
46
|
+
"attributes": {
|
47
|
+
"network_link.source_device_ipv4": "172.17.166.18",
|
48
|
+
"network_link.destination_ipv4": "1.5.5.5",
|
49
|
+
"network_link.work_mode": "AandS",
|
50
|
+
"support_templates": "m.ethernet_link",
|
51
|
+
"rated_bandwidth": 100,
|
52
|
+
"network_link.actual_bandwidth": 100,
|
53
|
+
"source_type": "network.interface",
|
54
|
+
"network_link.connect_type": "phy",
|
55
|
+
"display_name": "172.17.166.18(Fa 0/10) - 1.5.5.5",
|
56
|
+
"asset_status": "2",
|
57
|
+
"network_link_type": "2",
|
58
|
+
"destination_type": "ip",
|
59
|
+
"network_link.role": "master",
|
60
|
+
"network_link.network_category": "CAN",
|
61
|
+
"dcs": "331268969",
|
62
|
+
"network_link.source_ipv4": "172.17.166.18",
|
63
|
+
"name": "172.17.166.18(Fa 0/10) - 1.5.5.5",
|
64
|
+
"distance_outlet": 2147483647,
|
65
|
+
"network_link.is_crucial": false,
|
66
|
+
"source_id": "00000000010de8b2",
|
67
|
+
"network_link.source_device_id": "00000000010de861"
|
68
|
+
},
|
69
|
+
"sourceCode": null,
|
70
|
+
"level": null,
|
71
|
+
"customType": null,
|
72
|
+
"manageStatus": 3
|
73
|
+
}, // 子拓扑之间
|
2
74
|
{
|
3
75
|
"id": "2-2",
|
4
76
|
"name": "子拓扑链路",
|
@@ -36,11 +36,11 @@ export function buildIpNode(ip) {
|
|
36
36
|
}
|
37
37
|
|
38
38
|
function getHtSerialize(serialize) {
|
39
|
-
if (serialize) {
|
39
|
+
if (serialize && typeof serialize === 'string') {
|
40
40
|
return JSON.parse(serialize);
|
41
41
|
}
|
42
42
|
|
43
|
-
return
|
43
|
+
return serialize;
|
44
44
|
}
|
45
45
|
|
46
46
|
function isExitLink(link) {
|
@@ -54,7 +54,7 @@ var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
|
54
54
|
var _CiCache = _interopRequireDefault(require("./cache/CiCache"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "13.0.0-dev.
|
57
|
+
var version = typeof "13.0.0-dev.8" === 'string' ? "13.0.0-dev.8" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js
CHANGED
@@ -29,10 +29,11 @@ var _indexModule = _interopRequireDefault(require("./index.module.scss"));
|
|
29
29
|
|
30
30
|
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
31
31
|
|
32
|
+
var _loglevel = _interopRequireDefault(require("loglevel"));
|
33
|
+
|
32
34
|
function formatUrl(url) {
|
33
35
|
var _window, _window$location;
|
34
36
|
|
35
|
-
console.log(url);
|
36
37
|
var prefix = '/default/pagecenter';
|
37
38
|
|
38
39
|
if (((_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname.indexOf(prefix)) === 0 && (url === null || url === void 0 ? void 0 : url.indexOf(prefix)) === 0) {
|
@@ -47,11 +48,14 @@ function EventsCard(props) {
|
|
47
48
|
closeDetailDrawer = props.closeDetailDrawer,
|
48
49
|
onHandleAlarm = props.onHandleAlarm;
|
49
50
|
|
51
|
+
var log = _loglevel["default"].getLogger('topo');
|
52
|
+
|
50
53
|
var jumpTo = function jumpTo(url) {
|
51
54
|
closeDetailDrawer();
|
52
55
|
|
53
56
|
if (topo.viewProps.jumpto) {
|
54
|
-
|
57
|
+
log.debug('formatUrl(url)', url);
|
58
|
+
topo.viewProps.jumpto(url);
|
55
59
|
} else {
|
56
60
|
(0, _componentTopologyUtils.getHistory)().push(formatUrl(url));
|
57
61
|
}
|
@@ -419,10 +419,11 @@ var _default = (0, _extends2["default"])({
|
|
419
419
|
return (0, _extends2["default"])({}, item, {
|
420
420
|
ciType: 'network_link'
|
421
421
|
});
|
422
|
-
})
|
422
|
+
}),
|
423
|
+
serialize: result.serialize ? JSON.parse(result.serialize) : undefined
|
423
424
|
});
|
424
|
-
result = (0, _exitLinkUtil.processExitLink)(result);
|
425
425
|
result = processBothTopoDataUtil.processBothTopoData(result);
|
426
|
+
result = (0, _exitLinkUtil.processExitLink)(result);
|
426
427
|
return _context12.abrupt("return", result);
|
427
428
|
|
428
429
|
case 7:
|
@@ -2,7 +2,79 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.topoLinks = void 0;
|
5
|
-
var topoLinks = [//
|
5
|
+
var topoLinks = [// 子拓扑与资源间
|
6
|
+
{
|
7
|
+
"id": "1-2",
|
8
|
+
"name": "子拓扑链路",
|
9
|
+
'sourceType': 'topo',
|
10
|
+
"source": "3",
|
11
|
+
"target": "00000000010de861",
|
12
|
+
"operation": "delete",
|
13
|
+
"ciType": "network_link",
|
14
|
+
"attributes": {
|
15
|
+
"network_link.source_device_ipv4": "172.17.166.18",
|
16
|
+
"network_link.destination_ipv4": "1.5.5.5",
|
17
|
+
"network_link.work_mode": "AandS",
|
18
|
+
"support_templates": "m.ethernet_link",
|
19
|
+
"rated_bandwidth": 100,
|
20
|
+
"network_link.actual_bandwidth": 100,
|
21
|
+
"source_type": "network.interface",
|
22
|
+
"network_link.connect_type": "phy",
|
23
|
+
"display_name": "172.17.166.18(Fa 0/10) - 1.5.5.5",
|
24
|
+
"asset_status": "2",
|
25
|
+
"network_link_type": "2",
|
26
|
+
"destination_type": "ip",
|
27
|
+
"network_link.role": "master",
|
28
|
+
"network_link.network_category": "CAN",
|
29
|
+
"dcs": "331268969",
|
30
|
+
"network_link.source_ipv4": "172.17.166.18",
|
31
|
+
"name": "172.17.166.18(Fa 0/10) - 1.5.5.5",
|
32
|
+
"distance_outlet": 2147483647,
|
33
|
+
"network_link.is_crucial": false,
|
34
|
+
"source_id": "00000000010de8b2",
|
35
|
+
"network_link.source_device_id": "00000000010de861"
|
36
|
+
},
|
37
|
+
"sourceCode": null,
|
38
|
+
"level": null,
|
39
|
+
"customType": null,
|
40
|
+
"manageStatus": 3
|
41
|
+
}, // 子拓扑与IP间
|
42
|
+
{
|
43
|
+
"id": "3-2",
|
44
|
+
"name": "子拓扑链路",
|
45
|
+
'sourceType': 'topo',
|
46
|
+
"source": "3",
|
47
|
+
"target": "",
|
48
|
+
"operation": "delete",
|
49
|
+
"ciType": "network_link",
|
50
|
+
"attributes": {
|
51
|
+
"network_link.source_device_ipv4": "172.17.166.18",
|
52
|
+
"network_link.destination_ipv4": "1.5.5.5",
|
53
|
+
"network_link.work_mode": "AandS",
|
54
|
+
"support_templates": "m.ethernet_link",
|
55
|
+
"rated_bandwidth": 100,
|
56
|
+
"network_link.actual_bandwidth": 100,
|
57
|
+
"source_type": "network.interface",
|
58
|
+
"network_link.connect_type": "phy",
|
59
|
+
"display_name": "172.17.166.18(Fa 0/10) - 1.5.5.5",
|
60
|
+
"asset_status": "2",
|
61
|
+
"network_link_type": "2",
|
62
|
+
"destination_type": "ip",
|
63
|
+
"network_link.role": "master",
|
64
|
+
"network_link.network_category": "CAN",
|
65
|
+
"dcs": "331268969",
|
66
|
+
"network_link.source_ipv4": "172.17.166.18",
|
67
|
+
"name": "172.17.166.18(Fa 0/10) - 1.5.5.5",
|
68
|
+
"distance_outlet": 2147483647,
|
69
|
+
"network_link.is_crucial": false,
|
70
|
+
"source_id": "00000000010de8b2",
|
71
|
+
"network_link.source_device_id": "00000000010de861"
|
72
|
+
},
|
73
|
+
"sourceCode": null,
|
74
|
+
"level": null,
|
75
|
+
"customType": null,
|
76
|
+
"manageStatus": 3
|
77
|
+
}, // 子拓扑之间
|
6
78
|
{
|
7
79
|
"id": "2-2",
|
8
80
|
"name": "子拓扑链路",
|
@@ -47,11 +47,11 @@ function buildIpNode(ip) {
|
|
47
47
|
}
|
48
48
|
|
49
49
|
function getHtSerialize(serialize) {
|
50
|
-
if (serialize) {
|
50
|
+
if (serialize && typeof serialize === 'string') {
|
51
51
|
return JSON.parse(serialize);
|
52
52
|
}
|
53
53
|
|
54
|
-
return
|
54
|
+
return serialize;
|
55
55
|
}
|
56
56
|
|
57
57
|
function isExitLink(link) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "13.0.0-dev.
|
3
|
+
"version": "13.0.0-dev.8",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -123,6 +123,6 @@
|
|
123
123
|
"access": "public"
|
124
124
|
},
|
125
125
|
"license": "MIT",
|
126
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@13.0.0-dev.
|
126
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@13.0.0-dev.8/build/index.html",
|
127
127
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
128
128
|
}
|