diff --git a/automatizaciones.html b/automatizaciones.html index 45d8a2d..5ce07dc 100644 --- a/automatizaciones.html +++ b/automatizaciones.html @@ -84,62 +84,68 @@ } catch (e) { console.error(e); } } - function renderCards(activeServices) { - const container = document.getElementById('automation-list'); - if (activeServices.length === 0) { - container.innerHTML = ` -
No hay automatismos en curso ahora
-No hay automatismos en curso
+📍 CP: ${raw["Código Postal"]} | ${raw["Gremio"] || 'Gremio'}
+ container.innerHTML = activeServices.map(s => { + const raw = s.raw_data; + // Calculamos el tiempo restante para la barra de progreso + const now = new Date(); + const expires = new Date(s.token_expires_at); + const diff = Math.max(0, Math.floor((expires - now) / 1000)); + const percent = Math.min(100, (diff / 300) * 100); // 300 seg = 5 min + + return ` +📍 CP: ${raw["Código Postal"] || raw["C.P."] || '---'}
+Turno actual:
-Marco Rincón
Turno actual:
+${s.current_worker_name || 'Buscando...'}