fix: pause button not working
This commit is contained in:
parent
f9c835f591
commit
4cec734d63
|
|
@ -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';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue