diff --git a/web_page/index.html b/web_page/index.html index 90ea40a..a55ce8c 100644 --- a/web_page/index.html +++ b/web_page/index.html @@ -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类型消息');