Actualizar configuracion.html

This commit is contained in:
2026-03-14 19:52:29 +00:00
parent bf9944b1df
commit e260645c12

View File

@@ -1237,7 +1237,7 @@
} catch(e) { showToast("Error de conexión", true); } } catch(e) { showToast("Error de conexión", true); }
} }
// ========================================== // ==========================================
// LÓGICA PROVEEDORES CREDENCIALES // LÓGICA PROVEEDORES CREDENCIALES
// ========================================== // ==========================================
async function loadProviderCredentials() { async function loadProviderCredentials() {
@@ -1246,8 +1246,12 @@
const data = await res.json(); const data = await res.json();
if(data.ok) { if(data.ok) {
data.credentials.forEach(c => { data.credentials.forEach(c => {
const userInp = document.getElementById(`user_${c.provider.toLowerCase()}`); const providerName = c.provider.toLowerCase();
const userInp = document.getElementById(`user_${providerName}`);
const autoInp = document.getElementById(`auto_${providerName}`); // <-- Busca el botón
if(userInp) userInp.value = c.username; if(userInp) userInp.value = c.username;
if(autoInp) autoInp.checked = c.auto_dispatch || false; // <-- Enciende o apaga
}); });
} }
} catch(e) { console.error("Error creds"); } } catch(e) { console.error("Error creds"); }