@riil-frontend/component-topology 12.0.0-dev.9 → 12.1.0-dev.2
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 +31 -43
- package/es/core/models/Alarm.js +69 -142
- package/es/core/models/AttributeMetricDisplay.js +9 -3
- 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/topoData.js +0 -1
- package/es/core/models/utils/linkUtils.js +20 -13
- 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/components/LinkTopo/LinkTopoCard.js +2 -2
- 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 +9 -2
- package/es/utils/ciRefAttributeTranslateUtil.js +8 -9
- package/es/utils/topoData.js +1 -1
- 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 +30 -42
- package/lib/core/models/Alarm.js +69 -144
- package/lib/core/models/AttributeMetricDisplay.js +10 -2
- 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/topoData.js +0 -1
- package/lib/core/models/utils/linkUtils.js +21 -13
- 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/components/LinkTopo/LinkTopoCard.js +2 -2
- 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 +9 -2
- package/lib/utils/ciRefAttributeTranslateUtil.js +8 -9
- package/lib/utils/topoData.js +1 -1
- package/package.json +2 -2
@@ -127,10 +127,6 @@ 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();
|
134
130
|
topo.historyManager.endTransaction();
|
135
131
|
|
136
132
|
case 8:
|
@@ -383,33 +379,26 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
383
379
|
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(node) {
|
384
380
|
var _node$getEdges$toArra, _node$getEdges;
|
385
381
|
|
386
|
-
var
|
382
|
+
var edges;
|
387
383
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
388
384
|
while (1) switch (_context4.prev = _context4.next) {
|
389
385
|
case 0:
|
390
|
-
|
386
|
+
// console.log("删除关联在节点上的出口链路- node, config", node, config);
|
387
|
+
edges = (_node$getEdges$toArra = (_node$getEdges = node.getEdges()) === null || _node$getEdges === void 0 ? void 0 : _node$getEdges.toArray()) !== null && _node$getEdges$toArra !== void 0 ? _node$getEdges$toArra : [];
|
391
388
|
|
392
|
-
|
389
|
+
if (edges.length > 0) {
|
390
|
+
edges.map(function (edge) {
|
391
|
+
if (edge.getTag()) {
|
392
|
+
var link = topo.dataModel.getDataById(edge.getTag());
|
393
393
|
|
394
|
-
|
395
|
-
|
396
|
-
|
394
|
+
if (link && (0, _linkUtils.isExitLink)(link)) {
|
395
|
+
topo.getGraphView().dm().remove(edge);
|
396
|
+
}
|
397
|
+
}
|
398
|
+
});
|
397
399
|
}
|
398
400
|
|
399
|
-
|
400
|
-
|
401
|
-
edges.map(function (edge) {
|
402
|
-
if (edge.a("dtype") === "link" && exportLinkIdList.indexOf(edge.getTag()) >= 0) {
|
403
|
-
// exLink.push(edge);
|
404
|
-
topo.getGraphView().dm().remove(edge);
|
405
|
-
exportLinkIdList.splice(config.exportLinkIdList.indexOf(edge.getTag()), 1);
|
406
|
-
}
|
407
|
-
});
|
408
|
-
config.exportLinkIdList = exportLinkIdList;
|
409
|
-
_context4.next = 8;
|
410
|
-
return resourceConfig.updateConfig(config);
|
411
|
-
|
412
|
-
case 8:
|
401
|
+
case 2:
|
413
402
|
case "end":
|
414
403
|
return _context4.stop();
|
415
404
|
}
|
@@ -873,7 +862,9 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
873
862
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
874
863
|
while (1) switch (_context8.prev = _context8.next) {
|
875
864
|
case 0:
|
876
|
-
dm = htTopo.getGraphView().dm(); //
|
865
|
+
dm = htTopo.getGraphView().dm(); // 移除旧节点。先删除后创建,解决ip节点替换ping资源后链路丢失问题
|
866
|
+
|
867
|
+
dm.remove(node); // 创建
|
877
868
|
|
878
869
|
newLinkElements = findUNExistedLinkElements(elements);
|
879
870
|
createElementsData = null;
|
@@ -935,22 +926,13 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
935
926
|
|
936
927
|
|
937
928
|
sm = htTopo.getGraphView().sm();
|
938
|
-
sm.setSelection([newElement]); //
|
929
|
+
sm.setSelection([newElement]); // 临时放这里,仅拓扑中心有
|
939
930
|
|
940
|
-
dm.remove(node); // saveBind(TopoEvent.DATA_TYPE_RESOURCE_SINGLE, newDatas);
|
941
|
-
// node.a("customName", null);
|
942
|
-
// 删除关联在节点上的出口链路
|
943
|
-
|
944
|
-
_context8.next = 12;
|
945
|
-
return deleteExLink(node);
|
946
|
-
|
947
|
-
case 12:
|
948
|
-
// 临时放这里,仅拓扑中心有
|
949
931
|
if (topo.linkDynamicStyleExecutor) {
|
950
932
|
topo.linkDynamicStyleExecutor.execute();
|
951
933
|
}
|
952
934
|
|
953
|
-
case
|
935
|
+
case 11:
|
954
936
|
case "end":
|
955
937
|
return _context8.stop();
|
956
938
|
}
|
@@ -1015,11 +997,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1015
997
|
break;
|
1016
998
|
}
|
1017
999
|
|
1000
|
+
topo.historyManager.endTransaction();
|
1001
|
+
|
1018
1002
|
_message["default"].error("关联资源失败");
|
1019
1003
|
|
1020
|
-
_rlog["default"].
|
1004
|
+
_rlog["default"].error("关联资源失败");
|
1021
1005
|
|
1022
|
-
topo.historyManager.endTransaction();
|
1023
1006
|
return _context9.abrupt("return", false);
|
1024
1007
|
|
1025
1008
|
case 23:
|
@@ -1051,7 +1034,7 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1051
1034
|
|
1052
1035
|
function _relateNodeIp() {
|
1053
1036
|
_relateNodeIp = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(txtValue, nodeElement) {
|
1054
|
-
var dm, isUnique,
|
1037
|
+
var dm, isUnique, ipNodeData, configObj, configData, _elements2, newLinkElements, newLink, newLinkGroup, createElementsData, _htTopo;
|
1055
1038
|
|
1056
1039
|
return _regenerator["default"].wrap(function _callee15$(_context15) {
|
1057
1040
|
while (1) switch (_context15.prev = _context15.next) {
|
@@ -1077,12 +1060,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1077
1060
|
break;
|
1078
1061
|
}
|
1079
1062
|
|
1080
|
-
|
1063
|
+
ipNodeData = (0, _exitLinkUtil.buildIpNode)(txtValue);
|
1081
1064
|
_context15.next = 8;
|
1082
1065
|
return deleteExLink(nodeElement);
|
1083
1066
|
|
1084
1067
|
case 8:
|
1085
|
-
nodeElement.a(
|
1068
|
+
nodeElement.a(ipNodeData);
|
1086
1069
|
nodeElement.setName(txtValue);
|
1087
1070
|
nodeElement.setTag("ip:" + txtValue); // 获取配置
|
1088
1071
|
|
@@ -1119,7 +1102,12 @@ var useTopoEdit = function useTopoEdit(params) {
|
|
1119
1102
|
if ([].concat(newLink, newLinkGroup).length > 0) {
|
1120
1103
|
_htTopo = topo.getHtTopo();
|
1121
1104
|
|
1122
|
-
_htTopo.createElements(createElementsData);
|
1105
|
+
_htTopo.createElements(createElementsData); // 临时放这里,仅拓扑中心有
|
1106
|
+
|
1107
|
+
|
1108
|
+
if (topo.linkDynamicStyleExecutor) {
|
1109
|
+
topo.linkDynamicStyleExecutor.execute();
|
1110
|
+
}
|
1123
1111
|
}
|
1124
1112
|
|
1125
1113
|
case 24:
|
package/lib/core/models/Alarm.js
CHANGED
@@ -96,8 +96,7 @@ var Alarm = /*#__PURE__*/function () {
|
|
96
96
|
|
97
97
|
_componentTopologyUtils.rlog.info('Alarm.open 打开告警通道', id);
|
98
98
|
|
99
|
-
this.openTopoAlarm(id);
|
100
|
-
|
99
|
+
this.openTopoAlarm(id);
|
101
100
|
this.hmGetTopoAlarmByDoc(id);
|
102
101
|
}
|
103
102
|
/**
|
@@ -227,85 +226,6 @@ var Alarm = /*#__PURE__*/function () {
|
|
227
226
|
}
|
228
227
|
|
229
228
|
return hmGetTopoAlarmByDoc;
|
230
|
-
}();
|
231
|
-
|
232
|
-
_proto.hmGetTopoAlarm = /*#__PURE__*/function () {
|
233
|
-
var _hmGetTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id) {
|
234
|
-
var mainCiIdList, endTime, startTime, parms, result;
|
235
|
-
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
236
|
-
while (1) switch (_context3.prev = _context3.next) {
|
237
|
-
case 0:
|
238
|
-
mainCiIdList = this.topo.dataModel.getDatas().filter(function (ci) {
|
239
|
-
return !!ci.operation;
|
240
|
-
}) // 过滤掉权限
|
241
|
-
.map(function (ci) {
|
242
|
-
return ci.id;
|
243
|
-
});
|
244
|
-
|
245
|
-
if (!(mainCiIdList.length === 0)) {
|
246
|
-
_context3.next = 4;
|
247
|
-
break;
|
248
|
-
}
|
249
|
-
|
250
|
-
this.updateState({
|
251
|
-
alarmData: [],
|
252
|
-
alarmPanelIsOpen: false
|
253
|
-
});
|
254
|
-
return _context3.abrupt("return");
|
255
|
-
|
256
|
-
case 4:
|
257
|
-
//rlog.debug("获取告警列表", mainCiIdList);
|
258
|
-
endTime = null; // new Date().valueOf();
|
259
|
-
|
260
|
-
startTime = null; // moment().subtract(1, "months").valueOf();
|
261
|
-
|
262
|
-
parms = {
|
263
|
-
mainCiIdList: mainCiIdList,
|
264
|
-
alertStatusList: ['toDeal', 'dealing'],
|
265
|
-
pageNum: 1,
|
266
|
-
pageSize: 10,
|
267
|
-
sortField: 'alertLevel',
|
268
|
-
alertLevelList: [],
|
269
|
-
orders: [{
|
270
|
-
property: 'alertLevel',
|
271
|
-
direction: 'ASC'
|
272
|
-
}, {
|
273
|
-
property: 'createTime',
|
274
|
-
direction: 'DESC'
|
275
|
-
}],
|
276
|
-
createTime: {
|
277
|
-
startTime: startTime,
|
278
|
-
endTime: endTime
|
279
|
-
}
|
280
|
-
};
|
281
|
-
_context3.next = 9;
|
282
|
-
return _topo["default"].getAlarmByIds(parms);
|
283
|
-
|
284
|
-
case 9:
|
285
|
-
result = _context3.sent;
|
286
|
-
|
287
|
-
_componentTopologyUtils.rlog.debug('getAlarmById-result', result); // if (alarmIsOpened) {
|
288
|
-
// //this.topo.loadAlarm(result.datas);
|
289
|
-
// this.handleAlarmEvent({ type: "alarm", data: result.datas });
|
290
|
-
// }
|
291
|
-
// this.updateState({
|
292
|
-
// alarmData: result.datas.length > 0 ? result.datas : [],
|
293
|
-
// alarmPanelIsOpen: result.datas.length > 0,
|
294
|
-
// });
|
295
|
-
|
296
|
-
|
297
|
-
case 11:
|
298
|
-
case "end":
|
299
|
-
return _context3.stop();
|
300
|
-
}
|
301
|
-
}, _callee3, this);
|
302
|
-
}));
|
303
|
-
|
304
|
-
function hmGetTopoAlarm(_x2) {
|
305
|
-
return _hmGetTopoAlarm.apply(this, arguments);
|
306
|
-
}
|
307
|
-
|
308
|
-
return hmGetTopoAlarm;
|
309
229
|
}()
|
310
230
|
/**
|
311
231
|
* 直接装载告警数据(可装载mock列表)
|
@@ -316,9 +236,9 @@ var Alarm = /*#__PURE__*/function () {
|
|
316
236
|
_proto.setAlarmDataByMock =
|
317
237
|
/*#__PURE__*/
|
318
238
|
function () {
|
319
|
-
var _setAlarmDataByMock = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
320
|
-
return _regenerator["default"].wrap(function
|
321
|
-
while (1) switch (
|
239
|
+
var _setAlarmDataByMock = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(datas) {
|
240
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
241
|
+
while (1) switch (_context3.prev = _context3.next) {
|
322
242
|
case 0:
|
323
243
|
this.updateState({
|
324
244
|
alarmData: datas.length > 0 ? datas : [],
|
@@ -327,12 +247,12 @@ var Alarm = /*#__PURE__*/function () {
|
|
327
247
|
|
328
248
|
case 1:
|
329
249
|
case "end":
|
330
|
-
return
|
250
|
+
return _context3.stop();
|
331
251
|
}
|
332
|
-
},
|
252
|
+
}, _callee3, this);
|
333
253
|
}));
|
334
254
|
|
335
|
-
function setAlarmDataByMock(
|
255
|
+
function setAlarmDataByMock(_x2) {
|
336
256
|
return _setAlarmDataByMock.apply(this, arguments);
|
337
257
|
}
|
338
258
|
|
@@ -347,10 +267,10 @@ var Alarm = /*#__PURE__*/function () {
|
|
347
267
|
_proto.switchAlarmPopPanel =
|
348
268
|
/*#__PURE__*/
|
349
269
|
function () {
|
350
|
-
var _switchAlarmPopPanel = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
270
|
+
var _switchAlarmPopPanel = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(flag) {
|
351
271
|
var topoDispatchers;
|
352
|
-
return _regenerator["default"].wrap(function
|
353
|
-
while (1) switch (
|
272
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
273
|
+
while (1) switch (_context4.prev = _context4.next) {
|
354
274
|
case 0:
|
355
275
|
// console.log("switchAlarmPopPanel", flag);
|
356
276
|
topoDispatchers = this.topo.store.getModelDispatchers('topoAlarm');
|
@@ -360,12 +280,12 @@ var Alarm = /*#__PURE__*/function () {
|
|
360
280
|
|
361
281
|
case 2:
|
362
282
|
case "end":
|
363
|
-
return
|
283
|
+
return _context4.stop();
|
364
284
|
}
|
365
|
-
},
|
285
|
+
}, _callee4, this);
|
366
286
|
}));
|
367
287
|
|
368
|
-
function switchAlarmPopPanel(
|
288
|
+
function switchAlarmPopPanel(_x3) {
|
369
289
|
return _switchAlarmPopPanel.apply(this, arguments);
|
370
290
|
}
|
371
291
|
|
@@ -381,21 +301,21 @@ var Alarm = /*#__PURE__*/function () {
|
|
381
301
|
_proto.openTopoAlarm =
|
382
302
|
/*#__PURE__*/
|
383
303
|
function () {
|
384
|
-
var _openTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
304
|
+
var _openTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(id) {
|
385
305
|
var _this$getState2, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
|
386
306
|
|
387
|
-
return _regenerator["default"].wrap(function
|
388
|
-
while (1) switch (
|
307
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
308
|
+
while (1) switch (_context5.prev = _context5.next) {
|
389
309
|
case 0:
|
390
310
|
// 如果当前拓扑图开启中或已开启则退出
|
391
311
|
_this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
|
392
312
|
|
393
313
|
if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
|
394
|
-
|
314
|
+
_context5.next = 3;
|
395
315
|
break;
|
396
316
|
}
|
397
317
|
|
398
|
-
return
|
318
|
+
return _context5.abrupt("return");
|
399
319
|
|
400
320
|
case 3:
|
401
321
|
this.currentTopoId = id;
|
@@ -403,16 +323,16 @@ var Alarm = /*#__PURE__*/function () {
|
|
403
323
|
alarmOpening: true
|
404
324
|
});
|
405
325
|
alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm');
|
406
|
-
|
326
|
+
_context5.next = 8;
|
407
327
|
return alarmDispatchers.resetAlarmDoc();
|
408
328
|
|
409
329
|
case 8:
|
410
|
-
|
411
|
-
|
330
|
+
_context5.prev = 8;
|
331
|
+
_context5.next = 11;
|
412
332
|
return this.topo.serverApi.openTopoAlarm(id);
|
413
333
|
|
414
334
|
case 11:
|
415
|
-
this.secretKey =
|
335
|
+
this.secretKey = _context5.sent;
|
416
336
|
|
417
337
|
_componentTopologyUtils.rlog.info('openTopoAlarm 打开拓扑告警推送-------------------开始');
|
418
338
|
|
@@ -420,12 +340,12 @@ var Alarm = /*#__PURE__*/function () {
|
|
420
340
|
alarmOpening: false,
|
421
341
|
alarmIsOpened: true
|
422
342
|
});
|
423
|
-
|
343
|
+
_context5.next = 20;
|
424
344
|
break;
|
425
345
|
|
426
346
|
case 16:
|
427
|
-
|
428
|
-
|
347
|
+
_context5.prev = 16;
|
348
|
+
_context5.t0 = _context5["catch"](8);
|
429
349
|
|
430
350
|
_componentTopologyUtils.rlog.error('打开拓扑告警推送 失败');
|
431
351
|
|
@@ -435,12 +355,12 @@ var Alarm = /*#__PURE__*/function () {
|
|
435
355
|
|
436
356
|
case 20:
|
437
357
|
case "end":
|
438
|
-
return
|
358
|
+
return _context5.stop();
|
439
359
|
}
|
440
|
-
},
|
360
|
+
}, _callee5, this, [[8, 16]]);
|
441
361
|
}));
|
442
362
|
|
443
|
-
function openTopoAlarm(
|
363
|
+
function openTopoAlarm(_x4) {
|
444
364
|
return _openTopoAlarm.apply(this, arguments);
|
445
365
|
}
|
446
366
|
|
@@ -456,21 +376,21 @@ var Alarm = /*#__PURE__*/function () {
|
|
456
376
|
_proto.closeTopoAlarm =
|
457
377
|
/*#__PURE__*/
|
458
378
|
function () {
|
459
|
-
var _closeTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
379
|
+
var _closeTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(id) {
|
460
380
|
var _this$getState3, alarmIsOpened, alarmOpening;
|
461
381
|
|
462
|
-
return _regenerator["default"].wrap(function
|
463
|
-
while (1) switch (
|
382
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
383
|
+
while (1) switch (_context6.prev = _context6.next) {
|
464
384
|
case 0:
|
465
385
|
// 如果未开启则退出
|
466
386
|
_this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
|
467
387
|
|
468
388
|
if (!(!alarmIsOpened && !alarmOpening)) {
|
469
|
-
|
389
|
+
_context6.next = 3;
|
470
390
|
break;
|
471
391
|
}
|
472
392
|
|
473
|
-
return
|
393
|
+
return _context6.abrupt("return");
|
474
394
|
|
475
395
|
case 3:
|
476
396
|
this.currentTopoId = null;
|
@@ -482,17 +402,17 @@ var Alarm = /*#__PURE__*/function () {
|
|
482
402
|
alarmOpening: false,
|
483
403
|
alarmPanelIsOpen: false
|
484
404
|
});
|
485
|
-
|
405
|
+
_context6.next = 8;
|
486
406
|
return this.topo.serverApi.closeTopoAlarm(id, this.secretKey);
|
487
407
|
|
488
408
|
case 8:
|
489
409
|
case "end":
|
490
|
-
return
|
410
|
+
return _context6.stop();
|
491
411
|
}
|
492
|
-
},
|
412
|
+
}, _callee6, this);
|
493
413
|
}));
|
494
414
|
|
495
|
-
function closeTopoAlarm(
|
415
|
+
function closeTopoAlarm(_x5) {
|
496
416
|
return _closeTopoAlarm.apply(this, arguments);
|
497
417
|
}
|
498
418
|
|
@@ -517,20 +437,20 @@ var Alarm = /*#__PURE__*/function () {
|
|
517
437
|
_proto.restart =
|
518
438
|
/*#__PURE__*/
|
519
439
|
function () {
|
520
|
-
var _restart = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
440
|
+
var _restart = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
521
441
|
var id;
|
522
|
-
return _regenerator["default"].wrap(function
|
523
|
-
while (1) switch (
|
442
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
443
|
+
while (1) switch (_context7.prev = _context7.next) {
|
524
444
|
case 0:
|
525
445
|
id = this.currentTopoId;
|
526
|
-
|
446
|
+
_context7.next = 3;
|
527
447
|
return this.openTopoAlarm(id);
|
528
448
|
|
529
449
|
case 3:
|
530
450
|
case "end":
|
531
|
-
return
|
451
|
+
return _context7.stop();
|
532
452
|
}
|
533
|
-
},
|
453
|
+
}, _callee7, this);
|
534
454
|
}));
|
535
455
|
|
536
456
|
function restart() {
|
@@ -547,26 +467,28 @@ var Alarm = /*#__PURE__*/function () {
|
|
547
467
|
_proto.handleAlarmEvent =
|
548
468
|
/*#__PURE__*/
|
549
469
|
function () {
|
550
|
-
var _handleAlarmEvent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
470
|
+
var _handleAlarmEvent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(alertData) {
|
551
471
|
var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche2, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
|
552
472
|
|
553
|
-
return _regenerator["default"].wrap(function
|
554
|
-
while (1) switch (
|
473
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
474
|
+
while (1) switch (_context8.prev = _context8.next) {
|
555
475
|
case 0:
|
556
476
|
_this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
|
557
477
|
resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
|
558
478
|
resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
|
559
479
|
alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm'); // 添加事件
|
560
|
-
|
480
|
+
|
481
|
+
console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
|
561
482
|
|
562
483
|
if (!((0, _utils.isAvailableArray)(alertData) && (0, _utils.isAvailableArray)(resIdsList))) {
|
563
|
-
|
484
|
+
_context8.next = 27;
|
564
485
|
break;
|
565
486
|
}
|
566
487
|
|
567
488
|
sendAl = [];
|
568
489
|
idsList = [].concat(nodeIdsList, linkIdsList);
|
569
490
|
operations = [];
|
491
|
+
console.log('idsList---------', idsList);
|
570
492
|
idsList.forEach(function (idItem) {
|
571
493
|
if (idItem.operation === null) {
|
572
494
|
operations.push(idItem.ciId);
|
@@ -576,6 +498,7 @@ var Alarm = /*#__PURE__*/function () {
|
|
576
498
|
var _item$resourceId;
|
577
499
|
|
578
500
|
var ciId = (_item$resourceId = item.resourceId) !== null && _item$resourceId !== void 0 ? _item$resourceId : item.ciId;
|
501
|
+
var isSub = false;
|
579
502
|
var obj = {
|
580
503
|
id: ciId,
|
581
504
|
level: item.alertLevel,
|
@@ -584,29 +507,31 @@ var Alarm = /*#__PURE__*/function () {
|
|
584
507
|
obj: item,
|
585
508
|
info: item.alertType,
|
586
509
|
ciCode: item === null || item === void 0 ? void 0 : item.ciCode,
|
587
|
-
ruleId: item === null || item === void 0 ? void 0 : item.ruleId
|
510
|
+
ruleId: item === null || item === void 0 ? void 0 : item.ruleId,
|
511
|
+
isSub: isSub
|
588
512
|
};
|
589
513
|
|
590
514
|
if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
|
591
515
|
sendAl.push(obj);
|
592
516
|
}
|
593
|
-
});
|
517
|
+
});
|
518
|
+
console.log("before-combAlarmData", sendAl, idsList);
|
594
519
|
|
595
520
|
if (!(sendAl.length > 0)) {
|
596
|
-
|
521
|
+
_context8.next = 27;
|
597
522
|
break;
|
598
523
|
}
|
599
524
|
|
600
525
|
_componentTopologyUtils.rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
|
601
526
|
|
602
|
-
|
603
|
-
|
527
|
+
_context8.prev = 15;
|
528
|
+
_context8.next = 18;
|
604
529
|
return alarmDispatchers.combAlarmData({
|
605
530
|
alarmdata: sendAl
|
606
531
|
});
|
607
532
|
|
608
|
-
case
|
609
|
-
_yield$alarmDispatche2 =
|
533
|
+
case 18:
|
534
|
+
_yield$alarmDispatche2 = _context8.sent;
|
610
535
|
eqFlag = _yield$alarmDispatche2.eqFlag;
|
611
536
|
alarmlist = _yield$alarmDispatche2.alarmlist;
|
612
537
|
|
@@ -626,23 +551,23 @@ var Alarm = /*#__PURE__*/function () {
|
|
626
551
|
}
|
627
552
|
}
|
628
553
|
|
629
|
-
|
554
|
+
_context8.next = 27;
|
630
555
|
break;
|
631
556
|
|
632
|
-
case
|
633
|
-
|
634
|
-
|
557
|
+
case 24:
|
558
|
+
_context8.prev = 24;
|
559
|
+
_context8.t0 = _context8["catch"](15);
|
635
560
|
|
636
|
-
_componentTopologyUtils.rlog.error('告警发送异常',
|
561
|
+
_componentTopologyUtils.rlog.error('告警发送异常', _context8.t0);
|
637
562
|
|
638
|
-
case
|
563
|
+
case 27:
|
639
564
|
case "end":
|
640
|
-
return
|
565
|
+
return _context8.stop();
|
641
566
|
}
|
642
|
-
},
|
567
|
+
}, _callee8, this, [[15, 24]]);
|
643
568
|
}));
|
644
569
|
|
645
|
-
function handleAlarmEvent(
|
570
|
+
function handleAlarmEvent(_x6) {
|
646
571
|
return _handleAlarmEvent.apply(this, arguments);
|
647
572
|
}
|
648
573
|
|
@@ -539,7 +539,9 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
539
539
|
return (0, _extends2["default"])({}, item, {
|
540
540
|
tags: tags
|
541
541
|
});
|
542
|
-
});
|
542
|
+
});
|
543
|
+
|
544
|
+
_componentTopologyUtils.rlog.debug('推送标注 => ht', elementTagsAndTips);
|
543
545
|
|
544
546
|
var htTopo = topo.getHtTopo();
|
545
547
|
|
@@ -547,7 +549,13 @@ var AttributeMetricDisplay = /*#__PURE__*/function () {
|
|
547
549
|
var _topo$historyManager, _topo$historyManager2;
|
548
550
|
|
549
551
|
(_topo$historyManager = topo.historyManager) === null || _topo$historyManager === void 0 ? void 0 : _topo$historyManager.setDisabled(true, '加载标注');
|
550
|
-
|
552
|
+
|
553
|
+
try {
|
554
|
+
htTopo.loadTagAndTip(JSON.parse(JSON.stringify(elementTagsAndTips)));
|
555
|
+
} catch (error) {
|
556
|
+
_componentTopologyUtils.rlog.error('推送标注 => ht 失败', error);
|
557
|
+
}
|
558
|
+
|
551
559
|
(_topo$historyManager2 = topo.historyManager) === null || _topo$historyManager2 === void 0 ? void 0 : _topo$historyManager2.setDisabled(false, '加载标注');
|
552
560
|
}
|
553
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.2" === 'string' ? "12.1.0-dev.2" : 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
|
|