Actualizar servicios.html
This commit is contained in:
@@ -444,6 +444,23 @@
|
|||||||
let activeStatusFilter = 'ALL';
|
let activeStatusFilter = 'ALL';
|
||||||
let activeKpiFilter = '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) {
|
function toggleKpiFilter(kpiType) {
|
||||||
if (activeKpiFilter === kpiType) {
|
if (activeKpiFilter === kpiType) {
|
||||||
activeKpiFilter = 'ALL';
|
activeKpiFilter = 'ALL';
|
||||||
|
|||||||
Reference in New Issue
Block a user