@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/es/core/models/Alarm.js
CHANGED
@@ -6,9 +6,12 @@ import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
6
6
|
import { isAvailableArray } from '@riil-frontend/utils';
|
7
7
|
|
8
8
|
var Alarm = /*#__PURE__*/function () {
|
9
|
+
var _open, _hmGetTopoAlarmByDoc, _hmGetTopoAlarm, _setAlarmDataByMock, _switchAlarmPopPanel, _openTopoAlarm, _closeTopoAlarm, _restart, _handleAlarmEvent;
|
10
|
+
|
9
11
|
function Alarm() {
|
10
12
|
this.topo = void 0;
|
11
13
|
this.currentTopoId = void 0;
|
14
|
+
// 告警通道id
|
12
15
|
this.secretKey = null;
|
13
16
|
this.alarmSwitch = true;
|
14
17
|
}
|
@@ -29,51 +32,41 @@ var Alarm = /*#__PURE__*/function () {
|
|
29
32
|
*/
|
30
33
|
;
|
31
34
|
|
32
|
-
_proto.open =
|
33
|
-
|
34
|
-
function () {
|
35
|
-
var _open = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
35
|
+
_proto.open = function open() {
|
36
|
+
return (_open = _open || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
36
37
|
var _this = this;
|
37
38
|
|
38
39
|
var nodeCount;
|
39
40
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
40
|
-
while (1) {
|
41
|
-
|
42
|
-
|
43
|
-
this.resetData();
|
44
|
-
|
45
|
-
if (!(!this.isEnabled() || this.topo.isEditMode())) {
|
46
|
-
_context.next = 3;
|
47
|
-
break;
|
48
|
-
}
|
41
|
+
while (1) switch (_context.prev = _context.next) {
|
42
|
+
case 0:
|
43
|
+
this.resetData();
|
49
44
|
|
50
|
-
|
45
|
+
if (!(!this.isEnabled() || this.topo.isEditMode())) {
|
46
|
+
_context.next = 3;
|
47
|
+
break;
|
48
|
+
}
|
51
49
|
|
52
|
-
|
53
|
-
nodeCount = this.topo.dataModel.getNodes().length;
|
50
|
+
return _context.abrupt("return");
|
54
51
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
52
|
+
case 3:
|
53
|
+
nodeCount = this.topo.dataModel.getNodes().length;
|
54
|
+
|
55
|
+
if (nodeCount < 1500) {
|
56
|
+
this.doOpen();
|
57
|
+
} else {
|
58
|
+
this.confirmOpenWhenLargeResource(function () {
|
59
|
+
_this.doOpen();
|
60
|
+
});
|
61
|
+
}
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
}
|
63
|
+
case 5:
|
64
|
+
case "end":
|
65
|
+
return _context.stop();
|
67
66
|
}
|
68
67
|
}, _callee, this);
|
69
|
-
}));
|
70
|
-
|
71
|
-
function open() {
|
72
|
-
return _open.apply(this, arguments);
|
73
|
-
}
|
74
|
-
|
75
|
-
return open;
|
76
|
-
}();
|
68
|
+
}))).apply(this, arguments);
|
69
|
+
};
|
77
70
|
|
78
71
|
_proto.doOpen = function doOpen() {
|
79
72
|
// 获得拓扑id
|
@@ -177,191 +170,155 @@ var Alarm = /*#__PURE__*/function () {
|
|
177
170
|
};
|
178
171
|
};
|
179
172
|
|
180
|
-
_proto.hmGetTopoAlarmByDoc =
|
181
|
-
|
173
|
+
_proto.hmGetTopoAlarmByDoc = function hmGetTopoAlarmByDoc(_x) {
|
174
|
+
return (_hmGetTopoAlarmByDoc = _hmGetTopoAlarmByDoc || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
|
182
175
|
var result, alarms, state, _this$topo$store$getM, alarmListDefaultOpen;
|
183
176
|
|
184
177
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
185
|
-
while (1) {
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
return _context2.stop();
|
207
|
-
}
|
178
|
+
while (1) switch (_context2.prev = _context2.next) {
|
179
|
+
case 0:
|
180
|
+
result = this.getAlarms();
|
181
|
+
rlog.debug('hmGetTopoAlarmByDoc', result);
|
182
|
+
alarms = result.map(function (item) {
|
183
|
+
return item.obj;
|
184
|
+
});
|
185
|
+
state = {
|
186
|
+
alarmData: alarms.length > 0 ? alarms : []
|
187
|
+
};
|
188
|
+
_this$topo$store$getM = this.topo.store.getModelState('displayConfig'), alarmListDefaultOpen = _this$topo$store$getM.alarmListDefaultOpen;
|
189
|
+
|
190
|
+
if (alarmListDefaultOpen) {
|
191
|
+
state.alarmPanelIsOpen = alarms.length > 0;
|
192
|
+
}
|
193
|
+
|
194
|
+
this.updateState(state);
|
195
|
+
|
196
|
+
case 7:
|
197
|
+
case "end":
|
198
|
+
return _context2.stop();
|
208
199
|
}
|
209
200
|
}, _callee2, this);
|
210
|
-
}));
|
211
|
-
|
212
|
-
function hmGetTopoAlarmByDoc(_x) {
|
213
|
-
return _hmGetTopoAlarmByDoc.apply(this, arguments);
|
214
|
-
}
|
215
|
-
|
216
|
-
return hmGetTopoAlarmByDoc;
|
217
|
-
}();
|
201
|
+
}))).apply(this, arguments);
|
202
|
+
};
|
218
203
|
|
219
|
-
_proto.hmGetTopoAlarm =
|
220
|
-
|
204
|
+
_proto.hmGetTopoAlarm = function hmGetTopoAlarm(_x2) {
|
205
|
+
return (_hmGetTopoAlarm = _hmGetTopoAlarm || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
|
221
206
|
var mainCiIdList, endTime, startTime, parms, result;
|
222
207
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
223
|
-
while (1) {
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
208
|
+
while (1) switch (_context3.prev = _context3.next) {
|
209
|
+
case 0:
|
210
|
+
mainCiIdList = this.topo.dataModel.getDatas().filter(function (ci) {
|
211
|
+
return !!ci.operation;
|
212
|
+
}) // 过滤掉权限
|
213
|
+
.map(function (ci) {
|
214
|
+
return ci.id;
|
215
|
+
});
|
216
|
+
|
217
|
+
if (!(mainCiIdList.length === 0)) {
|
218
|
+
_context3.next = 4;
|
219
|
+
break;
|
220
|
+
}
|
221
|
+
|
222
|
+
this.updateState({
|
223
|
+
alarmData: [],
|
224
|
+
alarmPanelIsOpen: false
|
225
|
+
});
|
226
|
+
return _context3.abrupt("return");
|
227
|
+
|
228
|
+
case 4:
|
229
|
+
//rlog.debug("获取告警列表", mainCiIdList);
|
230
|
+
endTime = null; // new Date().valueOf();
|
231
|
+
|
232
|
+
startTime = null; // moment().subtract(1, "months").valueOf();
|
233
|
+
|
234
|
+
parms = {
|
235
|
+
mainCiIdList: mainCiIdList,
|
236
|
+
alertStatusList: ['toDeal', 'dealing'],
|
237
|
+
pageNum: 1,
|
238
|
+
pageSize: 10,
|
239
|
+
sortField: 'alertLevel',
|
240
|
+
alertLevelList: [],
|
241
|
+
orders: [{
|
242
|
+
property: 'alertLevel',
|
243
|
+
direction: 'ASC'
|
244
|
+
}, {
|
245
|
+
property: 'createTime',
|
246
|
+
direction: 'DESC'
|
247
|
+
}],
|
248
|
+
createTime: {
|
249
|
+
startTime: startTime,
|
250
|
+
endTime: endTime
|
236
251
|
}
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
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
|
267
|
-
}
|
268
|
-
};
|
269
|
-
_context3.next = 9;
|
270
|
-
return topoService.getAlarmByIds(parms);
|
271
|
-
|
272
|
-
case 9:
|
273
|
-
result = _context3.sent;
|
274
|
-
rlog.debug('getAlarmById-result', result); // if (alarmIsOpened) {
|
275
|
-
// //this.topo.loadAlarm(result.datas);
|
276
|
-
// this.handleAlarmEvent({ type: "alarm", data: result.datas });
|
277
|
-
// }
|
278
|
-
// this.updateState({
|
279
|
-
// alarmData: result.datas.length > 0 ? result.datas : [],
|
280
|
-
// alarmPanelIsOpen: result.datas.length > 0,
|
281
|
-
// });
|
282
|
-
|
283
|
-
case 11:
|
284
|
-
case "end":
|
285
|
-
return _context3.stop();
|
286
|
-
}
|
252
|
+
};
|
253
|
+
_context3.next = 9;
|
254
|
+
return topoService.getAlarmByIds(parms);
|
255
|
+
|
256
|
+
case 9:
|
257
|
+
result = _context3.sent;
|
258
|
+
rlog.debug('getAlarmById-result', result); // if (alarmIsOpened) {
|
259
|
+
// //this.topo.loadAlarm(result.datas);
|
260
|
+
// this.handleAlarmEvent({ type: "alarm", data: result.datas });
|
261
|
+
// }
|
262
|
+
// this.updateState({
|
263
|
+
// alarmData: result.datas.length > 0 ? result.datas : [],
|
264
|
+
// alarmPanelIsOpen: result.datas.length > 0,
|
265
|
+
// });
|
266
|
+
|
267
|
+
case 11:
|
268
|
+
case "end":
|
269
|
+
return _context3.stop();
|
287
270
|
}
|
288
271
|
}, _callee3, this);
|
289
|
-
}));
|
290
|
-
|
291
|
-
function hmGetTopoAlarm(_x2) {
|
292
|
-
return _hmGetTopoAlarm.apply(this, arguments);
|
293
|
-
}
|
294
|
-
|
295
|
-
return hmGetTopoAlarm;
|
296
|
-
}()
|
272
|
+
}))).apply(this, arguments);
|
273
|
+
}
|
297
274
|
/**
|
298
275
|
* 直接装载告警数据(可装载mock列表)
|
299
276
|
*
|
300
277
|
*/
|
301
278
|
;
|
302
279
|
|
303
|
-
_proto.setAlarmDataByMock =
|
304
|
-
|
305
|
-
function () {
|
306
|
-
var _setAlarmDataByMock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(datas) {
|
280
|
+
_proto.setAlarmDataByMock = function setAlarmDataByMock(_x3) {
|
281
|
+
return (_setAlarmDataByMock = _setAlarmDataByMock || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(datas) {
|
307
282
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
308
|
-
while (1) {
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
return _context4.stop();
|
319
|
-
}
|
283
|
+
while (1) switch (_context4.prev = _context4.next) {
|
284
|
+
case 0:
|
285
|
+
this.updateState({
|
286
|
+
alarmData: datas.length > 0 ? datas : [],
|
287
|
+
alarmPanelIsOpen: datas.length > 0
|
288
|
+
});
|
289
|
+
|
290
|
+
case 1:
|
291
|
+
case "end":
|
292
|
+
return _context4.stop();
|
320
293
|
}
|
321
294
|
}, _callee4, this);
|
322
|
-
}));
|
323
|
-
|
324
|
-
function setAlarmDataByMock(_x3) {
|
325
|
-
return _setAlarmDataByMock.apply(this, arguments);
|
326
|
-
}
|
327
|
-
|
328
|
-
return setAlarmDataByMock;
|
329
|
-
}()
|
295
|
+
}))).apply(this, arguments);
|
296
|
+
}
|
330
297
|
/**
|
331
298
|
* 打开\关闭告警列表弹窗
|
332
299
|
*
|
333
300
|
*/
|
334
301
|
;
|
335
302
|
|
336
|
-
_proto.switchAlarmPopPanel =
|
337
|
-
|
338
|
-
function () {
|
339
|
-
var _switchAlarmPopPanel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(flag) {
|
303
|
+
_proto.switchAlarmPopPanel = function switchAlarmPopPanel(_x4) {
|
304
|
+
return (_switchAlarmPopPanel = _switchAlarmPopPanel || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(flag) {
|
340
305
|
var topoDispatchers;
|
341
306
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
342
|
-
while (1) {
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
return _context5.stop();
|
354
|
-
}
|
307
|
+
while (1) switch (_context5.prev = _context5.next) {
|
308
|
+
case 0:
|
309
|
+
// console.log("switchAlarmPopPanel", flag);
|
310
|
+
topoDispatchers = this.topo.store.getModelDispatchers('topoAlarm');
|
311
|
+
topoDispatchers.update({
|
312
|
+
alarmPanelIsOpen: flag
|
313
|
+
});
|
314
|
+
|
315
|
+
case 2:
|
316
|
+
case "end":
|
317
|
+
return _context5.stop();
|
355
318
|
}
|
356
319
|
}, _callee5, this);
|
357
|
-
}));
|
358
|
-
|
359
|
-
function switchAlarmPopPanel(_x4) {
|
360
|
-
return _switchAlarmPopPanel.apply(this, arguments);
|
361
|
-
}
|
362
|
-
|
363
|
-
return switchAlarmPopPanel;
|
364
|
-
}()
|
320
|
+
}))).apply(this, arguments);
|
321
|
+
}
|
365
322
|
/**
|
366
323
|
* 打开告警推送。
|
367
324
|
*
|
@@ -369,72 +326,62 @@ var Alarm = /*#__PURE__*/function () {
|
|
369
326
|
*/
|
370
327
|
;
|
371
328
|
|
372
|
-
_proto.openTopoAlarm =
|
373
|
-
|
374
|
-
function () {
|
375
|
-
var _openTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
|
329
|
+
_proto.openTopoAlarm = function openTopoAlarm(_x5) {
|
330
|
+
return (_openTopoAlarm = _openTopoAlarm || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
|
376
331
|
var _this$getState2, alarmOpening, topoAlarmIsOpen, alarmDispatchers;
|
377
332
|
|
378
333
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
379
|
-
while (1) {
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
_this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
|
384
|
-
|
385
|
-
if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
|
386
|
-
_context6.next = 3;
|
387
|
-
break;
|
388
|
-
}
|
334
|
+
while (1) switch (_context6.prev = _context6.next) {
|
335
|
+
case 0:
|
336
|
+
// 如果当前拓扑图开启中或已开启则退出
|
337
|
+
_this$getState2 = this.getState(), alarmOpening = _this$getState2.alarmOpening, topoAlarmIsOpen = _this$getState2.topoAlarmIsOpen;
|
389
338
|
|
390
|
-
|
391
|
-
|
392
|
-
case 3:
|
393
|
-
this.currentTopoId = id;
|
394
|
-
this.updateState({
|
395
|
-
alarmOpening: true
|
396
|
-
});
|
397
|
-
alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm');
|
398
|
-
_context6.next = 8;
|
399
|
-
return alarmDispatchers.resetAlarmDoc();
|
400
|
-
|
401
|
-
case 8:
|
402
|
-
_context6.prev = 8;
|
403
|
-
_context6.next = 11;
|
404
|
-
return this.topo.serverApi.openTopoAlarm(id);
|
405
|
-
|
406
|
-
case 11:
|
407
|
-
this.secretKey = _context6.sent;
|
408
|
-
rlog.info('openTopoAlarm 打开拓扑告警推送-------------------开始');
|
409
|
-
this.updateState({
|
410
|
-
alarmOpening: false,
|
411
|
-
alarmIsOpened: true
|
412
|
-
});
|
413
|
-
_context6.next = 20;
|
339
|
+
if (!(this.currentTopoId === id && (topoAlarmIsOpen || alarmOpening))) {
|
340
|
+
_context6.next = 3;
|
414
341
|
break;
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
342
|
+
}
|
343
|
+
|
344
|
+
return _context6.abrupt("return");
|
345
|
+
|
346
|
+
case 3:
|
347
|
+
this.currentTopoId = id;
|
348
|
+
this.updateState({
|
349
|
+
alarmOpening: true
|
350
|
+
});
|
351
|
+
alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm');
|
352
|
+
_context6.next = 8;
|
353
|
+
return alarmDispatchers.resetAlarmDoc();
|
354
|
+
|
355
|
+
case 8:
|
356
|
+
_context6.prev = 8;
|
357
|
+
_context6.next = 11;
|
358
|
+
return this.topo.serverApi.openTopoAlarm(id);
|
359
|
+
|
360
|
+
case 11:
|
361
|
+
this.secretKey = _context6.sent;
|
362
|
+
rlog.info('openTopoAlarm 打开拓扑告警推送-------------------开始');
|
363
|
+
this.updateState({
|
364
|
+
alarmOpening: false,
|
365
|
+
alarmIsOpened: true
|
366
|
+
});
|
367
|
+
_context6.next = 20;
|
368
|
+
break;
|
369
|
+
|
370
|
+
case 16:
|
371
|
+
_context6.prev = 16;
|
372
|
+
_context6.t0 = _context6["catch"](8);
|
373
|
+
rlog.error('打开拓扑告警推送 失败');
|
374
|
+
this.updateState({
|
375
|
+
alarmOpening: false
|
376
|
+
});
|
377
|
+
|
378
|
+
case 20:
|
379
|
+
case "end":
|
380
|
+
return _context6.stop();
|
428
381
|
}
|
429
382
|
}, _callee6, this, [[8, 16]]);
|
430
|
-
}));
|
431
|
-
|
432
|
-
function openTopoAlarm(_x5) {
|
433
|
-
return _openTopoAlarm.apply(this, arguments);
|
434
|
-
}
|
435
|
-
|
436
|
-
return openTopoAlarm;
|
437
|
-
}()
|
383
|
+
}))).apply(this, arguments);
|
384
|
+
}
|
438
385
|
/**
|
439
386
|
* 关闭告警推送。
|
440
387
|
*
|
@@ -442,51 +389,41 @@ var Alarm = /*#__PURE__*/function () {
|
|
442
389
|
*/
|
443
390
|
;
|
444
391
|
|
445
|
-
_proto.closeTopoAlarm =
|
446
|
-
|
447
|
-
function () {
|
448
|
-
var _closeTopoAlarm = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
|
392
|
+
_proto.closeTopoAlarm = function closeTopoAlarm(_x6) {
|
393
|
+
return (_closeTopoAlarm = _closeTopoAlarm || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id) {
|
449
394
|
var _this$getState3, alarmIsOpened, alarmOpening;
|
450
395
|
|
451
396
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
452
|
-
while (1) {
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
_this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
|
457
|
-
|
458
|
-
if (!(!alarmIsOpened && !alarmOpening)) {
|
459
|
-
_context7.next = 3;
|
460
|
-
break;
|
461
|
-
}
|
462
|
-
|
463
|
-
return _context7.abrupt("return");
|
397
|
+
while (1) switch (_context7.prev = _context7.next) {
|
398
|
+
case 0:
|
399
|
+
// 如果未开启则退出
|
400
|
+
_this$getState3 = this.getState(), alarmIsOpened = _this$getState3.alarmIsOpened, alarmOpening = _this$getState3.alarmOpening;
|
464
401
|
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
402
|
+
if (!(!alarmIsOpened && !alarmOpening)) {
|
403
|
+
_context7.next = 3;
|
404
|
+
break;
|
405
|
+
}
|
406
|
+
|
407
|
+
return _context7.abrupt("return");
|
408
|
+
|
409
|
+
case 3:
|
410
|
+
this.currentTopoId = null;
|
411
|
+
rlog.debug('useAlarm.useEffect 告警WebSocket 结束');
|
412
|
+
this.updateState({
|
413
|
+
topoAlarmIsOpen: false,
|
414
|
+
alarmOpening: false,
|
415
|
+
alarmPanelIsOpen: false
|
416
|
+
});
|
417
|
+
_context7.next = 8;
|
418
|
+
return this.topo.serverApi.closeTopoAlarm(id, this.secretKey);
|
419
|
+
|
420
|
+
case 8:
|
421
|
+
case "end":
|
422
|
+
return _context7.stop();
|
480
423
|
}
|
481
424
|
}, _callee7, this);
|
482
|
-
}));
|
483
|
-
|
484
|
-
function closeTopoAlarm(_x6) {
|
485
|
-
return _closeTopoAlarm.apply(this, arguments);
|
486
|
-
}
|
487
|
-
|
488
|
-
return closeTopoAlarm;
|
489
|
-
}()
|
425
|
+
}))).apply(this, arguments);
|
426
|
+
}
|
490
427
|
/**
|
491
428
|
* 打开\关闭告警列表弹窗
|
492
429
|
*
|
@@ -503,142 +440,122 @@ var Alarm = /*#__PURE__*/function () {
|
|
503
440
|
*/
|
504
441
|
;
|
505
442
|
|
506
|
-
_proto.restart =
|
507
|
-
|
508
|
-
function () {
|
509
|
-
var _restart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
443
|
+
_proto.restart = function restart() {
|
444
|
+
return (_restart = _restart || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
510
445
|
var id;
|
511
446
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
512
|
-
while (1) {
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
return _context8.stop();
|
522
|
-
}
|
447
|
+
while (1) switch (_context8.prev = _context8.next) {
|
448
|
+
case 0:
|
449
|
+
id = this.currentTopoId;
|
450
|
+
_context8.next = 3;
|
451
|
+
return this.openTopoAlarm(id);
|
452
|
+
|
453
|
+
case 3:
|
454
|
+
case "end":
|
455
|
+
return _context8.stop();
|
523
456
|
}
|
524
457
|
}, _callee8, this);
|
525
|
-
}));
|
526
|
-
|
527
|
-
function restart() {
|
528
|
-
return _restart.apply(this, arguments);
|
529
|
-
}
|
530
|
-
|
531
|
-
return restart;
|
532
|
-
}()
|
458
|
+
}))).apply(this, arguments);
|
459
|
+
}
|
533
460
|
/**
|
534
461
|
* 处理告警推送事件
|
535
462
|
*/
|
536
463
|
;
|
537
464
|
|
538
|
-
_proto.handleAlarmEvent =
|
539
|
-
|
540
|
-
|
541
|
-
var _handleAlarmEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(alertData) {
|
542
|
-
var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
|
465
|
+
_proto.handleAlarmEvent = function handleAlarmEvent(_x7) {
|
466
|
+
return (_handleAlarmEvent = _handleAlarmEvent || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(alertData) {
|
467
|
+
var _this$getState4, alarmIsOpened, resAndMetrics, resIdsList, nodeIdsList, linkIdsList, alarmDispatchers, sendAl, idsList, operations, _yield$alarmDispatche2, eqFlag, alarmlist, _this$topo$viewProps, _this$topo$viewProps2;
|
543
468
|
|
544
469
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
545
|
-
while (1) {
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
470
|
+
while (1) switch (_context9.prev = _context9.next) {
|
471
|
+
case 0:
|
472
|
+
_this$getState4 = this.getState(), alarmIsOpened = _this$getState4.alarmIsOpened;
|
473
|
+
resAndMetrics = this.topo.store.getState().topoMod.resAndMetrics;
|
474
|
+
resIdsList = resAndMetrics.resIdsList, nodeIdsList = resAndMetrics.nodeIdsList, linkIdsList = resAndMetrics.linkIdsList;
|
475
|
+
alarmDispatchers = this.topo.store.getModelDispatchers('topoAlarm'); // 添加事件
|
476
|
+
// console.log("handleAlarmEvent-接收到推送的原始告警信息", alertData);
|
477
|
+
|
478
|
+
if (!(isAvailableArray(alertData) && isAvailableArray(resIdsList))) {
|
479
|
+
_context9.next = 24;
|
480
|
+
break;
|
481
|
+
}
|
482
|
+
|
483
|
+
sendAl = [];
|
484
|
+
idsList = [].concat(nodeIdsList, linkIdsList);
|
485
|
+
operations = [];
|
486
|
+
idsList.forEach(function (idItem) {
|
487
|
+
if (idItem.operation === null) {
|
488
|
+
operations.push(idItem.ciId);
|
557
489
|
}
|
490
|
+
});
|
491
|
+
alertData.forEach(function (item, index) {
|
492
|
+
var _item$resourceId;
|
493
|
+
|
494
|
+
var ciId = (_item$resourceId = item.resourceId) !== null && _item$resourceId !== void 0 ? _item$resourceId : item.ciId;
|
495
|
+
var obj = {
|
496
|
+
id: ciId,
|
497
|
+
level: item.alertLevel,
|
498
|
+
alertId: item.alertId,
|
499
|
+
status: item.status,
|
500
|
+
obj: item,
|
501
|
+
info: item.alertType,
|
502
|
+
ciCode: item === null || item === void 0 ? void 0 : item.ciCode,
|
503
|
+
ruleId: item === null || item === void 0 ? void 0 : item.ruleId
|
504
|
+
};
|
558
505
|
|
559
|
-
|
560
|
-
|
561
|
-
operations = [];
|
562
|
-
idsList.forEach(function (idItem) {
|
563
|
-
if (idItem.operation === null) {
|
564
|
-
operations.push(idItem.ciId);
|
565
|
-
}
|
566
|
-
});
|
567
|
-
alertData.forEach(function (item, index) {
|
568
|
-
var _item$resourceId;
|
569
|
-
|
570
|
-
var ciId = (_item$resourceId = item.resourceId) !== null && _item$resourceId !== void 0 ? _item$resourceId : item.ciId;
|
571
|
-
var obj = {
|
572
|
-
id: ciId,
|
573
|
-
level: item.alertLevel,
|
574
|
-
alertId: item.alertId,
|
575
|
-
status: item.status,
|
576
|
-
obj: item,
|
577
|
-
info: item.alertType,
|
578
|
-
ciCode: item === null || item === void 0 ? void 0 : item.ciCode,
|
579
|
-
ruleId: item === null || item === void 0 ? void 0 : item.ruleId
|
580
|
-
};
|
581
|
-
|
582
|
-
if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
|
583
|
-
sendAl.push(obj);
|
584
|
-
}
|
585
|
-
}); // console.log("before-combAlarmData", sendAl, idsList);
|
586
|
-
|
587
|
-
if (!(sendAl.length > 0)) {
|
588
|
-
_context9.next = 24;
|
589
|
-
break;
|
506
|
+
if (resIdsList.indexOf(ciId) >= 0 && operations.indexOf(ciId) < 0) {
|
507
|
+
sendAl.push(obj);
|
590
508
|
}
|
509
|
+
}); // console.log("before-combAlarmData", sendAl, idsList);
|
591
510
|
|
592
|
-
|
593
|
-
_context9.
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
511
|
+
if (!(sendAl.length > 0)) {
|
512
|
+
_context9.next = 24;
|
513
|
+
break;
|
514
|
+
}
|
515
|
+
|
516
|
+
rlog.debug('过滤掉非本拓扑的告警信息 告警开关-推送告警到ht-alarmIsOpened-sendAl', alarmIsOpened, sendAl);
|
517
|
+
_context9.prev = 12;
|
518
|
+
_context9.next = 15;
|
519
|
+
return alarmDispatchers.combAlarmData({
|
520
|
+
alarmdata: sendAl
|
521
|
+
});
|
522
|
+
|
523
|
+
case 15:
|
524
|
+
_yield$alarmDispatche2 = _context9.sent;
|
525
|
+
eqFlag = _yield$alarmDispatche2.eqFlag;
|
526
|
+
alarmlist = _yield$alarmDispatche2.alarmlist;
|
527
|
+
|
528
|
+
// console.log("handleAlarmEvent", alarmIsOpened,eqFlag);
|
529
|
+
// console.log("handleAlarmEvent-topo.viewProps", this.topo.viewProps);
|
530
|
+
if (alarmIsOpened) {
|
531
|
+
this.hmGetTopoAlarmByDoc(); // 通知所有告警
|
532
|
+
|
533
|
+
if ((_this$topo$viewProps = this.topo.viewProps) !== null && _this$topo$viewProps !== void 0 && _this$topo$viewProps.onAlarm) {
|
534
|
+
this.topo.viewProps.onAlarm(this.getAlarms().map(function (item) {
|
535
|
+
return item.obj;
|
536
|
+
}));
|
537
|
+
}
|
598
538
|
|
599
|
-
|
600
|
-
|
601
|
-
eqFlag = _yield$alarmDispatche.eqFlag;
|
602
|
-
alarmlist = _yield$alarmDispatche.alarmlist;
|
603
|
-
|
604
|
-
// console.log("handleAlarmEvent", alarmIsOpened,eqFlag);
|
605
|
-
// console.log("handleAlarmEvent-topo.viewProps", this.topo.viewProps);
|
606
|
-
if (alarmIsOpened) {
|
607
|
-
this.hmGetTopoAlarmByDoc(); // 通知所有告警
|
608
|
-
|
609
|
-
if ((_this$topo$viewProps = this.topo.viewProps) !== null && _this$topo$viewProps !== void 0 && _this$topo$viewProps.onAlarm) {
|
610
|
-
this.topo.viewProps.onAlarm(this.getAlarms().map(function (item) {
|
611
|
-
return item.obj;
|
612
|
-
}));
|
613
|
-
}
|
614
|
-
|
615
|
-
if ((_this$topo$viewProps2 = this.topo.viewProps) !== null && _this$topo$viewProps2 !== void 0 && _this$topo$viewProps2.onResourceEvent) {
|
616
|
-
this.topo.viewProps.onResourceEvent(this.getEvents());
|
617
|
-
}
|
539
|
+
if ((_this$topo$viewProps2 = this.topo.viewProps) !== null && _this$topo$viewProps2 !== void 0 && _this$topo$viewProps2.onResourceEvent) {
|
540
|
+
this.topo.viewProps.onResourceEvent(this.getEvents());
|
618
541
|
}
|
542
|
+
}
|
619
543
|
|
620
|
-
|
621
|
-
|
544
|
+
_context9.next = 24;
|
545
|
+
break;
|
622
546
|
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
547
|
+
case 21:
|
548
|
+
_context9.prev = 21;
|
549
|
+
_context9.t0 = _context9["catch"](12);
|
550
|
+
rlog.error('告警发送异常', _context9.t0);
|
627
551
|
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
}
|
552
|
+
case 24:
|
553
|
+
case "end":
|
554
|
+
return _context9.stop();
|
632
555
|
}
|
633
556
|
}, _callee9, this, [[12, 21]]);
|
634
|
-
}));
|
635
|
-
|
636
|
-
function handleAlarmEvent(_x7) {
|
637
|
-
return _handleAlarmEvent.apply(this, arguments);
|
638
|
-
}
|
639
|
-
|
640
|
-
return handleAlarmEvent;
|
641
|
-
}();
|
557
|
+
}))).apply(this, arguments);
|
558
|
+
};
|
642
559
|
|
643
560
|
_proto.getState = function getState() {
|
644
561
|
return this.topo.store.getModelState('topoAlarm');
|