AP manageur V1.2 (Bêta)

This commit is contained in:
yoannmultigaming committed 2026-11-23 18:27:54 +01:00
1 parent 7fb398090d
commit 6a6cfffca2
2 files changed
+126 -109

No files matched your search

+124 -107
View File
@@ -2598,6 +2598,7 @@
<div class="recap-box-title"><span>🎨</span> <span data-i18n="recap_options_title">Options & Thème</span>
</div>
<div class="recap-box-val" id="recapTheme">Auto (Système)</div>
<div class="recap-box-sub" id="recapAppName" style="display:none"></div>
<div class="recap-box-sub" id="recapAutoconnect" data-i18n="recap_auto_start_yes">Démarrage auto : Oui
</div>
<div class="recap-box-sub" id="recapUpdateChecker">Mise à jour auto : Toutes les 30 min</div>
@@ -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);
}
}
+2 -2
View File
@@ -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"
}