diff --git a/public/index.html b/public/index.html index bcc6a74..5783a07 100644 --- a/public/index.html +++ b/public/index.html @@ -1094,8 +1094,9 @@ if (!confirm('Delete all completed and failed executions?')) return; try { - const response = await fetch('/api/executions'); - const executions = await response.json(); + const response = await fetch('/api/executions?limit=1000'); // Get all executions + const data = await response.json(); + const executions = data.executions || data; // Handle new pagination format const toDelete = executions.filter(e => e.status === 'completed' || e.status === 'failed'); @@ -1104,15 +1105,17 @@ return; } + let deleted = 0; for (const execution of toDelete) { - await fetch(`/api/executions/${execution.id}`, { method: 'DELETE' }); + const deleteResponse = await fetch(`/api/executions/${execution.id}`, { method: 'DELETE' }); + if (deleteResponse.ok) deleted++; } - alert(`Deleted ${toDelete.length} execution(s)`); + showTerminalNotification(`Deleted ${deleted} execution(s)`, 'success'); refreshData(); } catch (error) { console.error('Error clearing executions:', error); - alert('Error clearing executions'); + showTerminalNotification('Error clearing executions', 'error'); } }