From 00e5867f451efead0c8527b06d2fd8e251b258c8 Mon Sep 17 00:00:00 2001 From: marsalva Date: Sun, 15 Feb 2026 21:54:13 +0000 Subject: [PATCH] Actualizar automatizaciones.html --- automatizaciones.html | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/automatizaciones.html b/automatizaciones.html index b5cfe4b..2022d6b 100644 --- a/automatizaciones.html +++ b/automatizaciones.html @@ -110,25 +110,32 @@ setInterval(loadAutomations, 20000); }); - async function loadAutomations() { - try { - const res = await fetch(`${API_URL}/providers/scraped`, { - headers: { "Authorization": `Bearer ${localStorage.getItem("token")}` } - }); - const data = await res.json(); - if (data.ok) { - scrapedData = data.services || []; - activeIntervals.forEach(clearInterval); - activeIntervals = []; + async function loadAutomations() { + try { + const res = await fetch(`${API_URL}/providers/scraped`, { + headers: { "Authorization": `Bearer ${localStorage.getItem("token")}` } + }); + const data = await res.json(); + if (data.ok) { + scrapedData = data.services || []; + activeIntervals.forEach(clearInterval); + activeIntervals = []; - const inQueue = scrapedData.filter(s => s.automation_status === 'in_progress' && s.current_worker_name !== null); - const failed = scrapedData.filter(s => s.automation_status === 'failed' || (s.automation_status === 'in_progress' && s.current_worker_name === null)); + // Filtrado estricto: Solo mostramos lo que NO es 'manual' + const inQueue = scrapedData.filter(s => + s.automation_status === 'in_progress' && s.current_worker_name !== null + ); - renderCards(inQueue); - renderFailedTable(failed); - } - } catch (e) { console.error(e); } + const failed = scrapedData.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); } +} function renderCards(activeServices) { const container = document.getElementById('automation-list');