@riil-frontend/component-topology 12.0.0-dev.26 → 12.0.0-dev.27
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 +10 -10
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +2 -2
- package/es/core/editor/utils/edgeTypeStyleUtil.js +0 -23
- package/es/core/hooks/useAlarm.js +14 -1
- package/es/core/hooks/useCmpLinkAlarm.js +142 -16
- package/es/core/hooks/useGraphAlarmDisplay.js +15 -21
- package/es/core/hooks/useTopoEdit.js +0 -4
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/utils/linkUtils.js +20 -13
- package/es/core/utils/metricUtil.js +8 -4
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +11 -5
- package/es/networkTopo/store/topoCenter.js +260 -223
- package/es/style.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +1 -1
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +0 -25
- package/lib/core/hooks/useAlarm.js +14 -1
- package/lib/core/hooks/useCmpLinkAlarm.js +149 -16
- package/lib/core/hooks/useGraphAlarmDisplay.js +15 -21
- package/lib/core/hooks/useTopoEdit.js +0 -4
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/utils/linkUtils.js +21 -13
- package/lib/core/utils/metricUtil.js +8 -4
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +13 -5
- package/lib/networkTopo/store/topoCenter.js +262 -225
- package/lib/style.js +1 -1
- package/package.json +2 -2
@@ -7,7 +7,7 @@ import React, { useState, useMemo } from 'react';
|
|
7
7
|
import LayoutSettings from "./components/LayoutSettings";
|
8
8
|
import WidgetBox from "../WidgetBox";
|
9
9
|
import DropdownButton from "../components/DropdownButton";
|
10
|
-
import { isGroup, isLayer } from "../../../../../../utils/htElementDataUtil";
|
10
|
+
import { isGroup, isLayer, isNode } from "../../../../../../utils/htElementDataUtil";
|
11
11
|
|
12
12
|
function Layout(props) {
|
13
13
|
var topo = props.topo,
|
@@ -147,7 +147,7 @@ function isLayoutEnabled(props) {
|
|
147
147
|
} //中心节点布局,选中一个节点不是分层的情况下,按钮亮起
|
148
148
|
|
149
149
|
|
150
|
-
if (topoShowType !== 'layers' && selection.length === 1) {
|
150
|
+
if (topoShowType !== 'layers' && selection.length === 1 && (isNode(selection[0]) || isGroup(selection[0]))) {
|
151
151
|
return true;
|
152
152
|
}
|
153
153
|
|
@@ -77,29 +77,6 @@ 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
|
-
}
|
103
80
|
/**
|
104
81
|
* 设置连线及子连线。带回退事务控制
|
105
82
|
* @param {*} topo
|
@@ -88,12 +88,25 @@ var handleRiskData = function handleRiskData(topo, receivedData) {
|
|
88
88
|
topo.viewProps.onResourceEvent(topo.alarm.getEvents());
|
89
89
|
}
|
90
90
|
};
|
91
|
+
/**
|
92
|
+
* 关联拓扑告警级别消息处理
|
93
|
+
* @param {*} topo
|
94
|
+
* @param {*} data
|
95
|
+
*/
|
96
|
+
|
91
97
|
|
92
98
|
var handleRelateTopoAlarm = function handleRelateTopoAlarm(topo, data) {
|
93
99
|
var relateTopoAlarm = _extends({}, topo.store.getModelState('topoAlarm').relateTopoAlarm);
|
94
100
|
|
95
101
|
data.forEach(function (item) {
|
96
|
-
|
102
|
+
var alertLevel = item.alertLevel;
|
103
|
+
|
104
|
+
if (alertLevel === -1) {
|
105
|
+
// -1表示删除
|
106
|
+
delete relateTopoAlarm[item.topoId];
|
107
|
+
} else {
|
108
|
+
relateTopoAlarm[item.topoId] = item.alertLevel;
|
109
|
+
}
|
97
110
|
});
|
98
111
|
topo.store.getModelDispatchers('topoAlarm').update({
|
99
112
|
relateTopoAlarm: relateTopoAlarm
|
@@ -1,27 +1,153 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
+
import { useEffect, useState, useMemo } from "react";
|
5
|
+
import { useRequest } from 'ahooks';
|
6
|
+
import DictCache from "../models/cache/DictCache";
|
7
|
+
|
8
|
+
function addCmpLinkOfflineStatusForDisplayLineColor(cis, cmpLinkRunStatusList) {
|
9
|
+
return cis.map(function (ci) {
|
10
|
+
var cmpLinkRunStatusData = cmpLinkRunStatusList.find(function (item) {
|
11
|
+
return item.id === ci.id;
|
12
|
+
});
|
13
|
+
|
14
|
+
if (cmpLinkRunStatusData) {
|
15
|
+
return _extends({}, ci, {
|
16
|
+
manageStatus: cmpLinkRunStatusData.runStatus === '2' ? 0 : 3
|
17
|
+
});
|
18
|
+
}
|
19
|
+
|
20
|
+
return ci;
|
21
|
+
});
|
22
|
+
}
|
23
|
+
|
24
|
+
function getCmpLinIds(datas) {
|
25
|
+
var linkIds = datas.filter(function (item) {
|
26
|
+
return item.isSubResource && item.typeCode === 'network_link';
|
27
|
+
}).map(function (item) {
|
28
|
+
return item.ciId;
|
29
|
+
});
|
30
|
+
return linkIds;
|
31
|
+
}
|
1
32
|
/**
|
2
|
-
*
|
33
|
+
* 分级链路下級鏈路
|
3
34
|
* @param {*} props
|
4
35
|
* @returns
|
5
36
|
*/
|
37
|
+
|
38
|
+
|
6
39
|
export default function useCmpLinkAlarm(props) {
|
7
|
-
var topo = props.topo
|
40
|
+
var topo = props.topo,
|
41
|
+
resources = props.resources,
|
42
|
+
graphLoaded = props.graphLoaded;
|
8
43
|
|
9
|
-
var
|
10
|
-
|
44
|
+
var _useState = useState(getCmpLinIds(resources)),
|
45
|
+
cmpLinkIds = _useState[0],
|
46
|
+
setCmpLinkIds = _useState[1];
|
11
47
|
|
12
|
-
var
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
48
|
+
var _useState2 = useState([]),
|
49
|
+
cmpLinkRunStatus = _useState2[0],
|
50
|
+
setCmpLinkRunStatus = _useState2[1];
|
51
|
+
|
52
|
+
var cmpLinkAlarmLevels = useMemo(function () {
|
53
|
+
return cmpLinkRunStatus // 3:fault:重要故障; 4:urgently:紧急故障 』为红色
|
54
|
+
.filter(function (item) {
|
55
|
+
return ['3', '4'].includes(item.runStatus);
|
56
|
+
}).map(function (item) {
|
57
|
+
return {
|
58
|
+
id: item.id,
|
59
|
+
level: 1
|
60
|
+
};
|
61
|
+
});
|
62
|
+
}, [cmpLinkRunStatus]);
|
63
|
+
useEffect(function () {
|
64
|
+
var ids = getCmpLinIds(resources);
|
65
|
+
|
66
|
+
if (cmpLinkIds.join(',') !== ids.join(',')) {
|
67
|
+
setCmpLinkIds(ids);
|
68
|
+
}
|
69
|
+
}, [resources]);
|
70
|
+
|
71
|
+
function getCmpLinkRunStatus(_x) {
|
72
|
+
return _getCmpLinkRunStatus.apply(this, arguments);
|
73
|
+
} // 轮询hooks
|
74
|
+
|
75
|
+
|
76
|
+
function _getCmpLinkRunStatus() {
|
77
|
+
_getCmpLinkRunStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(ids) {
|
78
|
+
var _yield$Promise$all, ciMetricsResult;
|
79
|
+
|
80
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
81
|
+
while (1) switch (_context.prev = _context.next) {
|
82
|
+
case 0:
|
83
|
+
if (ids.length) {
|
84
|
+
_context.next = 2;
|
85
|
+
break;
|
86
|
+
}
|
87
|
+
|
88
|
+
return _context.abrupt("return", []);
|
89
|
+
|
90
|
+
case 2:
|
91
|
+
_context.t0 = Promise;
|
92
|
+
_context.t1 = // 查询指标值
|
93
|
+
topo.serverApi.ciInfo.batchQueryCiInfo({
|
94
|
+
ciId: [],
|
95
|
+
codes: ['run_status'],
|
96
|
+
relationId: ids.map(function (id) {
|
97
|
+
return {
|
98
|
+
ciId: id,
|
99
|
+
operation: "delete"
|
100
|
+
};
|
101
|
+
})
|
102
|
+
});
|
103
|
+
_context.next = 6;
|
104
|
+
return DictCache.init();
|
105
|
+
|
106
|
+
case 6:
|
107
|
+
_context.t2 = _context.sent;
|
108
|
+
_context.t3 = [_context.t1, _context.t2];
|
109
|
+
_context.next = 10;
|
110
|
+
return _context.t0.all.call(_context.t0, _context.t3);
|
111
|
+
|
112
|
+
case 10:
|
113
|
+
_yield$Promise$all = _context.sent;
|
114
|
+
ciMetricsResult = _yield$Promise$all[0];
|
115
|
+
return _context.abrupt("return", ciMetricsResult);
|
116
|
+
|
117
|
+
case 13:
|
118
|
+
case "end":
|
119
|
+
return _context.stop();
|
120
|
+
}
|
121
|
+
}, _callee);
|
122
|
+
}));
|
123
|
+
return _getCmpLinkRunStatus.apply(this, arguments);
|
124
|
+
}
|
125
|
+
|
126
|
+
var _useRequest = useRequest(getCmpLinkRunStatus, {
|
127
|
+
pollingInterval: 60 * 1000,
|
128
|
+
pollingWhenHidden: false,
|
129
|
+
// debounceInterval: 200,
|
130
|
+
manual: true,
|
131
|
+
onSuccess: function onSuccess(result) {
|
132
|
+
setCmpLinkRunStatus(result.map(function (item) {
|
133
|
+
return {
|
134
|
+
id: "sub:" + item.id,
|
135
|
+
runStatus: item.metrics.run_status
|
136
|
+
};
|
137
|
+
}));
|
138
|
+
}
|
139
|
+
}),
|
140
|
+
run = _useRequest.run;
|
141
|
+
|
142
|
+
useEffect(function () {
|
143
|
+
if (graphLoaded) {
|
144
|
+
run(cmpLinkIds);
|
145
|
+
}
|
146
|
+
}, [graphLoaded, cmpLinkIds]);
|
23
147
|
return {
|
24
|
-
|
148
|
+
cmpLinkRunStatus: cmpLinkRunStatus,
|
149
|
+
cmpLinkAlarmLevels: cmpLinkAlarmLevels,
|
150
|
+
addCmpLinkOfflineStatusForDisplayLineColor: addCmpLinkOfflineStatusForDisplayLineColor
|
25
151
|
};
|
26
152
|
}
|
27
153
|
;
|
@@ -88,12 +88,20 @@ export default function useGraphAlarmDisplay(options) {
|
|
88
88
|
risks = _topo$alarm$useState.risks,
|
89
89
|
relateTopoAlarm = _topo$alarm$useState.relateTopoAlarm;
|
90
90
|
|
91
|
-
var
|
91
|
+
var oldResources = topo.dataModel.useCis(); // 分级拓扑下级链路特殊处理
|
92
92
|
|
93
93
|
var _useCmpLinkAlarm = useCmpLinkAlarm({
|
94
|
-
topo: topo
|
94
|
+
topo: topo,
|
95
|
+
resources: oldResources,
|
96
|
+
graphLoaded: graphLoaded
|
95
97
|
}),
|
96
|
-
cmpLinkAlarmLevels = _useCmpLinkAlarm.cmpLinkAlarmLevels
|
98
|
+
cmpLinkAlarmLevels = _useCmpLinkAlarm.cmpLinkAlarmLevels,
|
99
|
+
cmpLinkRunStatus = _useCmpLinkAlarm.cmpLinkRunStatus,
|
100
|
+
addCmpLinkOfflineStatusForDisplayLineColor = _useCmpLinkAlarm.addCmpLinkOfflineStatusForDisplayLineColor;
|
101
|
+
|
102
|
+
var resources = useMemo(function () {
|
103
|
+
return addCmpLinkOfflineStatusForDisplayLineColor(oldResources, cmpLinkRunStatus);
|
104
|
+
}, [oldResources, cmpLinkRunStatus]); // ci告警级别
|
97
105
|
|
98
106
|
var cisEventLevel = useMemo(function () {
|
99
107
|
var levels = [].concat(alarmList || [], cmpLinkAlarmLevels, risks.map(function (item) {
|
@@ -106,19 +114,6 @@ export default function useGraphAlarmDisplay(options) {
|
|
106
114
|
}));
|
107
115
|
return getGraphCiElementAlarmLevels(resources, levels);
|
108
116
|
}, [resources, alarmList, cmpLinkAlarmLevels, risks]);
|
109
|
-
|
110
|
-
function getCisEventLevel() {
|
111
|
-
var levels = [].concat(alarmList || [], cmpLinkAlarmLevels, risks.map(function (item) {
|
112
|
-
var _item$resourceId2;
|
113
|
-
|
114
|
-
return {
|
115
|
-
id: (_item$resourceId2 = item.resourceId) !== null && _item$resourceId2 !== void 0 ? _item$resourceId2 : item.ciId,
|
116
|
-
level: 5
|
117
|
-
};
|
118
|
-
}));
|
119
|
-
return getGraphCiElementAlarmLevels(resources, levels);
|
120
|
-
}
|
121
|
-
|
122
117
|
useEffect(function () {
|
123
118
|
showAlarm();
|
124
119
|
showManageStatus({
|
@@ -127,7 +122,7 @@ export default function useGraphAlarmDisplay(options) {
|
|
127
122
|
isEditMode: isEditMode,
|
128
123
|
graphLoaded: graphLoaded,
|
129
124
|
alarmSwitch: alarmSwitch,
|
130
|
-
cisEventLevel:
|
125
|
+
cisEventLevel: cisEventLevel
|
131
126
|
});
|
132
127
|
|
133
128
|
function showAlarm() {
|
@@ -139,12 +134,11 @@ export default function useGraphAlarmDisplay(options) {
|
|
139
134
|
// 告警静默
|
140
135
|
topo.view.loadAlarm([]);
|
141
136
|
return;
|
142
|
-
}
|
137
|
+
} // 关联拓扑告警
|
143
138
|
|
144
|
-
var finalAlarms = getCisEventLevel(); // 关联拓扑告警
|
145
139
|
|
146
140
|
var relateTopoAlarms = getRelateTopoNodeAlarmLevels(topo, relateTopoAlarm);
|
147
|
-
var elementsAlarmLevels = [].concat(
|
141
|
+
var elementsAlarmLevels = [].concat(cisEventLevel, relateTopoAlarms); // 将告警级别放入ht元素,便于测试
|
148
142
|
|
149
143
|
getElements(topo.getDataModel()).filter(function (item) {
|
150
144
|
return !!item.getTag();
|
@@ -171,5 +165,5 @@ export default function useGraphAlarmDisplay(options) {
|
|
171
165
|
resources: resources
|
172
166
|
});
|
173
167
|
};
|
174
|
-
}, [graphLoaded, resources, alarmSwitch,
|
168
|
+
}, [graphLoaded, resources, alarmSwitch, cisEventLevel, relateTopoAlarm]);
|
175
169
|
}
|
@@ -95,10 +95,6 @@ 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();
|
102
98
|
topo.historyManager.endTransaction();
|
103
99
|
|
104
100
|
case 8:
|
@@ -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.27" === 'string' ? "12.0.0-dev.27" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
@@ -2,8 +2,7 @@ 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";
|
6
|
-
import { queryCisByIds, queryModelAsset } from "../../services"; // 查询所有连线
|
5
|
+
import _ from "lodash"; // 查询所有连线
|
7
6
|
|
8
7
|
import { getEdges } from "../../../utils/htElementUtils";
|
9
8
|
import CiTypeCache from "../cache/CiTypeCache";
|
@@ -32,7 +31,20 @@ export function isCrucialLink(link) {
|
|
32
31
|
*/
|
33
32
|
|
34
33
|
export function isExitLink(link) {
|
35
|
-
|
34
|
+
var _link$attributes;
|
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";
|
36
48
|
}
|
37
49
|
export function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
|
38
50
|
var linkCiMap = keyBy(links, "id");
|
@@ -83,7 +95,7 @@ function _getLinksDetail() {
|
|
83
95
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
84
96
|
while (1) switch (_context.prev = _context.next) {
|
85
97
|
case 0:
|
86
|
-
if (
|
98
|
+
if (links !== null && links !== void 0 && links.length) {
|
87
99
|
_context.next = 2;
|
88
100
|
break;
|
89
101
|
}
|
@@ -91,9 +103,6 @@ function _getLinksDetail() {
|
|
91
103
|
return _context.abrupt("return", []);
|
92
104
|
|
93
105
|
case 2:
|
94
|
-
// const linkCis = await topoService.relation.batchQueryRelation(
|
95
|
-
// links.map((link) => link.id)
|
96
|
-
// );
|
97
106
|
linkCis = links;
|
98
107
|
interfaceIds = [].concat(linkCis.map(function (item) {
|
99
108
|
return item.attributes.source_id;
|
@@ -171,17 +180,15 @@ export var showLinkByConfig = function showLinkByConfig(props) {
|
|
171
180
|
if (showType === 1 || showType === true) {
|
172
181
|
// 单链路全部显示
|
173
182
|
// console.log("单链路全部显示", edge);
|
174
|
-
edge.s("
|
183
|
+
edge.s("x.visible", true);
|
175
184
|
} else {
|
176
|
-
var _d$attributes, _d$attributes2;
|
177
|
-
|
178
185
|
var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
|
179
186
|
|
180
|
-
if ((d
|
181
|
-
edge.s("
|
187
|
+
if (isAggLink(d)) {
|
188
|
+
edge.s("x.visible", showAgg);
|
182
189
|
} else {
|
183
190
|
// console.log("edge", edge, d, showAgg);
|
184
|
-
edge.s("
|
191
|
+
edge.s("x.visible", showPhy);
|
185
192
|
}
|
186
193
|
}
|
187
194
|
});
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
1
2
|
import { metricValueFormat } from '@riil-frontend/utils';
|
2
3
|
import DictCache from "../models/cache/DictCache";
|
3
4
|
/**
|
@@ -15,16 +16,19 @@ export function formatMetric(val, metricModel) {
|
|
15
16
|
if (metricModel) {
|
16
17
|
var _result$value;
|
17
18
|
|
18
|
-
// 分级字典特殊处理
|
19
|
-
|
20
|
-
|
19
|
+
var dictObject = _extends({}, DictCache.getDictObject()); // 分级字典特殊处理
|
20
|
+
|
21
|
+
|
22
|
+
if (metricModel.dict) {
|
23
|
+
// val = metricModel.dict[val]
|
24
|
+
dictObject[metricModel.code] = metricModel.dict;
|
21
25
|
}
|
22
26
|
|
23
27
|
var result = metricValueFormat({
|
24
28
|
value: val,
|
25
29
|
dataType: metricModel.dataType,
|
26
30
|
changeValue: metricModel.changeValue,
|
27
|
-
dict:
|
31
|
+
dict: dictObject,
|
28
32
|
unit: metricModel.unit,
|
29
33
|
code: metricModel.code
|
30
34
|
});
|
@@ -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";
|
@@ -153,7 +154,13 @@ export default function ResourceOverview(props) {
|
|
153
154
|
window.topo_overview_metric_timer = null;
|
154
155
|
}
|
155
156
|
};
|
156
|
-
}, []);
|
157
|
+
}, []);
|
158
|
+
|
159
|
+
var jumpTo = function jumpTo(url) {
|
160
|
+
getHistory.push(url);
|
161
|
+
onClose();
|
162
|
+
}; // 跳转前调用关闭操作
|
163
|
+
|
157
164
|
|
158
165
|
function onClose() {
|
159
166
|
isAppTopo && resourceOverviewProps.onClose && resourceOverviewProps.onClose();
|
@@ -332,14 +339,13 @@ export default function ResourceOverview(props) {
|
|
332
339
|
return /*#__PURE__*/React.createElement("div", {
|
333
340
|
className: styles['alarm-title'],
|
334
341
|
title: value,
|
335
|
-
onClick:
|
342
|
+
onClick: jumpTo(record.link)
|
336
343
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
337
344
|
type: record.icon,
|
338
345
|
size: "xs",
|
339
346
|
className: styles['alarm-color-icon'] + " " + record.className
|
340
|
-
}), /*#__PURE__*/React.createElement(
|
341
|
-
className: styles.link
|
342
|
-
to: formatUrl(record.link)
|
347
|
+
}), /*#__PURE__*/React.createElement("span", {
|
348
|
+
className: styles.link
|
343
349
|
}, value));
|
344
350
|
}
|
345
351
|
}, {
|