From 14c59bc5c224c0ff01c9bfb0b4566cf75c82d514 Mon Sep 17 00:00:00 2001 From: marsalva Date: Tue, 24 Mar 2026 20:49:35 +0000 Subject: [PATCH] Actualizar js/layout.js --- js/layout.js | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/js/layout.js b/js/layout.js index df47642..52c208e 100644 --- a/js/layout.js +++ b/js/layout.js @@ -2,47 +2,6 @@ AQUÍ ARRIBA ESTÁ TODO TU CÓDIGO ORIGINAL DEL LAYOUT (El que dibuja el sidebar, el header, el menú, etc.) ... */ -// ========================================== -// 🎨 INYECTOR DE LOGO CORPORATIVO (APP) -// ========================================== -setTimeout(async () => { - if (!localStorage.getItem("token")) return; - try { - // Pedimos la configuración de la empresa a tu servidor - const TRACK_API = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1' - ? 'http://localhost:3000' - : 'https://integrarepara-api.integrarepara.es'; - - const res = await fetch(`${TRACK_API}/config/company`, { - headers: { "Authorization": `Bearer ${localStorage.getItem("token")}` } - }); - const data = await res.json(); - - if (data.ok && data.config && data.config.company_logo) { - // Buscamos el cuadradito de la cabecera (el que tiene la inicial) - // Normalmente en tu plantilla es el div naranja con flex center - const headerIcon = document.querySelector('header .w-10.h-10.rounded-xl, #header-container .w-10.h-10'); - - if (headerIcon) { - // Vaciamos la letra inicial - headerIcon.innerHTML = ''; - // Le quitamos el fondo de color - headerIcon.className = "w-10 h-10 flex shrink-0"; - headerIcon.style.background = "transparent"; - headerIcon.style.boxShadow = "none"; - - // Le inyectamos la imagen del logo - const img = document.createElement('img'); - img.src = data.config.company_logo; - img.className = "w-full h-full object-contain drop-shadow-sm"; - headerIcon.appendChild(img); - } - } - } catch (e) { - console.error("No se pudo cargar el logo de la empresa", e); - } -}, 300); // Le damos 300ms de ventaja para que el HTML se dibuje primero - // ========================================== // RASTREADOR FANTASMA GPS (MODO DE CAMINO) @@ -84,4 +43,4 @@ setInterval(async () => { }, () => {}, { enableHighAccuracy: false, timeout: 10000, maximumAge: 30000 }); } } catch (e) { } -}, 15000); // Se ejecuta cada 15 segundos \ No newline at end of file +}, 15000); // Se ejecuta cada 15 segundos