告警功能增加
This commit is contained in:
parent
daff010eb7
commit
2d898be6c4
|
|
@ -201,16 +201,14 @@ export default {
|
||||||
// 处理告警信息并显示弹窗
|
// 处理告警信息并显示弹窗
|
||||||
handleWarning(warning) {
|
handleWarning(warning) {
|
||||||
console.log(warning)
|
console.log(warning)
|
||||||
const formattedTime = new Date(warning.warningTime).toLocaleString();
|
// const formattedTime = new Date(warning.warningTime).toLocaleString();
|
||||||
|
|
||||||
// 弹出告警信息
|
// 弹出告警信息
|
||||||
MessageBox.alert(
|
MessageBox.alert(
|
||||||
`
|
`
|
||||||
|
<p><strong>操作人:</strong>${warning.operaUserName}</p>
|
||||||
<p><strong>事件:</strong>${warning.warningEvent}</p>
|
<p><strong>事件:</strong>${warning.warningEvent}</p>
|
||||||
<p><strong>内容:</strong>${warning.warningContent}</p>
|
|
||||||
<p><strong>等级:</strong>${warning.warningGrade}</p>
|
|
||||||
<p><strong>IP:</strong>${warning.warningIp}</p>
|
<p><strong>IP:</strong>${warning.warningIp}</p>
|
||||||
<p><strong>时间:</strong>${formattedTime}</p>
|
<p><strong>时间:</strong>${warning.warningTime}</p>
|
||||||
`,
|
`,
|
||||||
'告警通知',
|
'告警通知',
|
||||||
{
|
{
|
||||||
|
|
@ -228,9 +226,8 @@ export default {
|
||||||
if (this.socket && this.socket.readyState === WebSocket.OPEN) {
|
if (this.socket && this.socket.readyState === WebSocket.OPEN) {
|
||||||
const message = {
|
const message = {
|
||||||
warningId,
|
warningId,
|
||||||
status: '1' // 1 表示已处理
|
|
||||||
};
|
};
|
||||||
this.socket.send(JSON.stringify(message));
|
this.socket.send(warningId);
|
||||||
console.log(`已通知后端处理告警: ${warningId}`);
|
console.log(`已通知后端处理告警: ${warningId}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue