diff --git a/VERSION b/VERSION index d615fd0..158c747 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.9.4 +1.9.5 diff --git a/changelog.json b/changelog.json index 0b1f15c..c31b2a4 100644 --- a/changelog.json +++ b/changelog.json @@ -1,5 +1,18 @@ { "versions": [ + { + "version": "1.9.5", + "date": "2026-05-20", + "changes": { + "features": [], + "improvements": [ + "logs.html (modal WiFi connect logs): message clair quand le fichier n'existe pas encore (au lieu du 404 d'Apache qui faisait croire à un bug). Échappement HTML du contenu et limitation aux 1000 dernières lignes pour la performance" + ], + "fixes": [], + "compatibility": [] + }, + "notes": "Petit ajustement UX du modal introduit en v1.9.4: si aucune tentative WiFi n'a eu lieu depuis v1.9.3, on indique simplement qu'il faut en déclencher une plutôt que d'afficher une erreur HTTP." + }, { "version": "1.9.4", "date": "2026-05-20", diff --git a/html/logs.html b/html/logs.html index 60fc562..29114bb 100755 --- a/html/logs.html +++ b/html/logs.html @@ -210,7 +210,32 @@ window.onload = function() { function loadWifiLog() { const container = document.getElementById('card_wifi_content'); if (!container) return; - displayLogFile('../logs/wifi_connect.log', container, true, 1000); + container.innerHTML = '
Loading log file...
'; + fetch('../logs/wifi_connect.log') + .then(response => { + if (response.status === 404) { + container.innerHTML = '
' + + 'Aucun log WiFi pour le moment. ' + + 'Ce journal est créé lors de la première tentative de connexion WiFi depuis le mode hotspot. ' + + 'Reviens ici après avoir cliqué sur "Se connecter" depuis la page WiFi.' + + '
'; + return null; + } + if (!response.ok) { + throw new Error(`HTTP ${response.status} ${response.statusText}`); + } + return response.text(); + }) + .then(text => { + if (text === null) return; + const lines = text.split('\n'); + const tail = lines.slice(-1000).join('\n'); + container.innerHTML = `
${tail.replace(/`;
+      container.scrollTop = container.scrollHeight;
+    })
+    .catch(err => {
+      container.innerHTML = `
Error loading log file: ${err.message}
`; + }); } function displayLogFile(logFilePath, containerElement, scrollToBottom = true, maxLines = 0) {