@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
@@ -7,6 +7,7 @@ import { isMonitoring } from "../utils/manageStatusUtil";
|
|
7
7
|
import AttributeFormatter from "./attributeFormatter";
|
8
8
|
import DictCache from "./cache/DictCache";
|
9
9
|
import { getNodesNameVisible as _getNodesNameVisible, updateNodesNameVisible as _updateNodesNameVisible } from "./utils/nodeNameVisibleUtil";
|
10
|
+
import { translateCisRefAttributeName } from "../../utils/ciRefAttributeTranslateUtil";
|
10
11
|
|
11
12
|
function isGraphField(item) {
|
12
13
|
return item.type === 'graph';
|
@@ -331,7 +332,7 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
331
332
|
}); // 翻译引用属性
|
332
333
|
|
333
334
|
_context.next = 4;
|
334
|
-
return
|
335
|
+
return translateCisRefAttributeName(ciDatas);
|
335
336
|
|
336
337
|
case 4:
|
337
338
|
ciDatas = _context.sent;
|
@@ -461,8 +462,10 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
461
462
|
var refCi = refCiMap[refAttrs.id];
|
462
463
|
|
463
464
|
if (refCi) {
|
465
|
+
// 引用ci名称获取规则:如果ci是树形结构(例如区域),取 tree_name_path;非树形,取display_name
|
466
|
+
var displayName = refCi.attributes.tree_name_path || refCi.attributes.display_name;
|
464
467
|
attributeMap[refAttrs.attrCode + "_object"] = {
|
465
|
-
displayName:
|
468
|
+
displayName: displayName
|
466
469
|
};
|
467
470
|
}
|
468
471
|
});
|
@@ -522,15 +525,21 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
522
525
|
return _extends({}, item, {
|
523
526
|
tags: tags
|
524
527
|
});
|
525
|
-
});
|
526
|
-
|
528
|
+
});
|
529
|
+
rlog.debug('推送标注 => ht', elementTagsAndTips);
|
527
530
|
var htTopo = topo.getHtTopo();
|
528
531
|
|
529
532
|
if (htTopo) {
|
530
533
|
var _topo$historyManager, _topo$historyManager2;
|
531
534
|
|
532
535
|
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '加载标注');
|
533
|
-
|
536
|
+
|
537
|
+
try {
|
538
|
+
htTopo.loadTagAndTip(JSON.parse(JSON.stringify(elementTagsAndTips)));
|
539
|
+
} catch (error) {
|
540
|
+
rlog.error('推送标注 => ht 失败', error);
|
541
|
+
}
|
542
|
+
|
534
543
|
(_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '加载标注');
|
535
544
|
}
|
536
545
|
}
|
@@ -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.
|
27
|
+
var version = typeof "12.1.0-dev.1" === 'string' ? "12.1.0-dev.1" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
@@ -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;
|
@@ -23,14 +23,14 @@ var CiCache = /*#__PURE__*/function () {
|
|
23
23
|
_proto.load =
|
24
24
|
/*#__PURE__*/
|
25
25
|
function () {
|
26
|
-
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(ids) {
|
26
|
+
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(ids, refreshCiCache) {
|
27
27
|
var _this = this;
|
28
28
|
|
29
29
|
var unloadCiIds, cis, map;
|
30
30
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
31
31
|
while (1) switch (_context.prev = _context.next) {
|
32
32
|
case 0:
|
33
|
-
unloadCiIds = ids.filter(function (id) {
|
33
|
+
unloadCiIds = refreshCiCache === true ? ids : ids.filter(function (id) {
|
34
34
|
return !_this.ciMap[id];
|
35
35
|
});
|
36
36
|
|
@@ -62,7 +62,7 @@ var CiCache = /*#__PURE__*/function () {
|
|
62
62
|
}, _callee, this);
|
63
63
|
}));
|
64
64
|
|
65
|
-
function load(_x) {
|
65
|
+
function load(_x, _x2) {
|
66
66
|
return _load.apply(this, arguments);
|
67
67
|
}
|
68
68
|
|
@@ -106,6 +106,10 @@ var CiTypeCache = /*#__PURE__*/function () {
|
|
106
106
|
this.ciTypeMap = cache;
|
107
107
|
};
|
108
108
|
|
109
|
+
_proto.getCiTypeMap = function getCiTypeMap() {
|
110
|
+
return this.ciTypeMap;
|
111
|
+
};
|
112
|
+
|
109
113
|
_proto.getCiType = function getCiType(typeCode) {
|
110
114
|
return this.ciTypeMap[typeCode];
|
111
115
|
};
|
@@ -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
|
});
|
@@ -104,7 +104,7 @@ export default {
|
|
104
104
|
* @param {Array} groups
|
105
105
|
* @returns
|
106
106
|
*/
|
107
|
-
getTopoDataByResource: function getTopoDataByResource(id, resources, groups
|
107
|
+
getTopoDataByResource: function getTopoDataByResource(id, resources, groups) {
|
108
108
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
109
109
|
var data, obj;
|
110
110
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
@@ -123,7 +123,7 @@ export default {
|
|
123
123
|
obj = prepareGroupParams(data);
|
124
124
|
_context.next = 5;
|
125
125
|
return request.post(API_ROOT + "/structure/byCondition/" + id, _extends({}, obj, {
|
126
|
-
exportLinkIdList:
|
126
|
+
exportLinkIdList: []
|
127
127
|
}));
|
128
128
|
|
129
129
|
case 5:
|
@@ -35,7 +35,6 @@ var initialState = {
|
|
35
35
|
"static": []
|
36
36
|
},
|
37
37
|
groups: [],
|
38
|
-
exportLinkIdList: [],
|
39
38
|
// config: {
|
40
39
|
// view: null,
|
41
40
|
// groups: [],
|
@@ -243,18 +242,17 @@ export default function (topoApp) {
|
|
243
242
|
var _this2 = this;
|
244
243
|
|
245
244
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
246
|
-
var editState, resources, _editState$groups, groups,
|
245
|
+
var editState, resources, _editState$groups, groups, query, data;
|
247
246
|
|
248
247
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
249
248
|
while (1) switch (_context2.prev = _context2.next) {
|
250
249
|
case 0:
|
251
250
|
editState = rootState.topoConfig;
|
252
|
-
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups
|
251
|
+
resources = editState.resources, _editState$groups = editState.groups, groups = _editState$groups === void 0 ? [] : _editState$groups;
|
253
252
|
query = {
|
254
253
|
id: rootState.topoMod.topoId,
|
255
254
|
resources: resources,
|
256
|
-
groups: groups
|
257
|
-
ipNodes: ipNodes
|
255
|
+
groups: groups
|
258
256
|
};
|
259
257
|
_context2.next = 5;
|
260
258
|
return _this2.getTopoByConditions(query);
|
@@ -303,13 +301,13 @@ export default function (topoApp) {
|
|
303
301
|
var _this4 = this;
|
304
302
|
|
305
303
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
306
|
-
var topoId, resources, groups,
|
304
|
+
var topoId, resources, groups, viewConditions, groupInfo, data, _yield$Promise$all, dataWithLinkDetail, _combTopoData, topoData, resAndMetrics, topoDataTrans;
|
307
305
|
|
308
306
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
309
307
|
while (1) switch (_context4.prev = _context4.next) {
|
310
308
|
case 0:
|
311
309
|
rlog.debug("getTopoByConditions--------", params);
|
312
|
-
topoId = params.id, resources = params.resources, groups = params.groups
|
310
|
+
topoId = params.id, resources = params.resources, groups = params.groups;
|
313
311
|
viewConditions = resToConditions(resources);
|
314
312
|
groupInfo = isAvailableArray(groups) && groups.map(function (group) {
|
315
313
|
return _extends({}, group, {
|
@@ -319,7 +317,7 @@ export default function (topoApp) {
|
|
319
317
|
});
|
320
318
|
rlog.debug("getTopoByConditions--------", viewConditions, groupInfo);
|
321
319
|
_context4.next = 7;
|
322
|
-
return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo
|
320
|
+
return topoApp.serverApi.getTopoDataByResource(topoId, viewConditions, groupInfo);
|
323
321
|
|
324
322
|
case 7:
|
325
323
|
data = _context4.sent;
|
@@ -458,8 +456,7 @@ export default function (topoApp) {
|
|
458
456
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
459
457
|
while (1) switch (_context8.prev = _context8.next) {
|
460
458
|
case 0:
|
461
|
-
ids = data.ids, ip = data.ip;
|
462
|
-
|
459
|
+
ids = data.ids, ip = data.ip;
|
463
460
|
_context8.next = 3;
|
464
461
|
return networkLinkServer.queryLinksByIp(ids, ip);
|
465
462
|
|