fix: pause button not working

This commit is contained in:
nate 2026-03-19 15:28:39 +04:00
parent f9c835f591
commit 4cec734d63
1 changed files with 4 additions and 2 deletions

View File

@ -166,13 +166,15 @@
<%~ include('./partials/monitor-form-js') %> <%~ include('./partials/monitor-form-js') %>
// Toggle button // Toggle button
document.getElementById('toggle-btn').onclick = async () => { document.getElementById('toggle-btn').onclick = async (e) => {
e.preventDefault();
await api(`/monitors/${monitorId}/toggle`, { method: 'POST' }); await api(`/monitors/${monitorId}/toggle`, { method: 'POST' });
location.reload(); location.reload();
}; };
// Delete button // Delete button
document.getElementById('delete-btn').onclick = async () => { document.getElementById('delete-btn').onclick = async (e) => {
e.preventDefault();
if (!confirm('Delete this monitor and all its ping history?')) return; if (!confirm('Delete this monitor and all its ping history?')) return;
await api(`/monitors/${monitorId}`, { method: 'DELETE' }); await api(`/monitors/${monitorId}`, { method: 'DELETE' });
window.location.href = '/dashboard/home'; window.location.href = '/dashboard/home';