From c062263b248ac2f1c68f18f4315b25f79b8a88d5 Mon Sep 17 00:00:00 2001 From: PaulVua Date: Wed, 1 Apr 2026 18:36:54 +0200 Subject: [PATCH] =?UTF-8?q?v1.6.3:=20Logs=20SARA=20en=20temps=20reel=20?= =?UTF-8?q?=E2=80=94=20auto-refresh=20+=20python3=20-u=20unbuffered?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- VERSION | 2 +- changelog.json | 17 +++++++++++++++++ html/logs.html | 29 +++++++++++++++++++++++++++++ services/setup_services.sh | 2 +- 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index fdd3be6..266146b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.2 +1.6.3 diff --git a/changelog.json b/changelog.json index 74ff5b8..fcbea46 100644 --- a/changelog.json +++ b/changelog.json @@ -1,5 +1,22 @@ { "versions": [ + { + "version": "1.6.3", + "date": "2026-04-01", + "changes": { + "features": [ + "Page logs: bouton Auto-refresh pour suivre les logs SARA en temps reel (polling 3s)" + ], + "improvements": [ + "Service SARA: ajout flag python3 -u (unbuffered) pour ecriture immediate des logs dans le fichier" + ], + "fixes": [], + "compatibility": [ + "Necessite re-execution de setup_services.sh pour activer le mode unbuffered (optionnel, pas d'impact si non fait)" + ] + }, + "notes": "Les logs SARA sont maintenant visibles en temps reel sur la page logs grace au mode unbuffered Python et au rafraichissement automatique. Aucun impact sur les anciennes installations qui ne relancent pas setup_services.sh." + }, { "version": "1.6.2", "date": "2026-03-27", diff --git a/html/logs.html b/html/logs.html index 03a3c5e..f88605e 100755 --- a/html/logs.html +++ b/html/logs.html @@ -58,6 +58,9 @@
Sara logs + @@ -274,6 +277,32 @@ function clear_loopLogs(){ }); } +// Auto-refresh for SARA logs +let autoRefreshInterval = null; +const AUTO_REFRESH_MS = 3000; + +function toggleAutoRefresh() { + const btn = document.getElementById('auto-refresh-toggle'); + const icon = document.getElementById('auto-refresh-icon'); + + if (autoRefreshInterval) { + clearInterval(autoRefreshInterval); + autoRefreshInterval = null; + icon.textContent = '▶'; + btn.classList.remove('btn-success'); + btn.classList.add('btn-secondary'); + } else { + // Refresh immediately, then every N seconds + displayLogFile('../logs/sara_service.log', document.getElementById('card_loop_content'), true, 1000); + autoRefreshInterval = setInterval(() => { + displayLogFile('../logs/sara_service.log', document.getElementById('card_loop_content'), true, 1000); + }, AUTO_REFRESH_MS); + icon.textContent = '⏸'; + btn.classList.remove('btn-secondary'); + btn.classList.add('btn-success'); + } +} + function getModem_busy_status() { //console.log("Getting modem busy status"); diff --git a/services/setup_services.sh b/services/setup_services.sh index 6eca439..fb59f13 100644 --- a/services/setup_services.sh +++ b/services/setup_services.sh @@ -82,7 +82,7 @@ After=network.target [Service] Type=oneshot -ExecStart=/usr/bin/python3 /var/www/nebuleair_pro_4g/loop/SARA_send_data_v2.py +ExecStart=/usr/bin/python3 -u /var/www/nebuleair_pro_4g/loop/SARA_send_data_v2.py User=root WorkingDirectory=/var/www/nebuleair_pro_4g StandardOutput=append:/var/www/nebuleair_pro_4g/logs/sara_service.log