更新 main.go

This commit is contained in:
XOF
2025-12-02 23:16:47 +08:00
parent 9571f51180
commit ef33749927

10
main.go
View File

@@ -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) {