@riil-frontend/component-topology 12.0.0-dev.8 → 12.1.0-dev.1
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/1.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +14 -14
- package/es/components/TemplateButton/index.module.scss +1 -1
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +58 -3
- package/es/core/components/TopoView/topoView.js +5 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +5 -12
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -10
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +9 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
- package/es/core/editor/hooks/useKeyboardShortcut.js +3 -1
- package/es/core/editor/utils/copyElementUtil.js +12 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +8 -30
- package/es/core/hooks/useAlarm.js +131 -81
- package/es/core/hooks/useCmpLinkAlarm.js +153 -0
- package/es/core/hooks/useEventData.js +1 -2
- package/es/core/hooks/useGraphAlarmDisplay.js +91 -56
- package/es/core/hooks/useResourceConfig.js +1 -3
- package/es/core/hooks/useTopoEdit.js +51 -58
- package/es/core/models/Alarm.js +69 -142
- package/es/core/models/AttributeMetricDisplay.js +14 -5
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/cache/CiCache.d.ts +1 -1
- package/es/core/models/cache/CiCache.js +3 -3
- package/es/core/models/cache/CiTypeCache.js +4 -0
- package/es/core/models/topoData.js +0 -1
- package/es/core/models/utils/linkUtils.js +20 -13
- package/es/core/services/index.js +1 -1
- package/es/core/services/topo/basic.js +2 -2
- package/es/core/store/models/topoConfig.js +7 -10
- package/es/core/store/models/topoMod.js +81 -134
- package/es/core/utils/edgeUtil.js +8 -0
- package/es/core/utils/metricUtil.js +8 -4
- package/es/core/utils/showGraphManageStatusUtil.js +3 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/es/core/viewer/components/plugins/ViewerPlugin.js +3 -1
- package/es/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
- package/es/networkTopo/components/TopoView.js +6 -11
- package/es/networkTopo/hooks/useEdgeExpand.js +2 -3
- package/es/networkTopo/services/topo/basic.js +3 -3
- package/es/networkTopo/store/topoCenter.js +260 -223
- package/es/style.js +1 -1
- package/es/utils/ResourceConfigUtil.js +3 -36
- package/es/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
- package/es/utils/ciRefAttributeTranslateUtil.js +155 -0
- package/es/utils/topoData.js +4 -2
- package/lib/components/TemplateButton/index.module.scss +1 -1
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +60 -3
- package/lib/core/components/TopoView/topoView.js +5 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +6 -12
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +27 -9
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +21 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +8 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +16 -2
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -0
- package/lib/core/editor/utils/copyElementUtil.js +15 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +8 -31
- package/lib/core/hooks/useAlarm.js +130 -79
- package/lib/core/hooks/useCmpLinkAlarm.js +166 -0
- package/lib/core/hooks/useEventData.js +1 -2
- package/lib/core/hooks/useGraphAlarmDisplay.js +91 -55
- package/lib/core/hooks/useResourceConfig.js +1 -3
- package/lib/core/hooks/useTopoEdit.js +50 -57
- package/lib/core/models/Alarm.js +69 -144
- package/lib/core/models/AttributeMetricDisplay.js +16 -4
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/cache/CiCache.d.ts +1 -1
- package/lib/core/models/cache/CiCache.js +3 -3
- package/lib/core/models/cache/CiTypeCache.js +4 -0
- package/lib/core/models/topoData.js +0 -1
- package/lib/core/models/utils/linkUtils.js +21 -13
- package/lib/core/services/index.js +1 -1
- package/lib/core/services/topo/basic.js +2 -2
- package/lib/core/store/models/topoConfig.js +7 -10
- package/lib/core/store/models/topoMod.js +81 -134
- package/lib/core/utils/edgeUtil.js +10 -0
- package/lib/core/utils/metricUtil.js +8 -4
- package/lib/core/utils/showGraphManageStatusUtil.js +3 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +12 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +2 -2
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +20 -18
- package/lib/core/viewer/components/plugins/ViewerPlugin.js +3 -1
- package/lib/core/viewer/components/titlebar/widgets/AlarmButton.js +1 -5
- package/lib/networkTopo/components/TopoView.js +5 -14
- package/lib/networkTopo/hooks/useEdgeExpand.js +2 -3
- package/lib/networkTopo/services/topo/basic.js +3 -3
- package/lib/networkTopo/store/topoCenter.js +262 -225
- package/lib/style.js +1 -1
- package/lib/utils/ResourceConfigUtil.js +3 -38
- package/lib/utils/ciRefAttributeTranslateUtil.d.ts +19 -0
- package/lib/utils/ciRefAttributeTranslateUtil.js +168 -0
- package/lib/utils/topoData.js +4 -2
- package/package.json +3 -3
@@ -23,6 +23,8 @@ var _DictCache = _interopRequireDefault(require("./cache/DictCache"));
|
|
23
23
|
|
24
24
|
var _nodeNameVisibleUtil = require("./utils/nodeNameVisibleUtil");
|
25
25
|
|
26
|
+
var _ciRefAttributeTranslateUtil = require("../../utils/ciRefAttributeTranslateUtil");
|
27
|
+
|
26
28
|
function isGraphField(item) {
|
27
29
|
return item.type === 'graph';
|
28
30
|
}
|
@@ -346,7 +348,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
346
348
|
}); // 翻译引用属性
|
347
349
|
|
348
350
|
_context.next = 4;
|
349
|
-
return
|
351
|
+
return (0, _ciRefAttributeTranslateUtil.translateCisRefAttributeName)(ciDatas);
|
350
352
|
|
351
353
|
case 4:
|
352
354
|
ciDatas = _context.sent;
|
@@ -474,8 +476,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
474
476
|
var refCi = refCiMap[refAttrs.id];
|
475
477
|
|
476
478
|
if (refCi) {
|
479
|
+
// 引用ci名称获取规则:如果ci是树形结构(例如区域),取 tree_name_path;非树形,取display_name
|
480
|
+
var displayName = refCi.attributes.tree_name_path || refCi.attributes.display_name;
|
477
481
|
attributeMap[refAttrs.attrCode + "_object"] = {
|
478
|
-
displayName:
|
482
|
+
displayName: displayName
|
479
483
|
};
|
480
484
|
}
|
481
485
|
});
|
@@ -535,7 +539,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
535
539
|
return (0, _extends2["default"])({}, item, {
|
536
540
|
tags: tags
|
537
541
|
});
|
538
|
-
});
|
542
|
+
});
|
543
|
+
|
544
|
+
_componentTopologyUtils.rlog.debug('推送标注 => ht', elementTagsAndTips);
|
539
545
|
|
540
546
|
var htTopo = topo.getHtTopo();
|
541
547
|
|
@@ -543,7 +549,13 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
543
549
|
var _topo$historyManager, _topo$historyManager2;
|
544
550
|
|
545
551
|
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '加载标注');
|
546
|
-
|
552
|
+
|
553
|
+
try {
|
554
|
+
htTopo.loadTagAndTip(JSON.parse(JSON.stringify(elementTagsAndTips)));
|
555
|
+
} catch (error) {
|
556
|
+
_componentTopologyUtils.rlog.error('推送标注 => ht 失败', error);
|
557
|
+
}
|
558
|
+
|
547
559
|
(_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '加载标注');
|
548
560
|
}
|
549
561
|
}
|
@@ -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.
|
57
|
+
var version = typeof "12.1.0-dev.1" === 'string' ? "12.1.0-dev.1" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
@@ -11,7 +11,7 @@ declare class CiCache {
|
|
11
11
|
* @param ids {string[]}
|
12
12
|
* @returns {Promise<Object>}
|
13
13
|
*/
|
14
|
-
load(ids: string[]): Promise<Object>;
|
14
|
+
load(ids: string[], refreshCiCache?: boolean): Promise<Object>;
|
15
15
|
getCi(id: string): Object;
|
16
16
|
}
|
17
17
|
declare const _default: CiCache;
|
@@ -32,14 +32,14 @@ var CiCache = /*#__PURE__*/function () {
|
|
32
32
|
_proto.load =
|
33
33
|
/*#__PURE__*/
|
34
34
|
function () {
|
35
|
-
var _load = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(ids) {
|
35
|
+
var _load = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(ids, refreshCiCache) {
|
36
36
|
var _this = this;
|
37
37
|
|
38
38
|
var unloadCiIds, cis, map;
|
39
39
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
40
40
|
while (1) switch (_context.prev = _context.next) {
|
41
41
|
case 0:
|
42
|
-
unloadCiIds = ids.filter(function (id) {
|
42
|
+
unloadCiIds = refreshCiCache === true ? ids : ids.filter(function (id) {
|
43
43
|
return !_this.ciMap[id];
|
44
44
|
});
|
45
45
|
|
@@ -71,7 +71,7 @@ var CiCache = /*#__PURE__*/function () {
|
|
71
71
|
}, _callee, this);
|
72
72
|
}));
|
73
73
|
|
74
|
-
function load(_x) {
|
74
|
+
function load(_x, _x2) {
|
75
75
|
return _load.apply(this, arguments);
|
76
76
|
}
|
77
77
|
|
@@ -119,6 +119,10 @@ var CiTypeCache = /*#__PURE__*/function () {
|
|
119
119
|
this.ciTypeMap = cache;
|
120
120
|
};
|
121
121
|
|
122
|
+
_proto.getCiTypeMap = function getCiTypeMap() {
|
123
|
+
return this.ciTypeMap;
|
124
|
+
};
|
125
|
+
|
122
126
|
_proto.getCiType = function getCiType(typeCode) {
|
123
127
|
return this.ciTypeMap[typeCode];
|
124
128
|
};
|
@@ -6,6 +6,7 @@ exports.__esModule = true;
|
|
6
6
|
exports.buildTopoLinkData = buildTopoLinkData;
|
7
7
|
exports.compatibleWith = void 0;
|
8
8
|
exports.getLinksDetail = getLinksDetail;
|
9
|
+
exports.isAggLink = isAggLink;
|
9
10
|
exports.isCrucialLink = isCrucialLink;
|
10
11
|
exports.isExitLink = isExitLink;
|
11
12
|
exports.mergeExportLinkData = void 0;
|
@@ -22,8 +23,6 @@ var _keyBy = _interopRequireDefault(require("lodash/keyBy"));
|
|
22
23
|
|
23
24
|
var _lodash = _interopRequireDefault(require("lodash"));
|
24
25
|
|
25
|
-
var _services = require("../../services");
|
26
|
-
|
27
26
|
var _htElementUtils = require("../../../utils/htElementUtils");
|
28
27
|
|
29
28
|
var _CiTypeCache = _interopRequireDefault(require("../cache/CiTypeCache"));
|
@@ -56,7 +55,21 @@ function isCrucialLink(link) {
|
|
56
55
|
|
57
56
|
|
58
57
|
function isExitLink(link) {
|
59
|
-
|
58
|
+
var _link$attributes;
|
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";
|
60
73
|
}
|
61
74
|
|
62
75
|
function mergeLinksData(links, linkCis, nodes, interfaceCiMap, interfaceDoc) {
|
@@ -107,7 +120,7 @@ function _getLinksDetail() {
|
|
107
120
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
108
121
|
while (1) switch (_context.prev = _context.next) {
|
109
122
|
case 0:
|
110
|
-
if (
|
123
|
+
if (links !== null && links !== void 0 && links.length) {
|
111
124
|
_context.next = 2;
|
112
125
|
break;
|
113
126
|
}
|
@@ -115,9 +128,6 @@ function _getLinksDetail() {
|
|
115
128
|
return _context.abrupt("return", []);
|
116
129
|
|
117
130
|
case 2:
|
118
|
-
// const linkCis = await topoService.relation.batchQueryRelation(
|
119
|
-
// links.map((link) => link.id)
|
120
|
-
// );
|
121
131
|
linkCis = links;
|
122
132
|
interfaceIds = [].concat(linkCis.map(function (item) {
|
123
133
|
return item.attributes.source_id;
|
@@ -200,17 +210,15 @@ var showLinkByConfig = function showLinkByConfig(props) {
|
|
200
210
|
if (showType === 1 || showType === true) {
|
201
211
|
// 单链路全部显示
|
202
212
|
// console.log("单链路全部显示", edge);
|
203
|
-
edge.s("
|
213
|
+
edge.s("x.visible", true);
|
204
214
|
} else {
|
205
|
-
var _d$attributes, _d$attributes2;
|
206
|
-
|
207
215
|
var d = topo.dataModel.getDataById(edge.getTag()); // 判断是否聚合链路
|
208
216
|
|
209
|
-
if ((d
|
210
|
-
edge.s("
|
217
|
+
if (isAggLink(d)) {
|
218
|
+
edge.s("x.visible", showAgg);
|
211
219
|
} else {
|
212
220
|
// console.log("edge", edge, d, showAgg);
|
213
|
-
edge.s("
|
221
|
+
edge.s("x.visible", showPhy);
|
214
222
|
}
|
215
223
|
}
|
216
224
|
});
|
@@ -118,7 +118,7 @@ var _default = {
|
|
118
118
|
* @param {Array} groups
|
119
119
|
* @returns
|
120
120
|
*/
|
121
|
-
getTopoDataByResource: function getTopoDataByResource(id, resources, groups
|
121
|
+
getTopoDataByResource: function getTopoDataByResource(id, resources, groups) {
|
122
122
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
123
123
|
var data, obj;
|
124
124
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
@@ -137,7 +137,7 @@ var _default = {
|
|
137
137
|
obj = prepareGroupParams(data);
|
138
138
|
_context.next = 5;
|
139
139
|
return _componentTopologyUtils.request.post(API_ROOT + "/structure/byCondition/" + id, (0, _extends2["default"])({}, obj, {
|
140
|
-
exportLinkIdList:
|
140
|
+
exportLinkIdList: []
|
141
141
|
}));
|
142
142
|
|
143
143
|
case 5:
|
@@ -53,7 +53,6 @@ var initialState = {
|
|
53
53
|
"static": []
|
54
54
|
},
|
55
55
|
groups: [],
|
56
|
-
exportLinkIdList: [],
|
57
56
|
// config: {
|
58
57
|
// view: null,
|
59
58
|
// groups: [],
|
@@ -260,18 +259,17 @@ function _default(topoApp) {
|
|
260
259
|
var _this2 = this;
|
261
260
|
|
262
261
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
263
|
-
var editState, resources, _editState$groups, groups,
|
262
|
+
var editState, resources, _editState$groups, groups, query, data;
|
264
263
|
|
265
264
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
266
265
|
while (1) switch (_context2.prev = _context2.next) {
|
267
266
|
case 0:
|
268
267
|
editState = rootState.topoConfig;
|
269
|
-
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups
|
268
|
+
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups;
|
270
269
|
query = {
|
271
270
|
id: rootState.topoMod.topoId,
|
272
271
|
resources: resources,
|
273
|
-
groups: groups
|
274
|
-
ipNodes: ipNodes
|
272
|
+
groups: groups
|
275
273
|
};
|
276
274
|
_context2.next = 5;
|
277
275
|
return _this2.getTopoByConditions(query);
|
@@ -322,14 +320,14 @@ function _default(topoApp) {
|
|
322
320
|
var _this4 = this;
|
323
321
|
|
324
322
|
return (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
325
|
-
var topoId, resources, groups,
|
323
|
+
var topoId, resources, groups, viewConditions, groupInfo, data, _yield$Promise$all, dataWithLinkDetail, _combTopoData, topoData, resAndMetrics, topoDataTrans;
|
326
324
|
|
327
325
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
328
326
|
while (1) switch (_context4.prev = _context4.next) {
|
329
327
|
case 0:
|
330
328
|
_rlog["default"].debug("getTopoByConditions--------", params);
|
331
329
|
|
332
|
-
topoId = params.id, resources = params.resources, groups = params.groups
|
330
|
+
topoId = params.id, resources = params.resources, groups = params.groups;
|
333
331
|
viewConditions = (0, _topoData2.resToConditions)(resources);
|
334
332
|
groupInfo = (0, _utils.isAvailableArray)(groups) && groups.map(function (group) {
|
335
333
|
return (0, _extends2["default"])({}, group, {
|
@@ -341,7 +339,7 @@ function _default(topoApp) {
|
|
341
339
|
_rlog["default"].debug("getTopoByConditions--------", viewConditions, groupInfo);
|
342
340
|
|
343
341
|
_context4.next = 7;
|
344
|
-
return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo
|
342
|
+
return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo);
|
345
343
|
|
346
344
|
case 7:
|
347
345
|
data = _context4.sent;
|
@@ -484,8 +482,7 @@ function _default(topoApp) {
|
|
484
482
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
485
483
|
while (1) switch (_context8.prev = _context8.next) {
|
486
484
|
case 0:
|
487
|
-
ids = data.ids, ip = data.ip;
|
488
|
-
|
485
|
+
ids = data.ids, ip = data.ip;
|
489
486
|
_context8.next = 3;
|
490
487
|
return _networkLink["default"].queryLinksByIp(ids, ip);
|
491
488
|
|