diff --git a/VERSION b/VERSION index f0a2883..5e9287b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.9.10 +1.9.11 diff --git a/changelog.json b/changelog.json index 3bf24ba..0b40388 100644 --- a/changelog.json +++ b/changelog.json @@ -1,5 +1,18 @@ { "versions": [ + { + "version": "1.9.11", + "date": "2026-05-28", + "changes": { + "features": [ + "Bouton 'Test Power Supply' à côté de 'Run Self Test' (pages Admin, Accueil, Capteurs, Modem) : lance uniquement le check sous-tension dans un petit modal dédié, sans dérouler tout le Self Test. Affiche le verdict (OK / Warning / Failed) + le détail des bits (sous-tension maintenant / depuis le boot, throttling)." + ], + "improvements": [], + "fixes": [], + "compatibility": [] + }, + "notes": "Réutilise l'endpoint launcher.php?type=throttled ajouté en v1.9.10. Le modal est défini dans selftest-modal.html (déjà chargé sur toutes les pages)." + }, { "version": "1.9.10", "date": "2026-05-28", diff --git a/html/admin.html b/html/admin.html index 769dc70..bd4b5d2 100755 --- a/html/admin.html +++ b/html/admin.html @@ -59,6 +59,13 @@ Run Self Test + +
diff --git a/html/assets/js/selftest.js b/html/assets/js/selftest.js index f7f5bc2..666cc3d 100644 --- a/html/assets/js/selftest.js +++ b/html/assets/js/selftest.js @@ -1025,6 +1025,65 @@ function downloadReport() { }, 100); } +// ============================================ +// STANDALONE POWER SUPPLY TEST (quick check) +// ============================================ +function runPowerTest() { + const modalEl = document.getElementById('powerTestModal'); + const bodyEl = document.getElementById('powerTest_body'); + + bodyEl.innerHTML = ` +
+
+ Lecture de l'alimentation (vcgencmd get_throttled)... +
`; + + const modal = bootstrap.Modal.getOrCreateInstance(modalEl); + modal.show(); + + $.ajax({ + url: 'launcher.php?type=throttled', + dataType: 'json', + method: 'GET', + cache: false, + timeout: 10000, + success: function(data) { renderPowerTestResult(bodyEl, data); }, + error: function(xhr, status, error) { + bodyEl.innerHTML = `
Erreur: ${error || status}
`; + } + }); +} + +function renderPowerTestResult(bodyEl, data) { + if (!data || !data.available) { + bodyEl.innerHTML = `
${(data && data.error) || 'vcgencmd indisponible'}
`; + return; + } + + let alertClass, icon; + if (data.status === 'critical') { alertClass = 'alert-danger'; icon = '✗'; } + else if (data.status === 'warning') { alertClass = 'alert-warning'; icon = '!'; } + else { alertClass = 'alert-success'; icon = '✓'; } + + const flag = (b) => b + ? 'oui' + : 'non'; + + bodyEl.innerHTML = ` +
+ ${icon} ${data.message} +
+ + + + + + + + +
Valeur brute${data.raw}
Sous-tension maintenant${flag(data.under_voltage_now)}
Throttling maintenant${flag(data.throttled_now)}
Sous-tension depuis le boot${flag(data.under_voltage_occurred)}
Throttling depuis le boot${flag(data.throttling_occurred)}
`; +} + // Load the self-test modal HTML into the page function initSelfTestModal() { fetch('selftest-modal.html') diff --git a/html/index.html b/html/index.html index 0e7cbb8..11dd080 100755 --- a/html/index.html +++ b/html/index.html @@ -71,6 +71,13 @@ Run Self Test + +
diff --git a/html/saraR4.html b/html/saraR4.html index ee1a14f..156f475 100755 --- a/html/saraR4.html +++ b/html/saraR4.html @@ -76,6 +76,13 @@ Run Self Test + + + +