AP manageur V1.2 (Bêta)

This commit is contained in:
yoannmultigaming committed 2026-11-23 16:07:24 +01:00
1 parent ff840ae03e
commit a53fa69034
5 files changed
+156 -4

No files matched your search

+133 -2
View File
@@ -3387,7 +3387,7 @@
<input id="authSettingsUsername" type="text" maxlength="32"> <input id="authSettingsUsername" type="text" maxlength="32">
<label class="label" for="authSettingsPassword" data-i18n="settings_admin_new_pwd_label">Nouveau mot de <label class="label" for="authSettingsPassword" data-i18n="settings_admin_new_pwd_label">Nouveau mot de
passe</label> passe</label>
<div style="display:flex;gap:8px;margin:7px 0 16px"> <div style="display:flex;gap:8px;margin:7px 0 6px">
<input id="authSettingsPassword" type="password" minlength="8" maxlength="128" <input id="authSettingsPassword" type="password" minlength="8" maxlength="128"
placeholder="Nouveau mot de passe" data-i18n-placeholder="placeholder_new_pwd" style="margin:0"> placeholder="Nouveau mot de passe" data-i18n-placeholder="placeholder_new_pwd" style="margin:0">
<button id="toggleAuthSettingsPassword" class="secondary" type="button" <button id="toggleAuthSettingsPassword" class="secondary" type="button"
@@ -3399,9 +3399,19 @@
<circle cx="12" cy="12" r="3" /> <circle cx="12" cy="12" r="3" />
</svg></button> </svg></button>
</div> </div>
<div id="pwdStrengthWrap_new" style="margin:0 0 16px;display:none">
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:4px;font-size:11.5px">
<span class="muted" data-i18n="pwd_strength_label">Force du mot de passe :</span>
<span id="pwdStrengthText_new" style="font-weight:700"></span>
</div>
<div style="height:4px;background:var(--line);border-radius:4px;overflow:hidden">
<div id="pwdStrengthBar_new" style="height:100%;width:0%;border-radius:4px;transition:width .25s ease, background-color .25s ease"></div>
</div>
</div>
<label class="label" for="authSettingsPasswordConfirm" data-i18n="settings_admin_confirm_pwd_label">Confirmation <label class="label" for="authSettingsPasswordConfirm" data-i18n="settings_admin_confirm_pwd_label">Confirmation
du mot de passe</label> du mot de passe</label>
<div style="display:flex;gap:8px;margin:7px 0 16px"> <div style="display:flex;gap:8px;margin:7px 0 6px">
<input id="authSettingsPasswordConfirm" type="password" minlength="8" maxlength="128" <input id="authSettingsPasswordConfirm" type="password" minlength="8" maxlength="128"
placeholder="Confirmation du mot de passe" data-i18n-placeholder="placeholder_pwd_confirm" style="margin:0"> placeholder="Confirmation du mot de passe" data-i18n-placeholder="placeholder_pwd_confirm" style="margin:0">
<button id="toggleAuthSettingsPasswordConfirm" class="secondary" type="button" <button id="toggleAuthSettingsPasswordConfirm" class="secondary" type="button"
@@ -3413,6 +3423,18 @@
<circle cx="12" cy="12" r="3" /> <circle cx="12" cy="12" r="3" />
</svg></button> </svg></button>
</div> </div>
<div id="pwdStrengthWrap_confirm" style="margin:0 0 16px;display:none">
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:4px;font-size:11.5px">
<span class="muted" data-i18n="pwd_strength_label">Force du mot de passe :</span>
<div style="display:flex;align-items:center;gap:6px">
<span id="pwdMatchText_confirm" style="font-size:11px;font-weight:600"></span>
<span id="pwdStrengthText_confirm" style="font-weight:700"></span>
</div>
</div>
<div style="height:4px;background:var(--line);border-radius:4px;overflow:hidden">
<div id="pwdStrengthBar_confirm" style="height:100%;width:0%;border-radius:4px;transition:width .25s ease, background-color .25s ease"></div>
</div>
</div>
<label class="label" for="authCurrentPassword" data-i18n="settings_admin_current_pwd_label">Mot de passe <label class="label" for="authCurrentPassword" data-i18n="settings_admin_current_pwd_label">Mot de passe
actuel</label> actuel</label>
<div style="display:flex;gap:8px;margin:7px 0 16px"> <div style="display:flex;gap:8px;margin:7px 0 16px">
@@ -7859,6 +7881,13 @@
} }
} }
if (typeof updatePasswordStrengthIndicator === 'function') {
try {
updatePasswordStrengthIndicator('new');
updatePasswordStrengthIndicator('confirm');
} catch (_) { }
}
// La sauvegarde en base de données se fait exclusivement via le bouton 'Enregistrer la personnalisation' // La sauvegarde en base de données se fait exclusivement via le bouton 'Enregistrer la personnalisation'
} }
@@ -13551,6 +13580,107 @@ ${vpnBadgeTopo}
twoFaCurrInput.addEventListener('input', () => { authCurrInput.value = twoFaCurrInput.value; }); twoFaCurrInput.addEventListener('input', () => { authCurrInput.value = twoFaCurrInput.value; });
} }
function evaluatePasswordStrength(pwd) {
if (!pwd) return null;
const len = pwd.length;
const hasLower = /[a-z]/.test(pwd);
const hasUpper = /[A-Z]/.test(pwd);
const hasDigit = /[0-9]/.test(pwd);
const hasSpecial = /[^a-zA-Z0-9]/.test(pwd);
let score = 0;
if (len >= 8) score++;
if (len >= 12) score++;
if (hasLower && hasUpper) score++;
if (hasDigit) score++;
if (hasSpecial) score++;
if (len < 8 || score <= 1) {
return {
tier: 'weak',
label: t('pwd_strength_weak', 'Faible'),
percent: 25,
color: 'var(--red, #ef4444)'
};
} else if (score === 2) {
return {
tier: 'fair',
label: t('pwd_strength_fair', 'Passable'),
percent: 50,
color: '#f59e0b'
};
} else if (score === 3 || score === 4) {
return {
tier: 'strong',
label: t('pwd_strength_strong', 'Fort'),
percent: 75,
color: 'var(--green, #10b981)'
};
} else {
return {
tier: 'extreme',
label: t('pwd_strength_extreme', 'Extrême'),
percent: 100,
color: '#8b5cf6'
};
}
}
function updatePasswordStrengthIndicator(type) {
const isConfirm = (type === 'confirm');
const input = isConfirm ? $('authSettingsPasswordConfirm') : $('authSettingsPassword');
const wrap = isConfirm ? $('pwdStrengthWrap_confirm') : $('pwdStrengthWrap_new');
const bar = isConfirm ? $('pwdStrengthBar_confirm') : $('pwdStrengthBar_new');
const text = isConfirm ? $('pwdStrengthText_confirm') : $('pwdStrengthText_new');
const matchText = isConfirm ? $('pwdMatchText_confirm') : null;
if (!input || !wrap || !bar || !text) return;
const val = input.value;
if (!val) {
wrap.style.display = 'none';
bar.style.width = '0%';
text.textContent = '';
if (matchText) matchText.textContent = '';
return;
}
wrap.style.display = 'block';
const res = evaluatePasswordStrength(val);
bar.style.width = res.percent + '%';
bar.style.backgroundColor = res.color;
text.textContent = res.label;
text.style.color = res.color;
if (isConfirm && matchText) {
const mainVal = $('authSettingsPassword') ? $('authSettingsPassword').value : '';
if (mainVal) {
if (val === mainVal) {
matchText.textContent = t('pwd_match_yes', '✓ Identique');
matchText.style.color = 'var(--green, #10b981)';
} else {
matchText.textContent = t('pwd_match_no', '⚠️ Différent');
matchText.style.color = 'var(--red, #ef4444)';
}
} else {
matchText.textContent = '';
}
}
}
if ($('authSettingsPassword')) {
$('authSettingsPassword').addEventListener('input', () => {
updatePasswordStrengthIndicator('new');
if ($('authSettingsPasswordConfirm') && $('authSettingsPasswordConfirm').value) {
updatePasswordStrengthIndicator('confirm');
}
});
}
if ($('authSettingsPasswordConfirm')) {
$('authSettingsPasswordConfirm').addEventListener('input', () => {
updatePasswordStrengthIndicator('confirm');
});
}
$('apControl').onclick = () => controlAp(status.active ? 'stop' : 'start'); $('apControl').onclick = () => controlAp(status.active ? 'stop' : 'start');
$('apRestart').onclick = () => { if (status && status.active) controlAp('restart'); }; $('apRestart').onclick = () => { if (status && status.active) controlAp('restart'); };
@@ -13843,6 +13973,7 @@ ${vpnBadgeTopo}
const data = await response.json(); if (!response.ok) throw Error(data.error || 'Modification refusée'); const data = await response.json(); if (!response.ok) throw Error(data.error || 'Modification refusée');
message.textContent = tMsg(data.message || t('auth_creds_updated_success', 'Identifiants modifiés avec succès !')); message.textContent = tMsg(data.message || t('auth_creds_updated_success', 'Identifiants modifiés avec succès !'));
$('authCurrentPassword').value = ''; $('authSettingsPassword').value = ''; $('authSettingsPasswordConfirm').value = ''; $('authCurrentPassword').value = ''; $('authSettingsPassword').value = ''; $('authSettingsPasswordConfirm').value = '';
updatePasswordStrengthIndicator('new'); updatePasswordStrengthIndicator('confirm');
if (typeof loadAdminUser === 'function') await loadAdminUser(); if (typeof loadAdminUser === 'function') await loadAdminUser();
} catch (e) { message.textContent = tErr(e.message); } } catch (e) { message.textContent = tErr(e.message); }
}); });
+7
View File
@@ -1266,6 +1266,13 @@ window.I18N['en-gb'] = {
"modal_remote_drive_title": "Remote storage files (Drive)", "modal_remote_drive_title": "Remote storage files (Drive)",
"btn_refresh_drive": "Refresh drive", "btn_refresh_drive": "Refresh drive",
"btn_delete_all_remote_drive": "Delete all", "btn_delete_all_remote_drive": "Delete all",
"pwd_strength_label": "Password strength:",
"pwd_strength_weak": "Weak",
"pwd_strength_fair": "Fair",
"pwd_strength_strong": "Strong",
"pwd_strength_extreme": "Extreme",
"pwd_match_yes": "✓ Matching",
"pwd_match_no": "⚠️ Mismatch",
"remote_drive_loading": "Connecting and retrieving files from drive…", "remote_drive_loading": "Connecting and retrieving files from drive…",
"remote_drive_empty": "No backup files found on remote storage.", "remote_drive_empty": "No backup files found on remote storage.",
"backup_confirm_remote_delete": "Permanently delete backup \"{file}\" from remote storage (Drive)?\n\nWarning, this action cannot be undone.", "backup_confirm_remote_delete": "Permanently delete backup \"{file}\" from remote storage (Drive)?\n\nWarning, this action cannot be undone.",
+7
View File
@@ -1266,6 +1266,13 @@ window.I18N['en-us'] = {
"modal_remote_drive_title": "Remote storage files (Drive)", "modal_remote_drive_title": "Remote storage files (Drive)",
"btn_refresh_drive": "Refresh drive", "btn_refresh_drive": "Refresh drive",
"btn_delete_all_remote_drive": "Delete all", "btn_delete_all_remote_drive": "Delete all",
"pwd_strength_label": "Password strength:",
"pwd_strength_weak": "Weak",
"pwd_strength_fair": "Fair",
"pwd_strength_strong": "Strong",
"pwd_strength_extreme": "Extreme",
"pwd_match_yes": "✓ Matching",
"pwd_match_no": "⚠️ Mismatch",
"remote_drive_loading": "Connecting and retrieving files from drive…", "remote_drive_loading": "Connecting and retrieving files from drive…",
"remote_drive_empty": "No backup files found on remote storage.", "remote_drive_empty": "No backup files found on remote storage.",
"backup_confirm_remote_delete": "Permanently delete backup \"{file}\" from remote storage (Drive)?\n\nWarning, this action cannot be undone.", "backup_confirm_remote_delete": "Permanently delete backup \"{file}\" from remote storage (Drive)?\n\nWarning, this action cannot be undone.",
+7
View File
@@ -1266,6 +1266,13 @@ window.I18N['fr'] = {
"modal_remote_drive_title": "Fichiers du stockage distant (Drive)", "modal_remote_drive_title": "Fichiers du stockage distant (Drive)",
"btn_refresh_drive": "Actualiser le drive", "btn_refresh_drive": "Actualiser le drive",
"btn_delete_all_remote_drive": "Tout supprimer", "btn_delete_all_remote_drive": "Tout supprimer",
"pwd_strength_label": "Force du mot de passe :",
"pwd_strength_weak": "Faible",
"pwd_strength_fair": "Passable",
"pwd_strength_strong": "Fort",
"pwd_strength_extreme": "Extrême",
"pwd_match_yes": "✓ Identique",
"pwd_match_no": "⚠️ Différent",
"remote_drive_loading": "Connexion et récupération des fichiers sur le drive…", "remote_drive_loading": "Connexion et récupération des fichiers sur le drive…",
"remote_drive_empty": "Aucun fichier de sauvegarde trouvé sur le stockage distant.", "remote_drive_empty": "Aucun fichier de sauvegarde trouvé sur le stockage distant.",
"backup_confirm_remote_delete": "Supprimer définitivement la sauvegarde « {file} » du stockage distant (Drive) ?\n\nAttention, cette action est irréversible.", "backup_confirm_remote_delete": "Supprimer définitivement la sauvegarde « {file} » du stockage distant (Drive) ?\n\nAttention, cette action est irréversible.",
+2 -2
View File
@@ -1,5 +1,5 @@
{ {
"version": "V1.2 (Bêta)", "version": "V1.2 (Bêta)",
"commit": "188497ae7928164807007ba9f0837d529aa5527e", "commit": "ff840ae03ed9362f1aeffa039ba70f6e89cef18c",
"build_date": "2026-11-23T12:30:17Z" "build_date": "2026-11-23T14:36:06Z"
} }