Admin: bloquer update firmware en mode hotspot avec message explicatif

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
PaulVua
2026-03-17 19:14:32 +01:00
parent b869ac3e9e
commit 4fe79ad112

View File

@@ -454,6 +454,7 @@ window.onload = function() {
success: function(response) { success: function(response) {
console.log("Getting SQLite config table:"); console.log("Getting SQLite config table:");
console.log(response); console.log(response);
window._adminConfig = response;
//device name //device name
const deviceName = document.getElementById("device_name"); const deviceName = document.getElementById("device_name");
deviceName.value = response.deviceName; deviceName.value = response.deviceName;
@@ -781,8 +782,14 @@ function update_config(param, value){
} }
function updateFirmware() { 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..."); console.log("Starting comprehensive firmware update...");
// Show loading state // Show loading state
const updateBtn = document.getElementById('updateBtn'); const updateBtn = document.getElementById('updateBtn');
const updateBtnText = document.getElementById('updateBtnText'); const updateBtnText = document.getElementById('updateBtnText');