AP manageur V1.2 (Bêta)
This commit is contained in:
1 parent
e26c08e41d
commit
9d17156a97
2 files changed
+217
-6
No files matched your search
+215
-4
@@ -1321,23 +1321,44 @@
|
||||
|
||||
<label class="label" for="setupPassword" data-i18n="step2_pwd_label">Mot de passe Wi-Fi (Clé de sécurité WPA)
|
||||
*</label>
|
||||
<div style="display:flex;gap:8px;margin-bottom:16px">
|
||||
<div style="display:flex;gap:8px;margin-bottom:6px">
|
||||
<input id="setupPassword" type="password" minlength="8" maxlength="63" placeholder="8 caractères minimum"
|
||||
data-i18n-placeholder="step2_pwd_ph" style="margin:0">
|
||||
<button class="secondary pwd-eye-btn" type="button" onclick="togglePasswordVisibility('setupPassword', this)"
|
||||
title="Afficher" aria-label="Afficher" data-i18n-title="toggle_pwd_show"
|
||||
data-i18n-aria-label="toggle_pwd_show">👁️</button>
|
||||
</div>
|
||||
<div id="pwdStrengthWrap_setupWifi" 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_setupWifi" style="font-weight:700"></span>
|
||||
</div>
|
||||
<div style="height:4px;background:var(--line);border-radius:4px;overflow:hidden">
|
||||
<div id="pwdStrengthBar_setupWifi" style="height:100%;width:0%;border-radius:4px;transition:width .25s ease, background-color .25s ease"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="label" for="setupPasswordConfirm" data-i18n="step2_pwd_confirm_label">Confirmation du mot de
|
||||
passe Wi-Fi *</label>
|
||||
<div style="display:flex;gap:8px;margin-bottom:16px">
|
||||
<div style="display:flex;gap:8px;margin-bottom:6px">
|
||||
<input id="setupPasswordConfirm" type="password" minlength="8" maxlength="63"
|
||||
placeholder="Confirmation identique" data-i18n-placeholder="step2_pwd_confirm_ph" style="margin:0">
|
||||
<button class="secondary pwd-eye-btn" type="button" onclick="togglePasswordVisibility('setupPasswordConfirm', this)"
|
||||
title="Afficher" aria-label="Afficher" data-i18n-title="toggle_pwd_show"
|
||||
data-i18n-aria-label="toggle_pwd_show">👁️</button>
|
||||
</div>
|
||||
<div id="pwdStrengthWrap_setupWifiConfirm" 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_setupWifiConfirm" style="font-size:11px;font-weight:600"></span>
|
||||
<span id="pwdStrengthText_setupWifiConfirm" style="font-weight:700"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height:4px;background:var(--line);border-radius:4px;overflow:hidden">
|
||||
<div id="pwdStrengthBar_setupWifiConfirm" style="height:100%;width:0%;border-radius:4px;transition:width .25s ease, background-color .25s ease"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="label" for="setupSecurity" data-i18n="step2_sec_label">Type de sécurité Wi-Fi</label>
|
||||
<select id="setupSecurity">
|
||||
@@ -1421,17 +1442,26 @@
|
||||
|
||||
<label class="label" for="setupAdminPassword" data-i18n="step3_pwd_label">Mot de passe administrateur
|
||||
*</label>
|
||||
<div style="display:flex;gap:8px;margin-bottom:16px">
|
||||
<div style="display:flex;gap:8px;margin-bottom:6px">
|
||||
<input id="setupAdminPassword" type="password" minlength="4" maxlength="128"
|
||||
placeholder="Mot de passe robuste" data-i18n-placeholder="step3_pwd_ph" style="margin:0">
|
||||
<button class="secondary pwd-eye-btn" type="button" onclick="togglePasswordVisibility('setupAdminPassword', this)"
|
||||
title="Afficher" aria-label="Afficher" data-i18n-title="toggle_pwd_show"
|
||||
data-i18n-aria-label="toggle_pwd_show">👁️</button>
|
||||
</div>
|
||||
<div id="pwdStrengthWrap_setupAdmin" 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_setupAdmin" style="font-weight:700"></span>
|
||||
</div>
|
||||
<div style="height:4px;background:var(--line);border-radius:4px;overflow:hidden">
|
||||
<div id="pwdStrengthBar_setupAdmin" style="height:100%;width:0%;border-radius:4px;transition:width .25s ease, background-color .25s ease"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="label" for="setupAdminPasswordConfirm" data-i18n="step3_pwd_confirm_label">Confirmation du mot
|
||||
de passe *</label>
|
||||
<div style="display:flex;gap:8px;margin-bottom:16px">
|
||||
<div style="display:flex;gap:8px;margin-bottom:6px">
|
||||
<input id="setupAdminPasswordConfirm" type="password" minlength="4" maxlength="128"
|
||||
placeholder="Ressaisissez le mot de passe" data-i18n-placeholder="step3_pwd_confirm_ph" style="margin:0">
|
||||
<button class="secondary pwd-eye-btn" type="button"
|
||||
@@ -1439,6 +1469,18 @@
|
||||
title="Afficher" aria-label="Afficher" data-i18n-title="toggle_pwd_show"
|
||||
data-i18n-aria-label="toggle_pwd_show">👁️</button>
|
||||
</div>
|
||||
<div id="pwdStrengthWrap_setupAdminConfirm" 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_setupAdminConfirm" style="font-size:11px;font-weight:600"></span>
|
||||
<span id="pwdStrengthText_setupAdminConfirm" style="font-weight:700"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="height:4px;background:var(--line);border-radius:4px;overflow:hidden">
|
||||
<div id="pwdStrengthBar_setupAdminConfirm" style="height:100%;width:0%;border-radius:4px;transition:width .25s ease, background-color .25s ease"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="notice" style="margin-top:8px" data-i18n-html="step3_security_note">
|
||||
🔐 <strong>Sécurité renforcée</strong> : Une fois le compte créé, vous pourrez activer l'authentification à
|
||||
@@ -3016,6 +3058,13 @@
|
||||
'step3_pwd_ph': 'Mot de passe robuste',
|
||||
'step3_pwd_confirm_label': 'Confirmation du mot de passe *',
|
||||
'step3_pwd_confirm_ph': 'Ressaisissez le mot de passe',
|
||||
'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',
|
||||
'step3_security_note': '🔐 <strong>Sécurité renforcée</strong> : Une fois le compte créé, vous pourrez activer l\'authentification à double facteur (2FA TOTP) et enregistrer des clés Passkeys (WebAuthn / Empreinte) dans les Paramètres.',
|
||||
|
||||
'step4_title': 'Notifications & Alertes',
|
||||
@@ -3176,6 +3225,13 @@
|
||||
'step3_pwd_ph': 'Strong password',
|
||||
'step3_pwd_confirm_label': 'Confirm Password *',
|
||||
'step3_pwd_confirm_ph': 'Re-enter your password',
|
||||
'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': '⚠️ Different',
|
||||
'step3_security_note': '🔐 <strong>Enhanced Security</strong>: Once created, you can enable Two-Factor Authentication (2FA TOTP) and register Passkeys (WebAuthn / Fingerprint) in Settings.',
|
||||
|
||||
'step4_title': 'Notifications & Alerts',
|
||||
@@ -3336,6 +3392,13 @@
|
||||
'step3_pwd_ph': 'Strong password',
|
||||
'step3_pwd_confirm_label': 'Confirm Password *',
|
||||
'step3_pwd_confirm_ph': 'Re-enter your password',
|
||||
'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': '⚠️ Different',
|
||||
'step3_security_note': '🔐 <strong>Enhanced Security</strong>: Once created, you can enable Two-Factor Authentication (2FA TOTP) and register Passkeys (WebAuthn / Fingerprint) in Settings.',
|
||||
|
||||
'step4_title': 'Notifications & Alerts',
|
||||
@@ -3518,6 +3581,13 @@
|
||||
if (currentStep === 6) {
|
||||
updateRecap();
|
||||
}
|
||||
|
||||
if (typeof updatePasswordStrengthIndicator === 'function') {
|
||||
updatePasswordStrengthIndicator('setupWifi');
|
||||
updatePasswordStrengthIndicator('setupWifiConfirm');
|
||||
updatePasswordStrengthIndicator('setupAdmin');
|
||||
updatePasswordStrengthIndicator('setupAdminConfirm');
|
||||
}
|
||||
}
|
||||
|
||||
function togglePasswordVisibility(id, btn) {
|
||||
@@ -3540,6 +3610,146 @@
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
let input, wrap, bar, text, matchText = null, mainInput = null;
|
||||
let isConfirm = false;
|
||||
|
||||
if (type === 'setupWifi') {
|
||||
input = $('setupPassword');
|
||||
wrap = $('pwdStrengthWrap_setupWifi');
|
||||
bar = $('pwdStrengthBar_setupWifi');
|
||||
text = $('pwdStrengthText_setupWifi');
|
||||
} else if (type === 'setupWifiConfirm') {
|
||||
input = $('setupPasswordConfirm');
|
||||
mainInput = $('setupPassword');
|
||||
wrap = $('pwdStrengthWrap_setupWifiConfirm');
|
||||
bar = $('pwdStrengthBar_setupWifiConfirm');
|
||||
text = $('pwdStrengthText_setupWifiConfirm');
|
||||
matchText = $('pwdMatchText_setupWifiConfirm');
|
||||
isConfirm = true;
|
||||
} else if (type === 'setupAdmin') {
|
||||
input = $('setupAdminPassword');
|
||||
wrap = $('pwdStrengthWrap_setupAdmin');
|
||||
bar = $('pwdStrengthBar_setupAdmin');
|
||||
text = $('pwdStrengthText_setupAdmin');
|
||||
} else if (type === 'setupAdminConfirm') {
|
||||
input = $('setupAdminPasswordConfirm');
|
||||
mainInput = $('setupAdminPassword');
|
||||
wrap = $('pwdStrengthWrap_setupAdminConfirm');
|
||||
bar = $('pwdStrengthBar_setupAdminConfirm');
|
||||
text = $('pwdStrengthText_setupAdminConfirm');
|
||||
matchText = $('pwdMatchText_setupAdminConfirm');
|
||||
isConfirm = true;
|
||||
}
|
||||
|
||||
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 = mainInput ? mainInput.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 = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initPasswordStrengthListeners() {
|
||||
if ($('setupPassword')) {
|
||||
$('setupPassword').addEventListener('input', () => {
|
||||
updatePasswordStrengthIndicator('setupWifi');
|
||||
if ($('setupPasswordConfirm') && $('setupPasswordConfirm').value) {
|
||||
updatePasswordStrengthIndicator('setupWifiConfirm');
|
||||
}
|
||||
});
|
||||
}
|
||||
if ($('setupPasswordConfirm')) {
|
||||
$('setupPasswordConfirm').addEventListener('input', () => {
|
||||
updatePasswordStrengthIndicator('setupWifiConfirm');
|
||||
});
|
||||
}
|
||||
if ($('setupAdminPassword')) {
|
||||
$('setupAdminPassword').addEventListener('input', () => {
|
||||
updatePasswordStrengthIndicator('setupAdmin');
|
||||
if ($('setupAdminPasswordConfirm') && $('setupAdminPasswordConfirm').value) {
|
||||
updatePasswordStrengthIndicator('setupAdminConfirm');
|
||||
}
|
||||
});
|
||||
}
|
||||
if ($('setupAdminPasswordConfirm')) {
|
||||
$('setupAdminPasswordConfirm').addEventListener('input', () => {
|
||||
updatePasswordStrengthIndicator('setupAdminConfirm');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onModeChange() {
|
||||
const isBridge = $('setupModeBridge') && $('setupModeBridge').checked;
|
||||
const bBox = $('setupBridgeBlock');
|
||||
@@ -5117,6 +5327,7 @@
|
||||
}
|
||||
|
||||
async function initSetupPage() {
|
||||
initPasswordStrengthListeners();
|
||||
setSetupLanguage(currentLanguage);
|
||||
setSetupTheme(currentTheme);
|
||||
initStatsReportTimeSelects();
|
||||
|
||||
Reference in new issue
Block a user