From ef33749927b79b9704e142ea9d44752b4d136cd6 Mon Sep 17 00:00:00 2001 From: XOF Date: Tue, 2 Dec 2025 23:16:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20main.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 6062ab5..77534e3 100644 --- a/main.go +++ b/main.go @@ -131,7 +131,7 @@ func handleIndex(w http.ResponseWriter, r *http.Request) { .config-btn{background:var(--blue)} table{width:100%;background:var(--card);border-collapse:collapse;box-shadow:0 2px 8px rgba(0,0,0,.15);border-radius:8px;overflow:hidden} th,td{padding:12px;text-align:left;border-bottom:1px solid var(--border)} - th{background:var(--th-bg);font-weight:600} + th{background:var(--th-bg);text-align:center;font-weight:600} tbody tr:hover{background:rgba(33,150,243,.05)} .status-cell{text-align:center} .status{display:inline-block;width:10px;height:10px;border-radius:50%} @@ -301,8 +301,12 @@ func handleIndex(w http.ResponseWriter, r *http.Request) { } function toggleNotify(id) { - fetch('/api/task/toggle-notify?id=' + id, {method: 'POST', headers}) - .then(() => loadTasks()); + const btn = event.target; + const wasActive = btn.classList.contains('active'); + btn.classList.toggle('active'); + btn.textContent = wasActive ? '🔕' : '🔔'; + + fetch('/api/task/toggle-notify?id=' + id, {method: 'POST', headers}); } function showModal(task) {