From 5d979b3310476661b87c9b579e5e0d0809102e53 Mon Sep 17 00:00:00 2001 From: root <295172551@qq.com> Date: Thu, 26 Jun 2025 00:49:05 +0800 Subject: [PATCH] 111 --- LTEMvcApp/Views/Home/Logs.cshtml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/LTEMvcApp/Views/Home/Logs.cshtml b/LTEMvcApp/Views/Home/Logs.cshtml index b9d7f53..20e3c41 100644 --- a/LTEMvcApp/Views/Home/Logs.cshtml +++ b/LTEMvcApp/Views/Home/Logs.cshtml @@ -1385,17 +1385,20 @@ }); }); - connectionStatusBtn.addEventListener('click', function() { - fetch('/api/log/connection-status') - .then(response => response.json()) - .then(data => { - console.log('SSE连接状态:', data); - showInfo('连接状态信息已输出到控制台'); - }) - .catch(error => { - showError('获取连接状态失败: ' + error.message); - }); - }); + var connectionStatusBtn = document.getElementById('connectionStatusBtn'); + if (connectionStatusBtn) { + connectionStatusBtn.addEventListener('click', function() { + fetch('/api/log/connection-status') + .then(response => response.json()) + .then(data => { + console.log('SSE连接状态:', data); + showInfo('连接状态信息已输出到控制台'); + }) + .catch(error => { + showError('获取连接状态失败: ' + error.message); + }); + }); + } testConnectionBtn.addEventListener('click', function() { fetch('/api/log/test-connection')