Actualizar automatizaciones.html
This commit is contained in:
@@ -79,8 +79,20 @@
|
||||
activeIntervals.forEach(clearInterval);
|
||||
activeIntervals = [];
|
||||
|
||||
renderCards(data.services.filter(s => s.automation_status === 'in_progress'));
|
||||
renderFailedTable(data.services.filter(s => s.automation_status === 'failed'));
|
||||
// Solo mostramos arriba los que están en progreso Y TIENEN un operario con el turno activo
|
||||
const inQueue = data.services.filter(s =>
|
||||
s.automation_status === 'in_progress' && s.current_worker_name !== null
|
||||
);
|
||||
|
||||
// Se consideran fallidos los que están marcados como 'failed'
|
||||
// O los que están 'in_progress' pero ya no tienen a nadie en turno (ronda terminada)
|
||||
const failed = data.services.filter(s =>
|
||||
s.automation_status === 'failed' ||
|
||||
(s.automation_status === 'in_progress' && s.current_worker_name === null)
|
||||
);
|
||||
|
||||
renderCards(inQueue);
|
||||
renderFailedTable(failed);
|
||||
}
|
||||
} catch (e) { console.error(e); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user