@riil-frontend/component-topology 11.0.33 → 11.0.35
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 +2 -2
- package/build/2.js +1 -1
- package/build/index.css +4 -2
- package/build/index.js +52 -45
- package/es/components/MultiResourceDrawer/index.js +22 -26
- package/es/components/ResourceList/ResourceSelect.js +55 -58
- package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +30 -34
- package/es/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +29 -33
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/es/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -18
- package/es/core/editor/components/BackgroundView/index.js +149 -178
- package/es/core/editor/components/BackgroundView/index.module.scss +2 -1
- package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +26 -30
- package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -34
- package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +20 -24
- package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +13 -17
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +17 -21
- package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +27 -31
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +16 -20
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +37 -55
- package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/es/core/editor/hooks/useNewElementTheme.js +2 -2
- package/es/core/editor/store/background.js +8 -10
- package/es/core/editor/store/topoEdit.js +4 -6
- package/es/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/es/core/hooks/usePolling.js +130 -142
- package/es/core/hooks/useResourceConfig.js +76 -100
- package/es/core/hooks/useTopoEdit.js +525 -623
- package/es/core/models/Alarm.js +319 -402
- package/es/core/models/AttributeMetricDisplay.js +115 -143
- package/es/core/models/PluginManager.js +4 -3
- package/es/core/models/SelectionModel.js +4 -5
- package/es/core/models/TopoApp.js +279 -436
- package/es/core/models/TopoGraphView.js +28 -41
- package/es/core/models/cache/CiCache.js +34 -39
- package/es/core/models/cache/CiTypeCache.js +47 -61
- package/es/core/models/cache/DictCache.js +36 -42
- package/es/core/models/graph/Background.js +21 -26
- package/es/core/models/plugins/resourceWebControllUrl.js +84 -103
- package/es/core/models/tagstips/ElementTagTipConfig.js +44 -58
- package/es/core/models/topoData.js +73 -77
- package/es/core/models/utils/linkUtils.js +46 -51
- package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/es/core/services/alarm.js +14 -16
- package/es/core/services/background.js +59 -67
- package/es/core/services/cmdb/metric.js +14 -18
- package/es/core/services/cmdb.js +23 -27
- package/es/core/services/index.js +48 -68
- package/es/core/services/overview.js +131 -151
- package/es/core/services/topo/basic.js +37 -41
- package/es/core/services/topo/tagtip.js +15 -19
- package/es/core/store/models/ciModel.js +58 -62
- package/es/core/store/models/customIcon.js +126 -145
- package/es/core/store/models/displayConfig.js +15 -19
- package/es/core/store/models/selection.js +4 -6
- package/es/core/store/models/topoAlarm.js +162 -145
- package/es/core/store/models/topoBaseInfoOverview.js +4 -6
- package/es/core/store/models/topoBizMod.js +9 -11
- package/es/core/store/models/topoConfig.js +215 -231
- package/es/core/store/models/topoGraphView.js +4 -6
- package/es/core/store/models/topoMod.js +373 -395
- package/es/core/utils/imageUtil.js +23 -27
- package/es/core/utils/saveSerialize.js +14 -18
- package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +20 -25
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +363 -409
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +112 -131
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +40 -46
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +219 -275
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +45 -54
- package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +32 -44
- package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +23 -27
- package/es/networkTopo/components/Link/hook.js +85 -96
- package/es/networkTopo/components/Link/index.js +104 -126
- package/es/networkTopo/components/Link/setting.js +48 -52
- package/es/networkTopo/getTopoData.js +73 -92
- package/es/networkTopo/hooks/viewer/useRelateTopo.js +34 -39
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/models/TopoCenter.js +28 -46
- package/es/networkTopo/services/alert.js +18 -22
- package/es/networkTopo/services/authorization.js +45 -55
- package/es/networkTopo/services/cmdb.js +548 -696
- package/es/networkTopo/services/funcAuth.js +22 -24
- package/es/networkTopo/services/link.js +107 -117
- package/es/networkTopo/services/mdc.js +33 -48
- package/es/networkTopo/services/metric.js +38 -47
- package/es/networkTopo/services/model.js +616 -809
- package/es/networkTopo/services/risk.js +9 -11
- package/es/networkTopo/services/topo/auth.js +27 -33
- package/es/networkTopo/services/topo/basic.js +251 -289
- package/es/networkTopo/services/topo/blacklist.js +20 -24
- package/es/networkTopo/services/topo/ciInfo.js +27 -31
- package/es/networkTopo/services/topo/icon.js +49 -59
- package/es/networkTopo/services/topo/networkLink.js +32 -36
- package/es/networkTopo/services/topo/relation.js +9 -11
- package/es/networkTopo/services/topo/resourceWebUrl.js +36 -42
- package/es/networkTopo/store/functionAuth.js +31 -37
- package/es/networkTopo/store/topoCenter.js +142 -152
- package/es/networkTopo/store/topoLinkMod.js +4 -6
- package/es/networkTopo/store/topoTreeMod.js +170 -182
- package/es/networkTopo/utils/exportData.js +57 -61
- package/lib/components/MultiResourceDrawer/index.js +22 -26
- package/lib/components/ResourceList/ResourceSelect.js +54 -58
- package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +33 -37
- package/lib/components/SingleResourceDrawer/SelectDrawer.js +24 -28
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +36 -40
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +92 -108
- package/lib/core/components/titlebar/widgets/TitleWidget.js +5 -3
- package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +18 -18
- package/lib/core/editor/components/BackgroundView/index.js +148 -177
- package/lib/core/editor/components/BackgroundView/index.module.scss +2 -1
- package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +28 -32
- package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +34 -34
- package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +23 -28
- package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +14 -18
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +45 -56
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +60 -70
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +60 -70
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +18 -22
- package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +32 -36
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +21 -25
- package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +18 -22
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +41 -59
- package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
- package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
- package/lib/core/editor/store/background.js +8 -10
- package/lib/core/editor/store/topoEdit.js +4 -6
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +2 -4
- package/lib/core/hooks/usePolling.js +129 -141
- package/lib/core/hooks/useResourceConfig.js +76 -100
- package/lib/core/hooks/useTopoEdit.js +517 -615
- package/lib/core/models/Alarm.js +313 -396
- package/lib/core/models/AttributeMetricDisplay.js +118 -146
- package/lib/core/models/PluginManager.js +4 -3
- package/lib/core/models/SelectionModel.js +4 -5
- package/lib/core/models/TopoApp.js +279 -436
- package/lib/core/models/TopoGraphView.js +28 -41
- package/lib/core/models/cache/CiCache.js +39 -44
- package/lib/core/models/cache/CiTypeCache.js +48 -62
- package/lib/core/models/cache/DictCache.js +39 -45
- package/lib/core/models/graph/Background.js +22 -27
- package/lib/core/models/plugins/resourceWebControllUrl.js +82 -101
- package/lib/core/models/tagstips/ElementTagTipConfig.js +44 -58
- package/lib/core/models/topoData.js +73 -78
- package/lib/core/models/utils/linkUtils.js +45 -51
- package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
- package/lib/core/services/alarm.js +18 -20
- package/lib/core/services/background.js +70 -78
- package/lib/core/services/cmdb/metric.js +14 -19
- package/lib/core/services/cmdb.js +24 -29
- package/lib/core/services/index.js +53 -72
- package/lib/core/services/overview.js +131 -151
- package/lib/core/services/topo/basic.js +37 -41
- package/lib/core/services/topo/tagtip.js +16 -21
- package/lib/core/store/models/ciModel.js +66 -70
- package/lib/core/store/models/customIcon.js +126 -145
- package/lib/core/store/models/displayConfig.js +15 -19
- package/lib/core/store/models/selection.js +4 -6
- package/lib/core/store/models/topoAlarm.js +163 -145
- package/lib/core/store/models/topoBaseInfoOverview.js +4 -6
- package/lib/core/store/models/topoBizMod.js +9 -11
- package/lib/core/store/models/topoConfig.js +222 -238
- package/lib/core/store/models/topoGraphView.js +4 -6
- package/lib/core/store/models/topoMod.js +375 -397
- package/lib/core/utils/imageUtil.js +26 -31
- package/lib/core/utils/saveSerialize.js +13 -18
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +62 -66
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +21 -26
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +364 -410
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +114 -133
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +44 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +220 -274
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +113 -118
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +63 -68
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +40 -50
- package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +35 -47
- package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -43
- package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +24 -28
- package/lib/networkTopo/components/Link/hook.js +86 -98
- package/lib/networkTopo/components/Link/index.js +105 -127
- package/lib/networkTopo/components/Link/setting.js +48 -52
- package/lib/networkTopo/getTopoData.js +73 -92
- package/lib/networkTopo/hooks/viewer/useRelateTopo.js +35 -40
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/models/TopoCenter.js +28 -46
- package/lib/networkTopo/services/alert.js +18 -22
- package/lib/networkTopo/services/authorization.js +55 -65
- package/lib/networkTopo/services/cmdb.js +551 -700
- package/lib/networkTopo/services/funcAuth.js +24 -26
- package/lib/networkTopo/services/link.js +108 -118
- package/lib/networkTopo/services/mdc.js +35 -51
- package/lib/networkTopo/services/metric.js +37 -47
- package/lib/networkTopo/services/model.js +615 -809
- package/lib/networkTopo/services/risk.js +11 -13
- package/lib/networkTopo/services/topo/auth.js +27 -33
- package/lib/networkTopo/services/topo/basic.js +252 -290
- package/lib/networkTopo/services/topo/blacklist.js +20 -24
- package/lib/networkTopo/services/topo/ciInfo.js +34 -38
- package/lib/networkTopo/services/topo/icon.js +59 -69
- package/lib/networkTopo/services/topo/networkLink.js +32 -36
- package/lib/networkTopo/services/topo/relation.js +11 -13
- package/lib/networkTopo/services/topo/resourceWebUrl.js +44 -50
- package/lib/networkTopo/store/functionAuth.js +31 -37
- package/lib/networkTopo/store/topoCenter.js +142 -152
- package/lib/networkTopo/store/topoLinkMod.js +4 -6
- package/lib/networkTopo/store/topoTreeMod.js +166 -178
- package/lib/networkTopo/utils/exportData.js +63 -68
- package/package.json +4 -3
package/lib/core/models/Alarm.js
CHANGED
@@ -18,9 +18,12 @@ var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-ut
|
|
18
18
|
var _utils = require("@riil-frontend/utils");
|
19
19
|
|
20
20
|
var Alarm = /*#__PURE__*/function () {
|
21
|
+
var _open, _hmGetTopoAlarmByDoc, _hmGetTopoAlarm, _setAlarmDataByMock, _switchAlarmPopPanel, _openTopoAlarm, _closeTopoAlarm, _restart, _handleAlarmEvent;
|
22
|
+
|
21
23
|
function Alarm() {
|
22
24
|
this.topo = void 0;
|
23
25
|
this.currentTopoId = void 0;
|
26
|
+
// 告警通道id
|
24
27
|
this.secretKey = null;
|
25
28
|
this.alarmSwitch = true;
|
26
29
|
}
|
@@ -41,51 +44,41 @@ var Alarm = /*#__PURE__*/function () {
|
|
41
44
|
*/
|
42
45
|
;
|
43
46
|
|
44
|
-
_proto.open =
|
45
|
-
|
46
|
-
function () {
|
47
|
-
var _open = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
47
|
+
_proto.open = function open() {
|
48
|
+
return (_open = _open || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
48
49
|
var _this = this;
|
49
50
|
|
50
51
|
var nodeCount;
|
51
52
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
52
|
-
while (1) {
|
53
|
-
|
54
|
-
|
55
|
-
this.resetData();
|
56
|
-
|
57
|
-
if (!(!this.isEnabled() || this.topo.isEditMode())) {
|
58
|
-
_context.next = 3;
|
59
|
-
break;
|
60
|
-
}
|
53
|
+
while (1) switch (_context.prev = _context.next) {
|
54
|
+
case 0:
|
55
|
+
this.resetData();
|
61
56
|
|
62
|
-
|
57
|
+
if (!(!this.isEnabled() || this.topo.isEditMode())) {
|
58
|
+
_context.next = 3;
|
59
|
+
break;
|
60
|
+
}
|
63
61
|
|
64
|
-
|
65
|
-
nodeCount = this.topo.dataModel.getNodes().length;
|
62
|
+
return _context.abrupt("return");
|
66
63
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
64
|
+
case 3:
|
65
|
+
nodeCount = this.topo.dataModel.getNodes().length;
|
66
|
+
|
67
|
+
if (nodeCount < 1500) {
|
68
|
+
this.doOpen();
|
69
|
+
} else {
|
70
|
+
this.confirmOpenWhenLargeResource(function () {
|
71
|
+
_this.doOpen();
|
72
|
+
});
|
73
|
+
}
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
}
|
75
|
+
case 5:
|
76
|
+
case "end":
|
77
|
+
return _context.stop();
|
79
78
|
}
|
80
79
|
}, _callee, this);
|
81
|
-
}));
|
82
|
-
|
83
|
-
function open() {
|
84
|
-
return _open.apply(this, arguments);
|
85
|
-
}
|
86
|
-
|
87
|
-
return open;
|
88
|
-
}();
|
80
|
+
}))).apply(this, arguments);
|
81
|
+
};
|
89
82
|
|
90
83
|
_proto.doOpen = function doOpen() {
|
91
84
|
// 获得拓扑id
|
@@ -191,195 +184,159 @@ var Alarm = /*#__PURE__*/function () {
|
|
191
184
|
};
|
192
185
|
};
|
193
186
|
|
194
|
-
_proto.hmGetTopoAlarmByDoc =
|
195
|
-
|
187
|
+
_proto.hmGetTopoAlarmByDoc = function hmGetTopoAlarmByDoc(_x) {
|
188
|
+
return (_hmGetTopoAlarmByDoc = _hmGetTopoAlarmByDoc || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
|
196
189
|
var result, alarms, state, _this$topo$store$getM, alarmListDefaultOpen;
|
197
190
|
|
198
191
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
199
|
-
while (1) {
|
200
|
-
|
201
|
-
|
202
|
-
result = this.getAlarms();
|
192
|
+
while (1) switch (_context2.prev = _context2.next) {
|
193
|
+
case 0:
|
194
|
+
result = this.getAlarms();
|
203
195
|
|
204
|
-
|
196
|
+
_rlog["default"].debug('hmGetTopoAlarmByDoc', result);
|
205
197
|
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
198
|
+
alarms = result.map(function (item) {
|
199
|
+
return item.obj;
|
200
|
+
});
|
201
|
+
state = {
|
202
|
+
alarmData: alarms.length > 0 ? alarms : []
|
203
|
+
};
|
204
|
+
_this$topo$store$getM = this.topo.store.getModelState('displayConfig'), alarmListDefaultOpen = _this$topo$store$getM.alarmListDefaultOpen;
|
213
205
|
|
214
|
-
|
215
|
-
|
216
|
-
|
206
|
+
if (alarmListDefaultOpen) {
|
207
|
+
state.alarmPanelIsOpen = alarms.length > 0;
|
208
|
+
}
|
217
209
|
|
218
|
-
|
210
|
+
this.updateState(state);
|
219
211
|
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
}
|
212
|
+
case 7:
|
213
|
+
case "end":
|
214
|
+
return _context2.stop();
|
224
215
|
}
|
225
216
|
}, _callee2, this);
|
226
|
-
}));
|
227
|
-
|
228
|
-
function hmGetTopoAlarmByDoc(_x) {
|
229
|
-
return _hmGetTopoAlarmByDoc.apply(this, arguments);
|
230
|
-
}
|
231
|
-
|
232
|
-
return hmGetTopoAlarmByDoc;
|
233
|
-
}();
|
217
|
+
}))).apply(this, arguments);
|
218
|
+
};
|
234
219
|
|
235
|
-
_proto.hmGetTopoAlarm =
|
236
|
-
|
220
|
+
_proto.hmGetTopoAlarm = function hmGetTopoAlarm(_x2) {
|
221
|
+
return (_hmGetTopoAlarm = _hmGetTopoAlarm || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(id) {
|
237
222
|
var mainCiIdList, endTime, startTime, parms, result;
|
238
223
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
239
|
-
while (1) {
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
224
|
+
while (1) switch (_context3.prev = _context3.next) {
|
225
|
+
case 0:
|
226
|
+
mainCiIdList = this.topo.dataModel.getDatas().filter(function (ci) {
|
227
|
+
return !!ci.operation;
|
228
|
+
}) // 过滤掉权限
|
229
|
+
.map(function (ci) {
|
230
|
+
return ci.id;
|
231
|
+
});
|
232
|
+
|
233
|
+
if (!(mainCiIdList.length === 0)) {
|
234
|
+
_context3.next = 4;
|
235
|
+
break;
|
236
|
+
}
|
237
|
+
|
238
|
+
this.updateState({
|
239
|
+
alarmData: [],
|
240
|
+
alarmPanelIsOpen: false
|
241
|
+
});
|
242
|
+
return _context3.abrupt("return");
|
243
|
+
|
244
|
+
case 4:
|
245
|
+
//rlog.debug("获取告警列表", mainCiIdList);
|
246
|
+
endTime = null; // new Date().valueOf();
|
247
|
+
|
248
|
+
startTime = null; // moment().subtract(1, "months").valueOf();
|
249
|
+
|
250
|
+
parms = {
|
251
|
+
mainCiIdList: mainCiIdList,
|
252
|
+
alertStatusList: ['toDeal', 'dealing'],
|
253
|
+
pageNum: 1,
|
254
|
+
pageSize: 10,
|
255
|
+
sortField: 'alertLevel',
|
256
|
+
alertLevelList: [],
|
257
|
+
orders: [{
|
258
|
+
property: 'alertLevel',
|
259
|
+
direction: 'ASC'
|
260
|
+
}, {
|
261
|
+
property: 'createTime',
|
262
|
+
direction: 'DESC'
|
263
|
+
}],
|
264
|
+
createTime: {
|
265
|
+
startTime: startTime,
|
266
|
+
endTime: endTime
|
252
267
|
}
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
orders: [{
|
274
|
-
property: 'alertLevel',
|
275
|
-
direction: 'ASC'
|
276
|
-
}, {
|
277
|
-
property: 'createTime',
|
278
|
-
direction: 'DESC'
|
279
|
-
}],
|
280
|
-
createTime: {
|
281
|
-
startTime: startTime,
|
282
|
-
endTime: endTime
|
283
|
-
}
|
284
|
-
};
|
285
|
-
_context3.next = 9;
|
286
|
-
return _topo["default"].getAlarmByIds(parms);
|
287
|
-
|
288
|
-
case 9:
|
289
|
-
result = _context3.sent;
|
290
|
-
|
291
|
-
_rlog["default"].debug('getAlarmById-result', result); // if (alarmIsOpened) {
|
292
|
-
// //this.topo.loadAlarm(result.datas);
|
293
|
-
// this.handleAlarmEvent({ type: "alarm", data: result.datas });
|
294
|
-
// }
|
295
|
-
// this.updateState({
|
296
|
-
// alarmData: result.datas.length > 0 ? result.datas : [],
|
297
|
-
// alarmPanelIsOpen: result.datas.length > 0,
|
298
|
-
// });
|
299
|
-
|
300
|
-
|
301
|
-
case 11:
|
302
|
-
case "end":
|
303
|
-
return _context3.stop();
|
304
|
-
}
|
268
|
+
};
|
269
|
+
_context3.next = 9;
|
270
|
+
return _topo["default"].getAlarmByIds(parms);
|
271
|
+
|
272
|
+
case 9:
|
273
|
+
result = _context3.sent;
|
274
|
+
|
275
|
+
_rlog["default"].debug('getAlarmById-result', result); // if (alarmIsOpened) {
|
276
|
+
// //this.topo.loadAlarm(result.datas);
|
277
|
+
// this.handleAlarmEvent({ type: "alarm", data: result.datas });
|
278
|
+
// }
|
279
|
+
// this.updateState({
|
280
|
+
// alarmData: result.datas.length > 0 ? result.datas : [],
|
281
|
+
// alarmPanelIsOpen: result.datas.length > 0,
|
282
|
+
// });
|
283
|
+
|
284
|
+
|
285
|
+
case 11:
|
286
|
+
case "end":
|
287
|
+
return _context3.stop();
|
305
288
|
}
|
306
289
|
}, _callee3, this);
|
307
|
-
}));
|
308
|
-
|
309
|
-
function hmGetTopoAlarm(_x2) {
|
310
|
-
return _hmGetTopoAlarm.apply(this, arguments);
|
311
|
-
}
|
312
|
-
|
313
|
-
return hmGetTopoAlarm;
|
314
|
-
}()
|
290
|
+
}))).apply(this, arguments);
|
291
|
+
}
|
315
292
|
/**
|
316
293
|
* 直接装载告警数据(可装载mock列表)
|
317
294
|
*
|
318
295
|
*/
|
319
296
|
;
|
320
297
|
|
321
|
-
_proto.setAlarmDataByMock =
|
322
|
-
|
323
|
-
function () {
|
324
|
-
var _setAlarmDataByMock = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(datas) {
|
298
|
+
_proto.setAlarmDataByMock = function setAlarmDataByMock(_x3) {
|
299
|
+
return (_setAlarmDataByMock = _setAlarmDataByMock || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(datas) {
|
325
300
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
326
|
-
while (1) {
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
return _context4.stop();
|
337
|
-
}
|
301
|
+
while (1) switch (_context4.prev = _context4.next) {
|
302
|
+
case 0:
|
303
|
+
this.updateState({
|
304
|
+
alarmData: datas.length > 0 ? datas : [],
|
305
|
+
alarmPanelIsOpen: datas.length > 0
|
306
|
+
});
|
307
|
+
|
308
|
+
case 1:
|
309
|
+
case "end":
|
310
|
+
return _context4.stop();
|
338
311
|
}
|
339
312
|
}, _callee4, this);
|
340
|
-
}));
|
341
|
-
|
342
|
-
function setAlarmDataByMock(_x3) {
|
343
|
-
return _setAlarmDataByMock.apply(this, arguments);
|
344
|
-
}
|
345
|
-
|
346
|
-
return setAlarmDataByMock;
|
347
|
-
}()
|
313
|
+
}))).apply(this, arguments);
|
314
|
+
}
|
348
315
|
/**
|
349
316
|
* 打开\关闭告警列表弹窗
|
350
317
|
*
|
351
318
|
*/
|
352
319
|
;
|
353
320
|
|
354
|
-
_proto.switchAlarmPopPanel =
|
355
|
-
|
356
|
-
function () {
|
357
|
-
var _switchAlarmPopPanel = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(flag) {
|
321
|
+
_proto.switchAlarmPopPanel = function switchAlarmPopPanel(_x4) {
|
322
|
+
return (_switchAlarmPopPanel = _switchAlarmPopPanel || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(flag) {
|
358
323
|
var topoDispatchers;
|
359
324
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
360
|
-
while (1) {
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
return _context5.stop();
|
372
|
-
}
|
325
|
+
while (1) switch (_context5.prev = _context5.next) {
|
326
|
+
case 0:
|
327
|
+
// console.log("switchAlarmPopPanel", flag);
|
328
|
+
topoDispatchers = this.topo.store.getModelDispatchers('topoAlarm');
|
329
|
+
topoDispatchers.update({
|
330
|
+
alarmPanelIsOpen: flag
|
331
|
+
});
|
332
|
+
|
333
|
+
case 2:
|
334
|
+
case "end":
|
335
|
+
return _context5.stop();
|
373
336
|
}
|
374
337
|
}, _callee5, this);
|
375
|
-
}));
|
376
|
-
|
377
|
-
function switchAlarmPopPanel(_x4) {
|
378
|
-
return _switchAlarmPopPanel.apply(this, arguments);
|
379
|
-
}
|
380
|
-
|
381
|
-
return switchAlarmPopPanel;
|
382
|
-
}()
|
338
|
+
}))).apply(this, arguments);
|
339
|
+
}
|
383
340
|
/**
|
384
341
|
* 打开告警推送。
|
385
342
|
*
|
@@ -387,76 +344,66 @@ var Alarm = /*#__PURE__*/function () {
|
|
387
344
|
*/
|
388
345
|
;
|
389
346
|
|
390
|
-
_proto.openTopoAlarm =
|
391
|
-
|
392
|
-
function () {
|
393
|
-
var _openTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(id) {
|
347
|
+
_proto.openTopoAlarm = function openTopoAlarm(_x5) {
|
348
|
+
return (_openTopoAlarm = _openTopoAlarm || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(id) {
|
394
349
|
var _this$getState2, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
|
395
350
|
|
396
351
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
397
|
-
while (1) {
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
_this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
|
402
|
-
|
403
|
-
if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
|
404
|
-
_context6.next = 3;
|
405
|
-
break;
|
406
|
-
}
|
352
|
+
while (1) switch (_context6.prev = _context6.next) {
|
353
|
+
case 0:
|
354
|
+
// 如果当前拓扑图开启中或已开启则退出
|
355
|
+
_this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
|
407
356
|
|
408
|
-
|
357
|
+
if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
|
358
|
+
_context6.next = 3;
|
359
|
+
break;
|
360
|
+
}
|
409
361
|
|
410
|
-
|
411
|
-
this.currentTopoId = id;
|
412
|
-
this.updateState({
|
413
|
-
alarmOpening: true
|
414
|
-
});
|
415
|
-
alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm');
|
416
|
-
_context6.next = 8;
|
417
|
-
return alarmDispatchers.resetAlarmDoc();
|
362
|
+
return _context6.abrupt("return");
|
418
363
|
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
364
|
+
case 3:
|
365
|
+
this.currentTopoId = id;
|
366
|
+
this.updateState({
|
367
|
+
alarmOpening: true
|
368
|
+
});
|
369
|
+
alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm');
|
370
|
+
_context6.next = 8;
|
371
|
+
return alarmDispatchers.resetAlarmDoc();
|
423
372
|
|
424
|
-
|
425
|
-
|
373
|
+
case 8:
|
374
|
+
_context6.prev = 8;
|
375
|
+
_context6.next = 11;
|
376
|
+
return this.topo.serverApi.openTopoAlarm(id);
|
426
377
|
|
427
|
-
|
378
|
+
case 11:
|
379
|
+
this.secretKey = _context6.sent;
|
428
380
|
|
429
|
-
|
430
|
-
alarmOpening: false,
|
431
|
-
alarmIsOpened: true
|
432
|
-
});
|
433
|
-
_context6.next = 20;
|
434
|
-
break;
|
381
|
+
_rlog["default"].info('openTopoAlarm 打开拓扑告警推送-------------------开始');
|
435
382
|
|
436
|
-
|
437
|
-
|
438
|
-
|
383
|
+
this.updateState({
|
384
|
+
alarmOpening: false,
|
385
|
+
alarmIsOpened: true
|
386
|
+
});
|
387
|
+
_context6.next = 20;
|
388
|
+
break;
|
439
389
|
|
440
|
-
|
390
|
+
case 16:
|
391
|
+
_context6.prev = 16;
|
392
|
+
_context6.t0 = _context6["catch"](8);
|
441
393
|
|
442
|
-
|
443
|
-
|
444
|
-
|
394
|
+
_rlog["default"].error('打开拓扑告警推送 失败');
|
395
|
+
|
396
|
+
this.updateState({
|
397
|
+
alarmOpening: false
|
398
|
+
});
|
445
399
|
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
}
|
400
|
+
case 20:
|
401
|
+
case "end":
|
402
|
+
return _context6.stop();
|
450
403
|
}
|
451
404
|
}, _callee6, this, [[8, 16]]);
|
452
|
-
}));
|
453
|
-
|
454
|
-
function openTopoAlarm(_x5) {
|
455
|
-
return _openTopoAlarm.apply(this, arguments);
|
456
|
-
}
|
457
|
-
|
458
|
-
return openTopoAlarm;
|
459
|
-
}()
|
405
|
+
}))).apply(this, arguments);
|
406
|
+
}
|
460
407
|
/**
|
461
408
|
* 关闭告警推送。
|
462
409
|
*
|
@@ -464,53 +411,43 @@ var Alarm = /*#__PURE__*/function () {
|
|
464
411
|
*/
|
465
412
|
;
|
466
413
|
|
467
|
-
_proto.closeTopoAlarm =
|
468
|
-
|
469
|
-
function () {
|
470
|
-
var _closeTopoAlarm = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id) {
|
414
|
+
_proto.closeTopoAlarm = function closeTopoAlarm(_x6) {
|
415
|
+
return (_closeTopoAlarm = _closeTopoAlarm || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(id) {
|
471
416
|
var _this$getState3, alarmIsOpened, alarmOpening;
|
472
417
|
|
473
418
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
474
|
-
while (1) {
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
_this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
|
479
|
-
|
480
|
-
if (!(!alarmIsOpened && !alarmOpening)) {
|
481
|
-
_context7.next = 3;
|
482
|
-
break;
|
483
|
-
}
|
419
|
+
while (1) switch (_context7.prev = _context7.next) {
|
420
|
+
case 0:
|
421
|
+
// 如果未开启则退出
|
422
|
+
_this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
|
484
423
|
|
485
|
-
|
424
|
+
if (!(!alarmIsOpened && !alarmOpening)) {
|
425
|
+
_context7.next = 3;
|
426
|
+
break;
|
427
|
+
}
|
486
428
|
|
487
|
-
|
488
|
-
this.currentTopoId = null;
|
429
|
+
return _context7.abrupt("return");
|
489
430
|
|
490
|
-
|
431
|
+
case 3:
|
432
|
+
this.currentTopoId = null;
|
491
433
|
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
434
|
+
_rlog["default"].debug('useAlarm.useEffect 告警WebSocket 结束');
|
435
|
+
|
436
|
+
this.updateState({
|
437
|
+
topoAlarmIsOpen: false,
|
438
|
+
alarmOpening: false,
|
439
|
+
alarmPanelIsOpen: false
|
440
|
+
});
|
441
|
+
_context7.next = 8;
|
442
|
+
return this.topo.serverApi.closeTopoAlarm(id, this.secretKey);
|
499
443
|
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
}
|
444
|
+
case 8:
|
445
|
+
case "end":
|
446
|
+
return _context7.stop();
|
504
447
|
}
|
505
448
|
}, _callee7, this);
|
506
|
-
}));
|
507
|
-
|
508
|
-
function closeTopoAlarm(_x6) {
|
509
|
-
return _closeTopoAlarm.apply(this, arguments);
|
510
|
-
}
|
511
|
-
|
512
|
-
return closeTopoAlarm;
|
513
|
-
}()
|
449
|
+
}))).apply(this, arguments);
|
450
|
+
}
|
514
451
|
/**
|
515
452
|
* 打开\关闭告警列表弹窗
|
516
453
|
*
|
@@ -527,144 +464,124 @@ var Alarm = /*#__PURE__*/function () {
|
|
527
464
|
*/
|
528
465
|
;
|
529
466
|
|
530
|
-
_proto.restart =
|
531
|
-
|
532
|
-
function () {
|
533
|
-
var _restart = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
467
|
+
_proto.restart = function restart() {
|
468
|
+
return (_restart = _restart || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
534
469
|
var id;
|
535
470
|
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
536
|
-
while (1) {
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
return _context8.stop();
|
546
|
-
}
|
471
|
+
while (1) switch (_context8.prev = _context8.next) {
|
472
|
+
case 0:
|
473
|
+
id = this.currentTopoId;
|
474
|
+
_context8.next = 3;
|
475
|
+
return this.openTopoAlarm(id);
|
476
|
+
|
477
|
+
case 3:
|
478
|
+
case "end":
|
479
|
+
return _context8.stop();
|
547
480
|
}
|
548
481
|
}, _callee8, this);
|
549
|
-
}));
|
550
|
-
|
551
|
-
function restart() {
|
552
|
-
return _restart.apply(this, arguments);
|
553
|
-
}
|
554
|
-
|
555
|
-
return restart;
|
556
|
-
}()
|
482
|
+
}))).apply(this, arguments);
|
483
|
+
}
|
557
484
|
/**
|
558
485
|
* 处理告警推送事件
|
559
486
|
*/
|
560
487
|
;
|
561
488
|
|
562
|
-
_proto.handleAlarmEvent =
|
563
|
-
|
564
|
-
|
565
|
-
var _handleAlarmEvent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(alertData) {
|
566
|
-
var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
|
489
|
+
_proto.handleAlarmEvent = function handleAlarmEvent(_x7) {
|
490
|
+
return (_handleAlarmEvent = _handleAlarmEvent || (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(alertData) {
|
491
|
+
var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche2, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
|
567
492
|
|
568
493
|
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
569
|
-
while (1) {
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
494
|
+
while (1) switch (_context9.prev = _context9.next) {
|
495
|
+
case 0:
|
496
|
+
_this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
|
497
|
+
resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
|
498
|
+
resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
|
499
|
+
alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm'); // 添加事件
|
500
|
+
// console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
|
501
|
+
|
502
|
+
if (!((0, _utils.isAvailableArray)(alertData) && (0, _utils.isAvailableArray)(resIdsList))) {
|
503
|
+
_context9.next = 24;
|
504
|
+
break;
|
505
|
+
}
|
506
|
+
|
507
|
+
sendAl = [];
|
508
|
+
idsList = [].concat(nodeIdsList, linkIdsList);
|
509
|
+
operations = [];
|
510
|
+
idsList.forEach(function (idItem) {
|
511
|
+
if (idItem.operation === null) {
|
512
|
+
operations.push(idItem.ciId);
|
581
513
|
}
|
514
|
+
});
|
515
|
+
alertData.forEach(function (item, index) {
|
516
|
+
var _item$resourceId;
|
517
|
+
|
518
|
+
var ciId = (_item$resourceId = item.resourceId) !== null && _item$resourceId !== void 0 ? _item$resourceId : item.ciId;
|
519
|
+
var obj = {
|
520
|
+
id: ciId,
|
521
|
+
level: item.alertLevel,
|
522
|
+
alertId: item.alertId,
|
523
|
+
status: item.status,
|
524
|
+
obj: item,
|
525
|
+
info: item.alertType,
|
526
|
+
ciCode: item === null || item === void 0 ? void 0 : item.ciCode,
|
527
|
+
ruleId: item === null || item === void 0 ? void 0 : item.ruleId
|
528
|
+
};
|
582
529
|
|
583
|
-
|
584
|
-
|
585
|
-
operations = [];
|
586
|
-
idsList.forEach(function (idItem) {
|
587
|
-
if (idItem.operation === null) {
|
588
|
-
operations.push(idItem.ciId);
|
589
|
-
}
|
590
|
-
});
|
591
|
-
alertData.forEach(function (item, index) {
|
592
|
-
var _item$resourceId;
|
593
|
-
|
594
|
-
var ciId = (_item$resourceId = item.resourceId) !== null && _item$resourceId !== void 0 ? _item$resourceId : item.ciId;
|
595
|
-
var obj = {
|
596
|
-
id: ciId,
|
597
|
-
level: item.alertLevel,
|
598
|
-
alertId: item.alertId,
|
599
|
-
status: item.status,
|
600
|
-
obj: item,
|
601
|
-
info: item.alertType,
|
602
|
-
ciCode: item === null || item === void 0 ? void 0 : item.ciCode,
|
603
|
-
ruleId: item === null || item === void 0 ? void 0 : item.ruleId
|
604
|
-
};
|
605
|
-
|
606
|
-
if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
|
607
|
-
sendAl.push(obj);
|
608
|
-
}
|
609
|
-
}); // console.log("before-combAlarmData", sendAl, idsList);
|
610
|
-
|
611
|
-
if (!(sendAl.length > 0)) {
|
612
|
-
_context9.next = 24;
|
613
|
-
break;
|
530
|
+
if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
|
531
|
+
sendAl.push(obj);
|
614
532
|
}
|
533
|
+
}); // console.log("before-combAlarmData", sendAl, idsList);
|
615
534
|
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
535
|
+
if (!(sendAl.length > 0)) {
|
536
|
+
_context9.next = 24;
|
537
|
+
break;
|
538
|
+
}
|
539
|
+
|
540
|
+
_rlog["default"].debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
|
541
|
+
|
542
|
+
_context9.prev = 12;
|
543
|
+
_context9.next = 15;
|
544
|
+
return alarmDispatchers.combAlarmData({
|
545
|
+
alarmdata: sendAl
|
546
|
+
});
|
547
|
+
|
548
|
+
case 15:
|
549
|
+
_yield$alarmDispatche2 = _context9.sent;
|
550
|
+
eqFlag = _yield$alarmDispatche2.eqFlag;
|
551
|
+
alarmlist = _yield$alarmDispatche2.alarmlist;
|
552
|
+
|
553
|
+
// console.log("handleAlarmEvent", alarmIsOpened,eqFlag);
|
554
|
+
// console.log("handleAlarmEvent-topo.viewProps", this.topo.viewProps);
|
555
|
+
if (alarmIsOpened) {
|
556
|
+
this.hmGetTopoAlarmByDoc(); // 通知所有告警
|
557
|
+
|
558
|
+
if ((_this$topo$viewProps = this.topo.viewProps) !== null && _this$topo$viewProps !== void 0 && _this$topo$viewProps.onAlarm) {
|
559
|
+
this.topo.viewProps.onAlarm(this.getAlarms().map(function (item) {
|
560
|
+
return item.obj;
|
561
|
+
}));
|
562
|
+
}
|
623
563
|
|
624
|
-
|
625
|
-
|
626
|
-
eqFlag = _yield$alarmDispatche.eqFlag;
|
627
|
-
alarmlist = _yield$alarmDispatche.alarmlist;
|
628
|
-
|
629
|
-
// console.log("handleAlarmEvent", alarmIsOpened,eqFlag);
|
630
|
-
// console.log("handleAlarmEvent-topo.viewProps", this.topo.viewProps);
|
631
|
-
if (alarmIsOpened) {
|
632
|
-
this.hmGetTopoAlarmByDoc(); // 通知所有告警
|
633
|
-
|
634
|
-
if ((_this$topo$viewProps = this.topo.viewProps) !== null && _this$topo$viewProps !== void 0 && _this$topo$viewProps.onAlarm) {
|
635
|
-
this.topo.viewProps.onAlarm(this.getAlarms().map(function (item) {
|
636
|
-
return item.obj;
|
637
|
-
}));
|
638
|
-
}
|
639
|
-
|
640
|
-
if ((_this$topo$viewProps2 = this.topo.viewProps) !== null && _this$topo$viewProps2 !== void 0 && _this$topo$viewProps2.onResourceEvent) {
|
641
|
-
this.topo.viewProps.onResourceEvent(this.getEvents());
|
642
|
-
}
|
564
|
+
if ((_this$topo$viewProps2 = this.topo.viewProps) !== null && _this$topo$viewProps2 !== void 0 && _this$topo$viewProps2.onResourceEvent) {
|
565
|
+
this.topo.viewProps.onResourceEvent(this.getEvents());
|
643
566
|
}
|
567
|
+
}
|
644
568
|
|
645
|
-
|
646
|
-
|
569
|
+
_context9.next = 24;
|
570
|
+
break;
|
647
571
|
|
648
|
-
|
649
|
-
|
650
|
-
|
572
|
+
case 21:
|
573
|
+
_context9.prev = 21;
|
574
|
+
_context9.t0 = _context9["catch"](12);
|
651
575
|
|
652
|
-
|
576
|
+
_rlog["default"].error('告警发送异常', _context9.t0);
|
653
577
|
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
}
|
578
|
+
case 24:
|
579
|
+
case "end":
|
580
|
+
return _context9.stop();
|
658
581
|
}
|
659
582
|
}, _callee9, this, [[12, 21]]);
|
660
|
-
}));
|
661
|
-
|
662
|
-
function handleAlarmEvent(_x7) {
|
663
|
-
return _handleAlarmEvent.apply(this, arguments);
|
664
|
-
}
|
665
|
-
|
666
|
-
return handleAlarmEvent;
|
667
|
-
}();
|
583
|
+
}))).apply(this, arguments);
|
584
|
+
};
|
668
585
|
|
669
586
|
_proto.getState = function getState() {
|
670
587
|
return this.topo.store.getModelState('topoAlarm');
|