v2 - new interface, many new page for fine tuning

This commit is contained in:
pporcheret
2026-10-28 21:45:40 +01:00
parent a6169bcfdb
commit a17c3cb614
89 changed files with 8691 additions and 13 deletions
@@ -0,0 +1,31 @@
/* Alfred Glass — aperçu Maison alimenté par les préférences de /config. */
(() => {
'use strict';
let rows=null;
function render(){
if(!rows)return;
const card=document.getElementById('avHomeSummary');
if(!card)return;
const ids=['avLights','avCovers','avIndoor'];
rows.slice(0,3).forEach((r,i)=>{
const node=document.getElementById(ids[i]);
if(!node)return;
node.textContent=`${r.label} : ${r.value}`;
node.closest('p').hidden=false;
});
for(let i=rows.length;i<ids.length;i++){
const node=document.getElementById(ids[i]);
if(node)node.closest('p').hidden=true;
}
}
window.alfredHomeCardCustomUpdate=render;
async function update(){
try {
const r=await fetch('/api/alfred/home-card',{cache:'no-store'});
if(!r.ok)throw new Error('HTTP '+r.status);
const data=await r.json();rows=Array.isArray(data.rows)?data.rows:null;
render();
}catch(e){console.warn('[ALFRED MAISON] Informations personnalisées indisponibles',e);}
}
update();setInterval(()=>{if(!document.hidden)update();},20000);
})();