From fedf73a284f7b02642558706486410183f17eab2 Mon Sep 17 00:00:00 2001 From: marsalva Date: Wed, 18 Mar 2026 22:38:35 +0000 Subject: [PATCH] Actualizar servicios.html --- servicios.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/servicios.html b/servicios.html index 1686b2e..3f219dd 100644 --- a/servicios.html +++ b/servicios.html @@ -444,6 +444,23 @@ let activeStatusFilter = 'ALL'; let activeKpiFilter = 'ALL'; + async function applyTheme() { + try { + let theme = JSON.parse(localStorage.getItem('app_theme')); + const res = await fetch(`${API_URL}/config/company`, { headers: { "Authorization": `Bearer ${localStorage.getItem("token")}` } }); + const data = await res.json(); + if(data.ok && data.config && data.config.app_settings) { + theme = typeof data.config.app_settings === 'string' ? JSON.parse(data.config.app_settings) : data.config.app_settings; + localStorage.setItem('app_theme', JSON.stringify(theme)); + } + if(theme && theme.primary) { + document.documentElement.style.setProperty('--primary', theme.primary); + document.documentElement.style.setProperty('--secondary', theme.secondary); + document.documentElement.style.setProperty('--app-bg', theme.bg || '#f4f7f9'); + } + } catch (e) { console.warn("Usando tema por defecto"); } + } + function toggleKpiFilter(kpiType) { if (activeKpiFilter === kpiType) { activeKpiFilter = 'ALL';