diff --git a/public/index.html b/public/index.html
index 8ae36ba..61824b3 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1376,6 +1376,7 @@
document.getElementById('scheduleList').innerHTML = html;
} catch (error) {
console.error('Error loading schedules:', error);
+ document.getElementById('scheduleList').innerHTML = '
⚠ Failed to load schedules
';
}
}
@@ -2369,7 +2370,8 @@
closeModal('viewExecutionModal');
refreshData();
} else {
- alert('Failed to abort execution');
+ const err = await response.json().catch(() => ({}));
+ alert(err.error || 'Failed to abort execution');
}
} catch (error) {
console.error('Error aborting execution:', error);
diff --git a/server.js b/server.js
index f4870ad..61f3abd 100644
--- a/server.js
+++ b/server.js
@@ -378,7 +378,6 @@ wss.on('connection', (ws) => {
ws.on('message', async (data) => {
try {
const message = JSON.parse(data.toString());
- console.log('WebSocket message received:', message.type);
if (message.type === 'command_result') {
// Handle command result from worker
@@ -427,7 +426,7 @@ wss.on('connection', (ws) => {
is_automated: isAutomated,
});
- console.log(`Command result received for execution ${execution_id}: ${success ? 'success' : 'failed'}`);
+ if (!success) console.warn(`[Worker] Command failed for execution ${execution_id} on worker ${worker_id}`);
}
if (message.type === 'workflow_result') {
@@ -972,6 +971,7 @@ async function executeCommandStep(executionId, step, stepNumber, params = {}) {
// Execute command on each target worker and wait for results
const results = [];
+ let sentCount = 0;
for (const workerId of targetWorkerIds) {
const workerWs = workers.get(workerId);
@@ -985,6 +985,7 @@ async function executeCommandStep(executionId, step, stepNumber, params = {}) {
});
continue;
}
+ sentCount++;
// Send command to worker
let commandId = crypto.randomUUID();
@@ -1052,8 +1053,18 @@ async function executeCommandStep(executionId, step, stepNumber, params = {}) {
}
}
- // All commands succeeded
- return results.every(r => r.success);
+ // If every target worker was offline, treat as step failure
+ if (sentCount === 0) {
+ await addExecutionLog(executionId, {
+ step: stepNumber,
+ action: 'no_workers',
+ message: 'All target workers were offline when step executed',
+ timestamp: new Date().toISOString()
+ });
+ return false;
+ }
+
+ return true; // all sent commands succeeded (failures return false above)
} catch (error) {
console.error(`[Workflow] Error executing command step:`, error);