移除前端对频率的限制(非服务端部署代码,服务端需要对应修改)

This commit is contained in:
zqc
2026-03-10 09:45:44 +08:00
parent 7b1825d9f5
commit b4f95eb43d

View File

@@ -352,25 +352,25 @@
result_type: msg.result_type
};
const now = msg.timestamp;
const timeThreshold = now - 10;
const existingAlert = alerts.find(alert =>
JSON.stringify(alert.result_type) === JSON.stringify(alertMsg.result_type) &&
alert.timestamp > timeThreshold
);
if (!existingAlert) {
// const now = msg.timestamp;
// const timeThreshold = now - 10;
// const existingAlert = alerts.find(alert =>
// JSON.stringify(alert.result_type) === JSON.stringify(alertMsg.result_type) &&
// alert.timestamp > timeThreshold
// );
// if (!existingAlert) {
alerts.push(alertMsg);
// console.log('添加新的异常告警:', alertMsg);
// console.log('当前alerts数组长度:', alerts.length);
renderMessages();
// console.log('渲染消息列表完成');
const alertTypes = alertMsg.result_type.join(', ');
addLog(`检测到异常: ${alertTypes}`, 'warning');
}
// }
}
} else if (msg.msg_type === 'take_out') {
// console.log('处理take_out类型消息');