From 6a6cfffca2aa38c72db8c83639b8d2538443e545 Mon Sep 17 00:00:00 2001 From: yoannmultigaming Date: Mon, 23 Nov 2026 18:27:54 +0100 Subject: [PATCH] =?UTF-8?q?AP=20manageur=20V1.2=20(B=C3=AAta)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.html | 231 +++++++++++++++++++++++++++------------------------ version.json | 4 +- 2 files changed, 126 insertions(+), 109 deletions(-) diff --git a/setup.html b/setup.html index 64d47ff..3710eff 100644 --- a/setup.html +++ b/setup.html @@ -2598,6 +2598,7 @@
🎨 Options & Thème
Auto (Système)
+
Démarrage auto : Oui
Mise Ă  jour auto : Toutes les 30 min
@@ -4686,119 +4687,135 @@ } function updateRecap() { - const isEn = currentLanguage.startsWith('en'); + try { + const isEn = currentLanguage.startsWith('en'); - // Wi-Fi - const ssid = $('setupSsid') ? ($('setupSsid').value.trim() || 'Mon-WiFi-AP') : 'Mon-WiFi-AP'; - const isBridge = $('setupModeBridge') && $('setupModeBridge').checked; - const sec = $('setupSecurity') ? $('setupSecurity').value.toUpperCase() : 'WPA2'; - if ($('recapSsid')) $('recapSsid').textContent = ssid; - if ($('recapMode')) { - const modeLabel = isBridge ? (isEn ? 'Bridge Mode' : 'Mode Pont (Bridge)') : (isEn ? 'AP Mode (Router)' : 'Mode AP (Routeur/NAT)'); - $('recapMode').textContent = modeLabel + ' • ' + sec; - } - - // Admin - const adminUser = $('setupAdminUser') ? ($('setupAdminUser').value.trim() || 'admin') : 'admin'; - if ($('recapAdminUser')) $('recapAdminUser').textContent = adminUser; - if ($('recapAdminSub')) { - $('recapAdminSub').textContent = isEn ? 'Password configured (••••••••)' : 'Mot de passe défini (••••••••)'; - } - - // Notifications - const notifSt = getStep4NotificationStatus(); - const channels = [ - { id: 'notifEmailEnabled', name: 'Email' }, - { id: 'notifGotifyEnabled', name: 'Gotify' }, - { id: 'notifDiscordEnabled', name: 'Discord' }, - { id: 'notifNtfyEnabled', name: 'ntfy' }, - { id: 'notifPushbulletEnabled', name: 'Pushbullet' }, - { id: 'notifPushoverEnabled', name: 'Pushover' }, - { id: 'notifSlackEnabled', name: 'Slack' }, - { id: 'notifTelegramEnabled', name: 'Telegram' }, - { id: 'notifWebhookEnabled', name: 'Webhook' } - ]; - let activeChannels = []; - if (notifSt.ready) { - channels.forEach(c => { - if ($(c.id) && $(c.id).checked) activeChannels.push(c.name); - }); - } - if ($('recapNotif')) { - if (activeChannels.length) { - $('recapNotif').textContent = activeChannels.join(', '); - } else { - $('recapNotif').textContent = isEn ? 'Disabled' : 'Désactivées'; + // Wi-Fi + const ssid = $('setupSsid') ? ($('setupSsid').value.trim() || 'Mon-WiFi-AP') : 'Mon-WiFi-AP'; + const isBridge = $('setupModeBridge') && $('setupModeBridge').checked; + const sec = $('setupSecurity') ? $('setupSecurity').value.toUpperCase() : 'WPA2'; + if ($('recapSsid')) $('recapSsid').textContent = ssid; + if ($('recapMode')) { + const modeLabel = isBridge ? (isEn ? 'Bridge Mode' : 'Mode Pont (Bridge)') : (isEn ? 'AP Mode (Router)' : 'Mode AP (Routeur/NAT)'); + $('recapMode').textContent = modeLabel + ' • ' + sec; } - } - if ($('recapNotifSub')) { - if (notifOn && activeChannels.length) { - let evCount = 0; - const evIds = ['notifEvtNewDevice', 'notifEvtDeviceConnected', 'notifEvtDeviceDisconnected', 'notifEvtAdminLogin', 'notifEvtAdminLoginFailed', 'notifEvtDeviceBlocked', 'notifEvtSettingsChanged', 'notifEvtVpnClientConnected', 'notifEvtVpnClientDisconnected', 'notifEvtVpnProfileConnected', 'notifEvtVpnProfileDisconnected', 'notifEvtQuotaExceeded', 'notifEvtBackupSuccess', 'notifEvtBackupRemoteSuccess', 'notifEvtUpdateAvailable', 'notifEvtStatsReport']; - evIds.forEach(eid => { if ($(eid) && $(eid).checked) evCount++; }); - $('recapNotifSub').textContent = isEn ? `${activeChannels.length} channel(s) • ${evCount} alert event(s)` : `${activeChannels.length} canal(aux) • ${evCount} événement(s) d’alerte`; - } else { - $('recapNotifSub').textContent = isEn ? 'Can be configured later' : 'Modifiable ultérieurement'; - } - } - // Profils VPN - if ($('recapVpnVal')) { - if (setupVpnProfiles.length) { - $('recapVpnVal').textContent = `${setupVpnProfiles.length} ${isEn ? 'profile(s) configured' : 'profil(s) configuré(s)'}`; - if ($('recapVpnSub')) { - const names = setupVpnProfiles.map(p => p.name).join(', '); - $('recapVpnSub').textContent = names; + // Admin + const adminUser = $('setupAdminUser') ? ($('setupAdminUser').value.trim() || 'admin') : 'admin'; + if ($('recapAdminUser')) $('recapAdminUser').textContent = adminUser; + if ($('recapAdminSub')) { + $('recapAdminSub').textContent = isEn ? 'Password configured (••••••••)' : 'Mot de passe défini (••••••••)'; + } + + // Notifications + const notifSt = getStep4NotificationStatus(); + const channels = [ + { id: 'notifEmailEnabled', name: 'Email' }, + { id: 'notifGotifyEnabled', name: 'Gotify' }, + { id: 'notifDiscordEnabled', name: 'Discord' }, + { id: 'notifNtfyEnabled', name: 'ntfy' }, + { id: 'notifPushbulletEnabled', name: 'Pushbullet' }, + { id: 'notifPushoverEnabled', name: 'Pushover' }, + { id: 'notifSlackEnabled', name: 'Slack' }, + { id: 'notifTelegramEnabled', name: 'Telegram' }, + { id: 'notifWebhookEnabled', name: 'Webhook' } + ]; + let activeChannels = []; + if (notifSt.ready) { + channels.forEach(c => { + if ($(c.id) && $(c.id).checked) activeChannels.push(c.name); + }); + } + if ($('recapNotif')) { + if (activeChannels.length) { + $('recapNotif').textContent = activeChannels.join(', '); + } else { + $('recapNotif').textContent = isEn ? 'Disabled' : 'Désactivées'; } - } else { - $('recapVpnVal').textContent = isEn ? 'No profiles configured' : 'Aucun profil configuré'; - if ($('recapVpnSub')) $('recapVpnSub').textContent = isEn ? 'Direct Internet by default' : 'Internet direct par défaut'; } - } - - // Thème - const themeNamesFr = { 'auto': 'Auto (Système)', 'dark': 'Sombre', 'light': 'Clair', 'winxp': 'Windows XP', 'futuristic': 'Futuriste', 'macos': 'macOS', 'hacker': 'Hacker' }; - const themeNamesEn = { 'auto': 'Auto (System)', 'dark': 'Dark', 'light': 'Light', 'winxp': 'Windows XP', 'futuristic': 'Futuristic', 'macos': 'macOS', 'hacker': 'Hacker' }; - const themeDict = isEn ? themeNamesEn : themeNamesFr; - if ($('recapTheme')) $('recapTheme').textContent = themeDict[currentTheme] || currentTheme; - const autoOn = $('setupAutoconnect') && $('setupAutoconnect').checked; - if ($('recapAutoconnect')) { - $('recapAutoconnect').textContent = isEn ? ('Autostart: ' + (autoOn ? 'Yes' : 'No')) : ('Démarrage auto : ' + (autoOn ? 'Oui' : 'Non')); - } - - // Mise à jour automatique - if ($('recapUpdateChecker')) { - const updOn = $('setupUpdateCheckerEnabled') && $('setupUpdateCheckerEnabled').checked; - const updInterval = $('setupUpdateInterval') ? $('setupUpdateInterval').value : '1800'; - const intervalLabelsFr = { - '300': 'Toutes les 5 min', '900': 'Toutes les 15 min', '1800': 'Toutes les 30 min', - '3600': 'Toutes les heures', '7200': 'Toutes les 2 h', '21600': 'Toutes les 6 h', - '43200': 'Toutes les 12 h', '86400': 'Toutes les 24 h' - }; - const intervalLabelsEn = { - '300': 'Every 5 min', '900': 'Every 15 min', '1800': 'Every 30 min', - '3600': 'Every hour', '7200': 'Every 2 hours', '21600': 'Every 6 hours', - '43200': 'Every 12 hours', '86400': 'Every 24 hours' - }; - const intDict = isEn ? intervalLabelsEn : intervalLabelsFr; - const intervalTxt = intDict[updInterval] || (isEn ? 'Every 30 min' : 'Toutes les 30 min'); - $('recapUpdateChecker').textContent = isEn - ? ('Auto update check: ' + (updOn ? intervalTxt : 'Disabled')) - : ('Mise à jour auto : ' + (updOn ? intervalTxt : 'Désactivée')); - } - - // Sauvegardes - if ($('recapBackupSchedule')) { - const bkOn = $('setupBackupCronEnabled') && $('setupBackupCronEnabled').checked; - const bkSummary = $('setupBackupCronHuman') ? $('setupBackupCronHuman').textContent.replace(/^[📅⚠️]\s*/, '') : ''; - const bkRet = $('setupBackupCronRetention')?.value || '7'; - if (bkOn) { - $('recapBackupSchedule').textContent = isEn - ? `Backups: Enabled (${bkSummary}, retention ${bkRet}d)` - : `Sauvegardes : Activées (${bkSummary}, rétention ${bkRet}j)`; - } else { - $('recapBackupSchedule').textContent = isEn ? 'Backups: Disabled' : 'Sauvegardes : Désactivées'; + if ($('recapNotifSub')) { + if (activeChannels.length) { + let evCount = 0; + const evIds = ['notifEvtNewDevice', 'notifEvtDeviceConnected', 'notifEvtDeviceDisconnected', 'notifEvtAdminLogin', 'notifEvtAdminLoginFailed', 'notifEvtDeviceBlocked', 'notifEvtSettingsChanged', 'notifEvtVpnClientConnected', 'notifEvtVpnClientDisconnected', 'notifEvtVpnProfileConnected', 'notifEvtVpnProfileDisconnected', 'notifEvtQuotaExceeded', 'notifEvtBackupSuccess', 'notifEvtBackupRemoteSuccess', 'notifEvtUpdateAvailable', 'notifEvtStatsReport']; + evIds.forEach(eid => { if ($(eid) && $(eid).checked) evCount++; }); + $('recapNotifSub').textContent = isEn ? `${activeChannels.length} channel(s) • ${evCount} alert event(s)` : `${activeChannels.length} canal(aux) • ${evCount} événement(s) d’alerte`; + } else { + $('recapNotifSub').textContent = isEn ? 'Can be configured later' : 'Modifiable ultérieurement'; + } } + + // Profils VPN + if ($('recapVpnVal')) { + if (setupVpnProfiles.length) { + $('recapVpnVal').textContent = `${setupVpnProfiles.length} ${isEn ? 'profile(s) configured' : 'profil(s) configuré(s)'}`; + if ($('recapVpnSub')) { + const names = setupVpnProfiles.map(p => p.name).join(', '); + $('recapVpnSub').textContent = names; + } + } else { + $('recapVpnVal').textContent = isEn ? 'No profiles configured' : 'Aucun profil configuré'; + if ($('recapVpnSub')) $('recapVpnSub').textContent = isEn ? 'Direct Internet by default' : 'Internet direct par défaut'; + } + } + + // Thème & Options + const themeNamesFr = { 'auto': 'Auto (Système)', 'dark': 'Sombre', 'light': 'Clair', 'winxp': 'Windows XP', 'futuristic': 'Futuriste', 'macos': 'macOS', 'hacker': 'Hacker' }; + const themeNamesEn = { 'auto': 'Auto (System)', 'dark': 'Dark', 'light': 'Light', 'winxp': 'Windows XP', 'futuristic': 'Futuristic', 'macos': 'macOS', 'hacker': 'Hacker' }; + const themeDict = isEn ? themeNamesEn : themeNamesFr; + if ($('recapTheme')) $('recapTheme').textContent = themeDict[currentTheme] || currentTheme; + + // Titre personnalisé de l'application + if ($('recapAppName')) { + const appTitle = $('setupAppName') ? $('setupAppName').value.trim() : ''; + if (appTitle) { + $('recapAppName').style.display = 'block'; + $('recapAppName').textContent = (isEn ? 'App title: ' : 'Titre de l’application : ') + appTitle; + } else { + $('recapAppName').style.display = 'none'; + } + } + + const autoOn = $('setupAutoconnect') && $('setupAutoconnect').checked; + if ($('recapAutoconnect')) { + $('recapAutoconnect').textContent = isEn ? ('Autostart: ' + (autoOn ? 'Yes' : 'No')) : ('Démarrage auto : ' + (autoOn ? 'Oui' : 'Non')); + } + + // Mise à jour automatique + if ($('recapUpdateChecker')) { + const updOn = $('setupUpdateCheckerEnabled') && $('setupUpdateCheckerEnabled').checked; + const updInterval = $('setupUpdateInterval') ? $('setupUpdateInterval').value : '1800'; + const intervalLabelsFr = { + '300': 'Toutes les 5 min', '900': 'Toutes les 15 min', '1800': 'Toutes les 30 min', + '3600': 'Toutes les heures', '7200': 'Toutes les 2 h', '21600': 'Toutes les 6 h', + '43200': 'Toutes les 12 h', '86400': 'Toutes les 24 h' + }; + const intervalLabelsEn = { + '300': 'Every 5 min', '900': 'Every 15 min', '1800': 'Every 30 min', + '3600': 'Every hour', '7200': 'Every 2 hours', '21600': 'Every 6 hours', + '43200': 'Every 12 hours', '86400': 'Every 24 hours' + }; + const intDict = isEn ? intervalLabelsEn : intervalLabelsFr; + const intervalTxt = intDict[updInterval] || (isEn ? 'Every 30 min' : 'Toutes les 30 min'); + $('recapUpdateChecker').textContent = isEn + ? ('Auto update check: ' + (updOn ? intervalTxt : 'Disabled')) + : ('Mise à jour auto : ' + (updOn ? intervalTxt : 'Désactivée')); + } + + // Sauvegardes + if ($('recapBackupSchedule')) { + const bkOn = $('setupBackupCronEnabled') && $('setupBackupCronEnabled').checked; + const bkSummary = ($('setupBackupCronHuman') ? $('setupBackupCronHuman').textContent.replace(/^[📅⚠️]\s*/, '').trim() : '') || ($('setupBackupCronExpr')?.value || '0 3 * * *'); + const bkRet = $('setupBackupCronRetention')?.value || '7'; + if (bkOn) { + $('recapBackupSchedule').textContent = isEn + ? `Backups: Enabled (${bkSummary}, retention ${bkRet}d)` + : `Sauvegardes : Activées (${bkSummary}, rétention ${bkRet}j)`; + } else { + $('recapBackupSchedule').textContent = isEn ? 'Backups: Disabled' : 'Sauvegardes : Désactivées'; + } + } + } catch (err) { + console.warn('Error updating setup recap:', err); } } diff --git a/version.json b/version.json index 6afa1f8..ad989b1 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { "version": "V1.2 (Bêta)", - "commit": "e905ce909768b6edbc136cebff3e15c7da86ba96", - "build_date": "2026-11-23T16:39:51Z" + "commit": "7fb398090df4b37af7a945dcbeb15b7cb6aa1bc7", + "build_date": "2026-11-23T17:09:26Z" } \ No newline at end of file