diff --git a/templates/index.html b/templates/index.html index 5d52028..d7119ad 100644 --- a/templates/index.html +++ b/templates/index.html @@ -119,29 +119,6 @@ border-top: 1px solid #ddd; } - /* 加载动画样式 */ - .loading-spinner { - display: inline-block; - width: 20px; - height: 20px; - border: 2px solid #f3f3f3; - border-top: 2px solid #007bff; - border-radius: 50%; - animation: spin 1s linear infinite; - margin-left: 8px; - } - - @keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } - } - - .countdown { - font-size: 14px; - color: #666; - margin-left: 10px; - } - @media (max-width: 768px) { .controls { flex-direction: column; @@ -808,9 +785,9 @@ latestDataElement.style.opacity = 0.6; - // 添加加载动画和倒计时 + // 显示查询状态 const originalText = queryBtn.innerHTML; - queryBtn.innerHTML = '查询中'; + queryBtn.textContent = '查询中...'; queryBtn.disabled = true; // 先获取一次当前最新数据 @@ -837,20 +814,6 @@ return; } - // 开始10秒倒计时 - let countdown = 10; - queryBtn.innerHTML = `等待设备响应${countdown}秒`; - - const countdownTimer = setInterval(() => { - countdown--; - if (countdown > 0) { - queryBtn.innerHTML = `等待设备响应${countdown}秒`; - } else { - clearInterval(countdownTimer); - queryBtn.innerHTML = '获取最新数据中'; - } - }, 1000); - // 等待10秒后获取最新数据(给设备响应时间) setTimeout(() => { fetchLatestData(); @@ -858,7 +821,6 @@ latestDataElement.style.opacity = 1; queryBtn.innerHTML = originalText; queryBtn.disabled = false; - clearInterval(countdownTimer); }, 10000); } else { console.error('发送查询指令失败:', data.message);