From 4fe79ad11258611c3209250daedb50a9637b1140 Mon Sep 17 00:00:00 2001 From: PaulVua Date: Tue, 17 Mar 2026 19:14:32 +0100 Subject: [PATCH] Admin: bloquer update firmware en mode hotspot avec message explicatif Co-Authored-By: Claude Opus 4.6 (1M context) --- html/admin.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/html/admin.html b/html/admin.html index c71143f..5f08b21 100755 --- a/html/admin.html +++ b/html/admin.html @@ -454,6 +454,7 @@ window.onload = function() { success: function(response) { console.log("Getting SQLite config table:"); console.log(response); + window._adminConfig = response; //device name const deviceName = document.getElementById("device_name"); deviceName.value = response.deviceName; @@ -781,8 +782,14 @@ function update_config(param, value){ } function updateFirmware() { + // Check if connected to internet (not in hotspot mode) + if (window._adminConfig && window._adminConfig.WIFI_status === 'hotspot') { + alert('Mise à jour impossible en mode hotspot.\nConnectez d\'abord le capteur à un réseau WiFi avec accès internet.'); + return; + } + console.log("Starting comprehensive firmware update..."); - + // Show loading state const updateBtn = document.getElementById('updateBtn'); const updateBtnText = document.getElementById('updateBtnText');