@riil-frontend/component-topology 12.0.0-dev.36 → 12.0.0-dev.40
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 +3 -3
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +2 -2
- package/es/core/editor/utils/edgeTypeStyleUtil.js +23 -0
- package/es/core/hooks/useTopoEdit.js +4 -0
- package/es/core/models/Alarm.js +14 -15
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/utils/linkUtils.js +13 -20
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +13 -8
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +2 -2
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +25 -0
- package/lib/core/hooks/useTopoEdit.js +4 -0
- package/lib/core/models/Alarm.js +14 -15
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/utils/linkUtils.js +13 -21
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +15 -8
- package/package.json +2 -2
@@ -32,8 +32,8 @@ function AlarmListItem(props) {
|
|
32
32
|
// 传入参数
|
33
33
|
var topo = props.topo,
|
34
34
|
alarmInfo = props.alarmInfo,
|
35
|
-
onClick = props.onClick;
|
36
|
-
|
35
|
+
onClick = props.onClick; // console.log("AlarmListPanel", topo, alarmInfo);
|
36
|
+
|
37
37
|
return /*#__PURE__*/React.createElement(_List.Item, {
|
38
38
|
className: styles.AlarmListItem,
|
39
39
|
media: /*#__PURE__*/React.createElement(_Icon, {
|
@@ -77,6 +77,29 @@ export function isNodeAllEdges(topo) {
|
|
77
77
|
});
|
78
78
|
return inEdges;
|
79
79
|
}
|
80
|
+
/**
|
81
|
+
* 遍历连线及子连线
|
82
|
+
* @param {*} topo
|
83
|
+
* @param {*} edges
|
84
|
+
* @param {*} operateEdgeFn
|
85
|
+
*/
|
86
|
+
|
87
|
+
export function loopEdgesAndChildren(topo, edges, operateEdgeFn) {
|
88
|
+
var htTopo = topo.getHtTopo();
|
89
|
+
edges.forEach(function (edge) {
|
90
|
+
operateEdgeFn(edge);
|
91
|
+
|
92
|
+
if (edge.isEdgeGroupAgent()) {
|
93
|
+
// 连线组折叠时同时设置子连线
|
94
|
+
var edgeChildren = edge.getEdgeGroup().getEdges().toArray();
|
95
|
+
htTopo.toggleEdgeGroup(edge.getSource(), edge.getTarget(), true);
|
96
|
+
edgeChildren.forEach(function (edgeChild) {
|
97
|
+
operateEdgeFn(edgeChild);
|
98
|
+
});
|
99
|
+
htTopo.toggleEdgeGroup(edge.getSource(), edge.getTarget(), false);
|
100
|
+
}
|
101
|
+
});
|
102
|
+
}
|
80
103
|
/**
|
81
104
|
* 设置连线及子连线。带回退事务控制
|
82
105
|
* @param {*} topo
|
@@ -95,6 +95,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
95
95
|
return topoDispatchers.setTopoType(TPL_TREE);
|
96
96
|
|
97
97
|
case 7:
|
98
|
+
// 更新配置
|
99
|
+
// resourceConfig.updateConfig(config);
|
100
|
+
// 更新配置对应的资源、链路
|
101
|
+
// editDispatchers.fetchDataByConfig();
|
98
102
|
topo.historyManager.endTransaction();
|
99
103
|
|
100
104
|
case 8:
|
package/es/core/models/Alarm.js
CHANGED
@@ -459,14 +459,14 @@ var Alarm = /*#__PURE__*/function () {
|
|
459
459
|
console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
|
460
460
|
|
461
461
|
if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
|
462
|
-
_context8.next =
|
462
|
+
_context8.next = 25;
|
463
463
|
break;
|
464
464
|
}
|
465
465
|
|
466
466
|
sendAl = [];
|
467
467
|
idsList = [].concat(nodeIdsList, linkIdsList);
|
468
|
-
operations = [];
|
469
|
-
|
468
|
+
operations = []; // console.log('idsList---------', idsList)
|
469
|
+
|
470
470
|
idsList.forEach(function (idItem) {
|
471
471
|
if (idItem.operation === null) {
|
472
472
|
operations.push(idItem.ciId);
|
@@ -492,22 +492,21 @@ var Alarm = /*#__PURE__*/function () {
|
|
492
492
|
if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
|
493
493
|
sendAl.push(obj);
|
494
494
|
}
|
495
|
-
});
|
496
|
-
console.log("before-combAlarmData", sendAl, idsList);
|
495
|
+
}); // console.log("before-combAlarmData", sendAl, idsList);
|
497
496
|
|
498
497
|
if (!(sendAl.length > 0)) {
|
499
|
-
_context8.next =
|
498
|
+
_context8.next = 25;
|
500
499
|
break;
|
501
500
|
}
|
502
501
|
|
503
502
|
rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
|
504
|
-
_context8.prev =
|
505
|
-
_context8.next =
|
503
|
+
_context8.prev = 13;
|
504
|
+
_context8.next = 16;
|
506
505
|
return alarmDispatchers.combAlarmData({
|
507
506
|
alarmdata: sendAl
|
508
507
|
});
|
509
508
|
|
510
|
-
case
|
509
|
+
case 16:
|
511
510
|
_yield$alarmDispatche2 = _context8.sent;
|
512
511
|
eqFlag = _yield$alarmDispatche2.eqFlag;
|
513
512
|
alarmlist = _yield$alarmDispatche2.alarmlist;
|
@@ -528,19 +527,19 @@ var Alarm = /*#__PURE__*/function () {
|
|
528
527
|
}
|
529
528
|
}
|
530
529
|
|
531
|
-
_context8.next =
|
530
|
+
_context8.next = 25;
|
532
531
|
break;
|
533
532
|
|
534
|
-
case
|
535
|
-
_context8.prev =
|
536
|
-
_context8.t0 = _context8["catch"](
|
533
|
+
case 22:
|
534
|
+
_context8.prev = 22;
|
535
|
+
_context8.t0 = _context8["catch"](13);
|
537
536
|
rlog.error('告警发送异常', _context8.t0);
|
538
537
|
|
539
|
-
case
|
538
|
+
case 25:
|
540
539
|
case "end":
|
541
540
|
return _context8.stop();
|
542
541
|
}
|
543
|
-
}, _callee8, this, [[
|
542
|
+
}, _callee8, this, [[13, 22]]);
|
544
543
|
}));
|
545
544
|
|
546
545
|
function handleAlarmEvent(_x6) {
|
@@ -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 "12.0.0-dev.
|
27
|
+
var version = typeof "12.0.0-dev.40" === 'string' ? "12.0.0-dev.40" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
@@ -2,7 +2,8 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
4
|
import keyBy from "lodash/keyBy";
|
5
|
-
import _ from "lodash";
|
5
|
+
import _ from "lodash";
|
6
|
+
import { queryCisByIds, queryModelAsset } from "../../services"; // 查询所有连线
|
6
7
|
|
7
8
|
import { getEdges } from "../../../utils/htElementUtils";
|
8
9
|
import CiTypeCache from "../cache/CiTypeCache";
|
@@ -31,20 +32,7 @@ export function isCrucialLink(link) {
|
|
31
32
|
*/
|
32
33
|
|
33
34
|
export function isExitLink(link) {
|
34
|
-
|
35
|
-
|
36
|
-
return (link === null || link === void 0 ? void 0 : (_link$attributes = link.attributes) === null || _link$attributes === void 0 ? void 0 : _link$attributes.destination_type) === "ip";
|
37
|
-
}
|
38
|
-
/**
|
39
|
-
* 是否聚合链路
|
40
|
-
* @param {*} link
|
41
|
-
* @returns
|
42
|
-
*/
|
43
|
-
|
44
|
-
export function isAggLink(link) {
|
45
|
-
var _link$attributes2, _link$attributes3;
|
46
|
-
|
47
|
-
return (link === null || link === void 0 ? void 0 : (_link$attributes2 = link.attributes) === null || _link$attributes2 === void 0 ? void 0 : _link$attributes2.destination_type) === "network.agg_interface" && (link === null || link === void 0 ? void 0 : (_link$attributes3 = link.attributes) === null || _link$attributes3 === void 0 ? void 0 : _link$attributes3.source_type) === "network.agg_interface";
|
35
|
+
return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes["destination_id"]);
|
48
36
|
}
|
49
37
|
export function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
|
50
38
|
var linkCiMap = keyBy(links, "id");
|
@@ -95,7 +83,7 @@ function _getLinksDetail() {
|
|
95
83
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
96
84
|
while (1) switch (_context.prev = _context.next) {
|
97
85
|
case 0:
|
98
|
-
if (links
|
86
|
+
if (!(!links || !links.length)) {
|
99
87
|
_context.next = 2;
|
100
88
|
break;
|
101
89
|
}
|
@@ -103,6 +91,9 @@ function _getLinksDetail() {
|
|
103
91
|
return _context.abrupt("return", []);
|
104
92
|
|
105
93
|
case 2:
|
94
|
+
// const linkCis = await topoService.relation.batchQueryRelation(
|
95
|
+
// links.map((link) => link.id)
|
96
|
+
// );
|
106
97
|
linkCis = links;
|
107
98
|
interfaceIds = [].concat(linkCis.map(function (item) {
|
108
99
|
return item.attributes.source_id;
|
@@ -180,15 +171,17 @@ export var showLinkByConfig = function showLinkByConfig(props) {
|
|
180
171
|
if (showType === 1 || showType === true) {
|
181
172
|
// 单链路全部显示
|
182
173
|
// console.log("单链路全部显示", edge);
|
183
|
-
edge.s("
|
174
|
+
edge.s("2d.visible", true);
|
184
175
|
} else {
|
176
|
+
var _d$attributes, _d$attributes2;
|
177
|
+
|
185
178
|
var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
|
186
179
|
|
187
|
-
if (
|
188
|
-
edge.s("
|
180
|
+
if ((d === null || d === void 0 ? void 0 : (_d$attributes = d.attributes) === null || _d$attributes === void 0 ? void 0 : _d$attributes.destination_type) === "network.agg_interface" && (d === null || d === void 0 ? void 0 : (_d$attributes2 = d.attributes) === null || _d$attributes2 === void 0 ? void 0 : _d$attributes2.source_type) === "network.agg_interface") {
|
181
|
+
edge.s("2d.visible", showAgg);
|
189
182
|
} else {
|
190
183
|
// console.log("edge", edge, d, showAgg);
|
191
|
-
edge.s("
|
184
|
+
edge.s("2d.visible", showPhy);
|
192
185
|
}
|
193
186
|
}
|
194
187
|
});
|
@@ -15,6 +15,7 @@ import moment from 'moment';
|
|
15
15
|
import React, { useEffect, useMemo, useState } from 'react';
|
16
16
|
import { rlog } from '@riil-frontend/component-topology-utils/lib/rlog';
|
17
17
|
import Link from "../../../../../../../components/Link";
|
18
|
+
import { getHistory } from '@riil-frontend/component-topology-utils';
|
18
19
|
import { queryCisByIds, commonQueryCiData } from "../../../../../../services";
|
19
20
|
import service from "../../../../../../services/overview";
|
20
21
|
import BaseInfoBlock from "./BaseInfoBlock";
|
@@ -31,12 +32,11 @@ import NetworkBaseInfo from "./NetworkBaseInfo";
|
|
31
32
|
import { formatMetric } from "../../../../../../utils/metricUtil"; // url 处理,UICBB 的地址需截取前缀
|
32
33
|
|
33
34
|
function formatUrl(url) {
|
34
|
-
var _window, _window$location
|
35
|
+
var _window, _window$location;
|
35
36
|
|
36
37
|
var prefix = '/default/pagecenter';
|
37
|
-
console.log('window?.location?.pathname', (_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname, url);
|
38
38
|
|
39
|
-
if (((
|
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) {
|
40
40
|
return url.split(prefix)[1];
|
41
41
|
} else {
|
42
42
|
return url;
|
@@ -154,7 +154,13 @@ export default function ResourceOverview(props) {
|
|
154
154
|
window.topo_overview_metric_timer = null;
|
155
155
|
}
|
156
156
|
};
|
157
|
-
}, []);
|
157
|
+
}, []);
|
158
|
+
|
159
|
+
var jumpTo = function jumpTo(url) {
|
160
|
+
getHistory.push(url);
|
161
|
+
onClose();
|
162
|
+
}; // 跳转前调用关闭操作
|
163
|
+
|
158
164
|
|
159
165
|
function onClose() {
|
160
166
|
isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
|
@@ -333,14 +339,13 @@ export default function ResourceOverview(props) {
|
|
333
339
|
return /*#__PURE__*/React.createElement("div", {
|
334
340
|
className: styles['alarm-title'],
|
335
341
|
title: value,
|
336
|
-
onClick:
|
342
|
+
onClick: jumpTo(record.link)
|
337
343
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
338
344
|
type: record.icon,
|
339
345
|
size: "xs",
|
340
346
|
className: styles['alarm-color-icon'] + " " + record.className
|
341
|
-
}), /*#__PURE__*/React.createElement("
|
342
|
-
className: styles.link
|
343
|
-
href: formatUrl(record.link)
|
347
|
+
}), /*#__PURE__*/React.createElement("span", {
|
348
|
+
className: styles.link
|
344
349
|
}, value));
|
345
350
|
}
|
346
351
|
}, {
|
@@ -50,8 +50,8 @@ function AlarmListItem(props) {
|
|
50
50
|
// 传入参数
|
51
51
|
var topo = props.topo,
|
52
52
|
alarmInfo = props.alarmInfo,
|
53
|
-
onClick = props.onClick;
|
54
|
-
|
53
|
+
onClick = props.onClick; // console.log("AlarmListPanel", topo, alarmInfo);
|
54
|
+
|
55
55
|
return /*#__PURE__*/_react["default"].createElement(_list["default"].Item, {
|
56
56
|
className: _indexModule["default"].AlarmListItem,
|
57
57
|
media: /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
@@ -3,6 +3,7 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.getEdgesBySelection = getEdgesBySelection;
|
5
5
|
exports.isNodeAllEdges = isNodeAllEdges;
|
6
|
+
exports.loopEdgesAndChildren = loopEdgesAndChildren;
|
6
7
|
exports.setEdgesType = setEdgesType;
|
7
8
|
exports.updateEdgesData = updateEdgesData;
|
8
9
|
|
@@ -88,6 +89,30 @@ function isNodeAllEdges(topo) {
|
|
88
89
|
});
|
89
90
|
return inEdges;
|
90
91
|
}
|
92
|
+
/**
|
93
|
+
* 遍历连线及子连线
|
94
|
+
* @param {*} topo
|
95
|
+
* @param {*} edges
|
96
|
+
* @param {*} operateEdgeFn
|
97
|
+
*/
|
98
|
+
|
99
|
+
|
100
|
+
function loopEdgesAndChildren(topo, edges, operateEdgeFn) {
|
101
|
+
var htTopo = topo.getHtTopo();
|
102
|
+
edges.forEach(function (edge) {
|
103
|
+
operateEdgeFn(edge);
|
104
|
+
|
105
|
+
if (edge.isEdgeGroupAgent()) {
|
106
|
+
// 连线组折叠时同时设置子连线
|
107
|
+
var edgeChildren = edge.getEdgeGroup().getEdges().toArray();
|
108
|
+
htTopo.toggleEdgeGroup(edge.getSource(), edge.getTarget(), true);
|
109
|
+
edgeChildren.forEach(function (edgeChild) {
|
110
|
+
operateEdgeFn(edgeChild);
|
111
|
+
});
|
112
|
+
htTopo.toggleEdgeGroup(edge.getSource(), edge.getTarget(), false);
|
113
|
+
}
|
114
|
+
});
|
115
|
+
}
|
91
116
|
/**
|
92
117
|
* 设置连线及子连线。带回退事务控制
|
93
118
|
* @param {*} topo
|
@@ -127,6 +127,10 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
127
127
|
return topoDispatchers.setTopoType(_template.TPL_TREE);
|
128
128
|
|
129
129
|
case 7:
|
130
|
+
// 更新配置
|
131
|
+
// resourceConfig.updateConfig(config);
|
132
|
+
// 更新配置对应的资源、链路
|
133
|
+
// editDispatchers.fetchDataByConfig();
|
130
134
|
topo.historyManager.endTransaction();
|
131
135
|
|
132
136
|
case 8:
|
package/lib/core/models/Alarm.js
CHANGED
@@ -481,14 +481,14 @@ var Alarm = /*#__PURE__*/function () {
|
|
481
481
|
console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
|
482
482
|
|
483
483
|
if (!((0, _utils.isAvailableArray)(alertData) && (0, _utils.isAvailableArray)(resIdsList))) {
|
484
|
-
_context8.next =
|
484
|
+
_context8.next = 25;
|
485
485
|
break;
|
486
486
|
}
|
487
487
|
|
488
488
|
sendAl = [];
|
489
489
|
idsList = [].concat(nodeIdsList, linkIdsList);
|
490
|
-
operations = [];
|
491
|
-
|
490
|
+
operations = []; // console.log('idsList---------', idsList)
|
491
|
+
|
492
492
|
idsList.forEach(function (idItem) {
|
493
493
|
if (idItem.operation === null) {
|
494
494
|
operations.push(idItem.ciId);
|
@@ -514,23 +514,22 @@ var Alarm = /*#__PURE__*/function () {
|
|
514
514
|
if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
|
515
515
|
sendAl.push(obj);
|
516
516
|
}
|
517
|
-
});
|
518
|
-
console.log("before-combAlarmData", sendAl, idsList);
|
517
|
+
}); // console.log("before-combAlarmData", sendAl, idsList);
|
519
518
|
|
520
519
|
if (!(sendAl.length > 0)) {
|
521
|
-
_context8.next =
|
520
|
+
_context8.next = 25;
|
522
521
|
break;
|
523
522
|
}
|
524
523
|
|
525
524
|
_componentTopologyUtils.rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
|
526
525
|
|
527
|
-
_context8.prev =
|
528
|
-
_context8.next =
|
526
|
+
_context8.prev = 13;
|
527
|
+
_context8.next = 16;
|
529
528
|
return alarmDispatchers.combAlarmData({
|
530
529
|
alarmdata: sendAl
|
531
530
|
});
|
532
531
|
|
533
|
-
case
|
532
|
+
case 16:
|
534
533
|
_yield$alarmDispatche2 = _context8.sent;
|
535
534
|
eqFlag = _yield$alarmDispatche2.eqFlag;
|
536
535
|
alarmlist = _yield$alarmDispatche2.alarmlist;
|
@@ -551,20 +550,20 @@ var Alarm = /*#__PURE__*/function () {
|
|
551
550
|
}
|
552
551
|
}
|
553
552
|
|
554
|
-
_context8.next =
|
553
|
+
_context8.next = 25;
|
555
554
|
break;
|
556
555
|
|
557
|
-
case
|
558
|
-
_context8.prev =
|
559
|
-
_context8.t0 = _context8["catch"](
|
556
|
+
case 22:
|
557
|
+
_context8.prev = 22;
|
558
|
+
_context8.t0 = _context8["catch"](13);
|
560
559
|
|
561
560
|
_componentTopologyUtils.rlog.error('告警发送异常', _context8.t0);
|
562
561
|
|
563
|
-
case
|
562
|
+
case 25:
|
564
563
|
case "end":
|
565
564
|
return _context8.stop();
|
566
565
|
}
|
567
|
-
}, _callee8, this, [[
|
566
|
+
}, _callee8, this, [[13, 22]]);
|
568
567
|
}));
|
569
568
|
|
570
569
|
function handleAlarmEvent(_x6) {
|
@@ -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 "12.0.0-dev.
|
57
|
+
var version = typeof "12.0.0-dev.40" === 'string' ? "12.0.0-dev.40" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
@@ -6,7 +6,6 @@ exports.__esModule = true;
|
|
6
6
|
exports.buildTopoLinkData = buildTopoLinkData;
|
7
7
|
exports.compatibleWith = void 0;
|
8
8
|
exports.getLinksDetail = getLinksDetail;
|
9
|
-
exports.isAggLink = isAggLink;
|
10
9
|
exports.isCrucialLink = isCrucialLink;
|
11
10
|
exports.isExitLink = isExitLink;
|
12
11
|
exports.mergeExportLinkData = void 0;
|
@@ -23,6 +22,8 @@ var _keyBy = _interopRequireDefault(require("lodash/keyBy"));
|
|
23
22
|
|
24
23
|
var _lodash = _interopRequireDefault(require("lodash"));
|
25
24
|
|
25
|
+
var _services = require("../../services");
|
26
|
+
|
26
27
|
var _htElementUtils = require("../../../utils/htElementUtils");
|
27
28
|
|
28
29
|
var _CiTypeCache = _interopRequireDefault(require("../cache/CiTypeCache"));
|
@@ -55,21 +56,7 @@ function isCrucialLink(link) {
|
|
55
56
|
|
56
57
|
|
57
58
|
function isExitLink(link) {
|
58
|
-
|
59
|
-
|
60
|
-
return (link === null || link === void 0 ? void 0 : (_link$attributes = link.attributes) === null || _link$attributes === void 0 ? void 0 : _link$attributes.destination_type) === "ip";
|
61
|
-
}
|
62
|
-
/**
|
63
|
-
* 是否聚合链路
|
64
|
-
* @param {*} link
|
65
|
-
* @returns
|
66
|
-
*/
|
67
|
-
|
68
|
-
|
69
|
-
function isAggLink(link) {
|
70
|
-
var _link$attributes2, _link$attributes3;
|
71
|
-
|
72
|
-
return (link === null || link === void 0 ? void 0 : (_link$attributes2 = link.attributes) === null || _link$attributes2 === void 0 ? void 0 : _link$attributes2.destination_type) === "network.agg_interface" && (link === null || link === void 0 ? void 0 : (_link$attributes3 = link.attributes) === null || _link$attributes3 === void 0 ? void 0 : _link$attributes3.source_type) === "network.agg_interface";
|
59
|
+
return (link === null || link === void 0 ? void 0 : link.attributes) && !(link !== null && link !== void 0 && link.attributes["destination_id"]);
|
73
60
|
}
|
74
61
|
|
75
62
|
function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
|
@@ -120,7 +107,7 @@ function _getLinksDetail() {
|
|
120
107
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
121
108
|
while (1) switch (_context.prev = _context.next) {
|
122
109
|
case 0:
|
123
|
-
if (links
|
110
|
+
if (!(!links || !links.length)) {
|
124
111
|
_context.next = 2;
|
125
112
|
break;
|
126
113
|
}
|
@@ -128,6 +115,9 @@ function _getLinksDetail() {
|
|
128
115
|
return _context.abrupt("return", []);
|
129
116
|
|
130
117
|
case 2:
|
118
|
+
// const linkCis = await topoService.relation.batchQueryRelation(
|
119
|
+
// links.map((link) => link.id)
|
120
|
+
// );
|
131
121
|
linkCis = links;
|
132
122
|
interfaceIds = [].concat(linkCis.map(function (item) {
|
133
123
|
return item.attributes.source_id;
|
@@ -210,15 +200,17 @@ var showLinkByConfig = function showLinkByConfig(props) {
|
|
210
200
|
if (showType === 1 || showType === true) {
|
211
201
|
// 单链路全部显示
|
212
202
|
// console.log("单链路全部显示", edge);
|
213
|
-
edge.s("
|
203
|
+
edge.s("2d.visible", true);
|
214
204
|
} else {
|
205
|
+
var _d$attributes, _d$attributes2;
|
206
|
+
|
215
207
|
var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
|
216
208
|
|
217
|
-
if (
|
218
|
-
edge.s("
|
209
|
+
if ((d === null || d === void 0 ? void 0 : (_d$attributes = d.attributes) === null || _d$attributes === void 0 ? void 0 : _d$attributes.destination_type) === "network.agg_interface" && (d === null || d === void 0 ? void 0 : (_d$attributes2 = d.attributes) === null || _d$attributes2 === void 0 ? void 0 : _d$attributes2.source_type) === "network.agg_interface") {
|
210
|
+
edge.s("2d.visible", showAgg);
|
219
211
|
} else {
|
220
212
|
// console.log("edge", edge, d, showAgg);
|
221
|
-
edge.s("
|
213
|
+
edge.s("2d.visible", showPhy);
|
222
214
|
}
|
223
215
|
}
|
224
216
|
});
|
@@ -25,6 +25,8 @@ var _rlog = require("@riil-frontend/component-topology-utils/lib/rlog");
|
|
25
25
|
|
26
26
|
var _Link = _interopRequireDefault(require("../../../../../../../components/Link"));
|
27
27
|
|
28
|
+
var _componentTopologyUtils = require("@riil-frontend/component-topology-utils");
|
29
|
+
|
28
30
|
var _services = require("../../../../../../services");
|
29
31
|
|
30
32
|
var _overview = _interopRequireDefault(require("../../../../../../services/overview"));
|
@@ -65,12 +67,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
65
67
|
|
66
68
|
// url 处理,UICBB 的地址需截取前缀
|
67
69
|
function formatUrl(url) {
|
68
|
-
var _window, _window$location
|
70
|
+
var _window, _window$location;
|
69
71
|
|
70
72
|
var prefix = '/default/pagecenter';
|
71
|
-
console.log('window?.location?.pathname', (_window = window) === null || _window === void 0 ? void 0 : (_window$location = _window.location) === null || _window$location === void 0 ? void 0 : _window$location.pathname, url);
|
72
73
|
|
73
|
-
if (((
|
74
|
+
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) {
|
74
75
|
return url.split(prefix)[1];
|
75
76
|
} else {
|
76
77
|
return url;
|
@@ -188,7 +189,14 @@ function ResourceOverview(props) {
|
|
188
189
|
window.topo_overview_metric_timer = null;
|
189
190
|
}
|
190
191
|
};
|
191
|
-
}, []);
|
192
|
+
}, []);
|
193
|
+
|
194
|
+
var jumpTo = function jumpTo(url) {
|
195
|
+
_componentTopologyUtils.getHistory.push(url);
|
196
|
+
|
197
|
+
onClose();
|
198
|
+
}; // 跳转前调用关闭操作
|
199
|
+
|
192
200
|
|
193
201
|
function onClose() {
|
194
202
|
isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
|
@@ -367,14 +375,13 @@ function ResourceOverview(props) {
|
|
367
375
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
368
376
|
className: _indexModule["default"]['alarm-title'],
|
369
377
|
title: value,
|
370
|
-
onClick:
|
378
|
+
onClick: jumpTo(record.link)
|
371
379
|
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
372
380
|
type: record.icon,
|
373
381
|
size: "xs",
|
374
382
|
className: _indexModule["default"]['alarm-color-icon'] + " " + record.className
|
375
|
-
}), /*#__PURE__*/_react["default"].createElement("
|
376
|
-
className: _indexModule["default"].link
|
377
|
-
href: formatUrl(record.link)
|
383
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
384
|
+
className: _indexModule["default"].link
|
378
385
|
}, value));
|
379
386
|
}
|
380
387
|
}, {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "12.0.0-dev.
|
3
|
+
"version": "12.0.0-dev.40",
|
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@12.0.0-dev.
|
126
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@12.0.0-dev.40/build/index.html",
|
127
127
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
128
128
|
}
|