Actualiser test.html
CI / PHP Syntax Check (push) Has been cancelled
CI / JavaScript Lint (push) Has been cancelled
CI / Docker Build Test (push) Has been cancelled
CI / Validate Translation Files (push) Has been cancelled
CI / Auto-merge develop → main (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled

This commit is contained in:
2026-06-17 17:38:21 +00:00
parent 79fff10b48
commit 0619d1487c
+29 -24
View File
@@ -2,39 +2,44 @@
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Récupération Directe</title>
<title>Debug EverShelf</title>
<style>
body { font-family: sans-serif; background: #f4f4f9; padding: 20px; }
.table-container { background: white; margin-bottom: 20px; padding: 15px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
pre { background: #333; color: #0f0; padding: 10px; border-radius: 5px; overflow-x: auto; }
h2 { border-bottom: 2px solid #ccc; padding-bottom: 5px; }
</style>
</head>
<body>
<h3>Catégories récupérées depuis la mémoire :</h3>
<select id="dynamic-select" style="width:100%; padding:10px;"></select>
<h1>Dashboard de Debug EverShelf</h1>
<div id="debug-zone"></div>
<script>
// On crée une balise script qui pointe vers le fichier source d'EverShelf
const script = document.createElement('script');
script.src = '/assets/js/app.js';
// Liste des fichiers sources à inspecter (ajoute ici tes fichiers trouvés dans le terminal)
const targets = ['/data/category_ai_cache.json', '/assets/js/app.js'];
script.onload = () => {
// Une fois le script chargé, la variable CATEGORY_LABELS est maintenant disponible dans la mémoire de cette page
const cats = window.CATEGORY_LABELS;
async function initDebug() {
const zone = document.getElementById('debug-zone');
if (cats) {
const select = document.getElementById('dynamic-select');
for (const path of targets) {
const section = document.createElement('div');
section.className = 'table-container';
section.innerHTML = `<h2>Fichier : ${path}</h2><pre id="data-${btoa(path)}">Chargement...</pre>`;
zone.appendChild(section);
// On itère sur les clés de l'objet
Object.keys(cats).forEach(key => {
const opt = document.createElement('option');
opt.value = key;
// On affiche le texte brut (en ignorant le résultat de la fonction t())
opt.textContent = key;
select.appendChild(opt);
});
console.log("Données récupérées :", cats);
} else {
console.error("Variable CATEGORY_LABELS non trouvée après chargement.");
try {
const response = await fetch(path);
const text = await response.text();
document.getElementById(`data-${btoa(path)}`).innerText = text;
} catch (e) {
document.getElementById(`data-${btoa(path)}`).innerText = "Erreur de lecture : " + e.message;
}
}
}
};
document.head.appendChild(script);
initDebug();
</script>
</body>
</html>