APmanageur Wi-Fi V1.0
This commit is contained in:
1 parent
a711982133
commit
2e7b5a4963
4 files changed
+89
-61
No files matched your search
+86
-61
@@ -437,6 +437,16 @@
|
||||
color: var(--blue-text, #071326);
|
||||
}
|
||||
|
||||
button.backup-prov-btn,
|
||||
.backup-prov-btn,
|
||||
button.backup-prov-btn[style*="var(--blue)"],
|
||||
button.backup-prov-btn:hover {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
button.backup-prov-btn span {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
#btnAuthPasskey {
|
||||
border: 1px solid rgba(56, 189, 248, 0.4);
|
||||
background: rgba(56, 189, 248, 0.08);
|
||||
@@ -5021,60 +5031,63 @@
|
||||
</div>
|
||||
<label style="display:inline-flex;align-items:center;gap:10px;cursor:pointer;font-weight:600;user-select:none">
|
||||
<span data-i18n="backup_cron_enable">Activer la planification</span>
|
||||
<input type="checkbox" id="backupCronEnabled" onchange="onBackupCronToggle()">
|
||||
<input type="checkbox" id="backupCronEnabled" onchange="onBackupCronToggle(true)">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="backupCronFields" style="display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin-top:12px">
|
||||
<div>
|
||||
<label class="label" for="backupCronDay" data-i18n="backup_cron_day_label">Fréquence / Jour</label>
|
||||
<select id="backupCronDay" onchange="syncBackupCronFromSelects()">
|
||||
<option value="*" data-i18n="stats_cron_day_all_short">Tous les jours</option>
|
||||
<option value="1-5" data-i18n="stats_cron_day_workdays_short">Jours ouvrés (Lun-Ven)</option>
|
||||
<option value="6,7" data-i18n="stats_cron_day_weekend_short">Week-end (Sam-Dim)</option>
|
||||
<option value="1" data-i18n="stats_cron_day_mon">Chaque Lundi</option>
|
||||
<option value="2" data-i18n="stats_cron_day_tue">Chaque Mardi</option>
|
||||
<option value="3" data-i18n="stats_cron_day_wed">Chaque Mercredi</option>
|
||||
<option value="4" data-i18n="stats_cron_day_thu">Chaque Jeudi</option>
|
||||
<option value="5" data-i18n="stats_cron_day_fri">Chaque Vendredi</option>
|
||||
<option value="6" data-i18n="stats_cron_day_sat">Chaque Samedi</option>
|
||||
<option value="0" data-i18n="stats_cron_day_sun">Chaque Dimanche</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="backupCronHour" data-i18n="backup_cron_hour_label">Heure</label>
|
||||
<select id="backupCronHour" onchange="syncBackupCronFromSelects()"></select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="backupCronMinute" data-i18n="backup_cron_min_label">Minute</label>
|
||||
<select id="backupCronMinute" onchange="syncBackupCronFromSelects()"></select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="backupCronRetention" data-i18n="backup_cron_retention_label">Rétention (0 = illimité)</label>
|
||||
<input id="backupCronRetention" type="number" min="0" max="365" value="7">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end;margin-top:12px">
|
||||
<div>
|
||||
<label class="label" for="backupCronExpr" data-i18n="backup_cron_expr_label">Expression Cron (minute heure jour mois jour_semaine)</label>
|
||||
<input id="backupCronExpr" type="text" value="0 3 * * *" placeholder="0 3 * * *" style="font-family:monospace;margin-bottom:0" oninput="updateBackupCronSummary()">
|
||||
</div>
|
||||
<button id="btnSaveBackupSchedule" type="button" onclick="saveBackupSchedule()" data-i18n="backup_cron_save_btn">
|
||||
💾 Enregistrer
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div style="display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-top:10px">
|
||||
<div style="display:flex;align-items:center;gap:6px;flex-wrap:wrap">
|
||||
<span id="backupCronHuman" class="pill pill-blue pill-no-dot" style="font-size:12px">📅 Tous les jours à 03:00</span>
|
||||
<button type="button" class="secondary" style="padding:3px 9px;font-size:11px" onclick="applyBackupCronPreset('0 3 * * *','*',3,0)" data-i18n="backup_preset_daily">Chaque nuit 03:00</button>
|
||||
<button type="button" class="secondary" style="padding:3px 9px;font-size:11px" onclick="applyBackupCronPreset('0 4 * * 0','0',4,0)" data-i18n="backup_preset_weekly">Dimanche 04:00</button>
|
||||
<button type="button" class="secondary" style="padding:3px 9px;font-size:11px" onclick="applyBackupCronPreset('0 */6 * * *','*','*',0)" data-i18n="backup_preset_6h">Toutes les 6h</button>
|
||||
</div>
|
||||
<span id="backupCronLastRun" class="muted" style="font-size:12px"></span>
|
||||
</div>
|
||||
<div id="backupScheduleMsg" style="margin-top:10px;font-size:12px;display:none;padding:8px 12px;border-radius:6px"></div>
|
||||
|
||||
<div id="backupCronBody" style="display:none">
|
||||
<div id="backupCronFields" style="display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin-top:12px">
|
||||
<div>
|
||||
<label class="label" for="backupCronDay" data-i18n="backup_cron_day_label">Fréquence / Jour</label>
|
||||
<select id="backupCronDay" onchange="syncBackupCronFromSelects()">
|
||||
<option value="*" data-i18n="stats_cron_day_all_short">Tous les jours</option>
|
||||
<option value="1-5" data-i18n="stats_cron_day_workdays_short">Jours ouvrés (Lun-Ven)</option>
|
||||
<option value="6,7" data-i18n="stats_cron_day_weekend_short">Week-end (Sam-Dim)</option>
|
||||
<option value="1" data-i18n="stats_cron_day_mon">Chaque Lundi</option>
|
||||
<option value="2" data-i18n="stats_cron_day_tue">Chaque Mardi</option>
|
||||
<option value="3" data-i18n="stats_cron_day_wed">Chaque Mercredi</option>
|
||||
<option value="4" data-i18n="stats_cron_day_thu">Chaque Jeudi</option>
|
||||
<option value="5" data-i18n="stats_cron_day_fri">Chaque Vendredi</option>
|
||||
<option value="6" data-i18n="stats_cron_day_sat">Chaque Samedi</option>
|
||||
<option value="0" data-i18n="stats_cron_day_sun">Chaque Dimanche</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="backupCronHour" data-i18n="backup_cron_hour_label">Heure</label>
|
||||
<select id="backupCronHour" onchange="syncBackupCronFromSelects()"></select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="backupCronMinute" data-i18n="backup_cron_min_label">Minute</label>
|
||||
<select id="backupCronMinute" onchange="syncBackupCronFromSelects()"></select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="backupCronRetention" data-i18n="backup_cron_retention_label">Rétention (0 = illimité)</label>
|
||||
<input id="backupCronRetention" type="number" min="0" max="365" value="7">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end;margin-top:12px">
|
||||
<div>
|
||||
<label class="label" for="backupCronExpr" data-i18n="backup_cron_expr_label">Expression Cron (minute heure jour mois jour_semaine)</label>
|
||||
<input id="backupCronExpr" type="text" value="0 3 * * *" placeholder="0 3 * * *" style="font-family:monospace;margin-bottom:0" oninput="updateBackupCronSummary()">
|
||||
</div>
|
||||
<button id="btnSaveBackupSchedule" type="button" onclick="saveBackupSchedule()" data-i18n="backup_cron_save_btn">
|
||||
💾 Enregistrer
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div style="display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-top:10px">
|
||||
<div style="display:flex;align-items:center;gap:6px;flex-wrap:wrap">
|
||||
<span id="backupCronHuman" class="pill pill-blue pill-no-dot" style="font-size:12px">📅 Tous les jours à 03:00</span>
|
||||
<button type="button" class="secondary" style="padding:3px 9px;font-size:11px" onclick="applyBackupCronPreset('0 3 * * *','*',3,0)" data-i18n="backup_preset_daily">Chaque nuit 03:00</button>
|
||||
<button type="button" class="secondary" style="padding:3px 9px;font-size:11px" onclick="applyBackupCronPreset('0 4 * * 0','0',4,0)" data-i18n="backup_preset_weekly">Dimanche 04:00</button>
|
||||
<button type="button" class="secondary" style="padding:3px 9px;font-size:11px" onclick="applyBackupCronPreset('0 */6 * * *','*','*',0)" data-i18n="backup_preset_6h">Toutes les 6h</button>
|
||||
</div>
|
||||
<span id="backupCronLastRun" class="muted" style="font-size:12px"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Stockage distant (FTP, SFTP, Google Drive, Dropbox, WebDAV, S3, Webhook) -->
|
||||
@@ -9130,7 +9143,6 @@ ${vpnBadgeTopo}
|
||||
if (btn) btn.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================================
|
||||
Gestion des catégories et logos de types d'appareils
|
||||
======================================================== */
|
||||
@@ -9344,6 +9356,7 @@ ${vpnBadgeTopo}
|
||||
'vehicule': 'vehicle',
|
||||
'velo': 'bicycle',
|
||||
'trottinette': 'scooter',
|
||||
'drone': 'drone',
|
||||
'cle': 'key',
|
||||
'thermostat': 'thermostat',
|
||||
'temperature': 'thermometer',
|
||||
@@ -11039,11 +11052,19 @@ ${vpnBadgeTopo}
|
||||
}
|
||||
}
|
||||
|
||||
function onBackupCronToggle() {
|
||||
async function onBackupCronToggle(fromUserClick = false) {
|
||||
const en = !!($('backupCronEnabled') && $('backupCronEnabled').checked);
|
||||
const box = $('backupCronFields');
|
||||
if (box) box.style.opacity = en ? '1' : '0.65';
|
||||
updateBackupCronSummary();
|
||||
const body = $('backupCronBody');
|
||||
if (body) {
|
||||
body.style.display = en ? 'block' : 'none';
|
||||
}
|
||||
if (en) {
|
||||
initBackupCronSelects();
|
||||
updateBackupCronSummary();
|
||||
}
|
||||
if (fromUserClick && !en) {
|
||||
await saveBackupSchedule(true);
|
||||
}
|
||||
}
|
||||
|
||||
function syncBackupCronFromSelects() {
|
||||
@@ -11232,11 +11253,12 @@ ${vpnBadgeTopo}
|
||||
}
|
||||
}
|
||||
|
||||
async function saveBackupSchedule() {
|
||||
async function saveBackupSchedule(silent = false) {
|
||||
const msg = $('backupScheduleMsg');
|
||||
const btn = $('btnSaveBackupSchedule');
|
||||
const expr = ($('backupCronExpr')?.value || '').trim();
|
||||
if (expr.split(/\s+/).length !== 5) {
|
||||
const expr = ($('backupCronExpr')?.value || '0 3 * * *').trim();
|
||||
const en = !!($('backupCronEnabled') && $('backupCronEnabled').checked);
|
||||
if (en && expr.split(/\s+/).length !== 5) {
|
||||
if (msg) {
|
||||
msg.style.display = 'block';
|
||||
msg.style.background = 'rgba(239,68,68,0.12)';
|
||||
@@ -11248,7 +11270,7 @@ ${vpnBadgeTopo}
|
||||
if (btn) btn.disabled = true;
|
||||
try {
|
||||
const payload = {
|
||||
enabled: !!($('backupCronEnabled') && $('backupCronEnabled').checked),
|
||||
enabled: en,
|
||||
day: $('backupCronDay')?.value || '*',
|
||||
hour: $('backupCronHour')?.value ?? '3',
|
||||
minute: parseInt($('backupCronMinute')?.value || '0', 10) || 0,
|
||||
@@ -11267,11 +11289,11 @@ ${vpnBadgeTopo}
|
||||
msg.style.display = 'block';
|
||||
msg.style.background = 'rgba(50,213,131,0.12)';
|
||||
msg.style.color = 'var(--green)';
|
||||
msg.textContent = '✓ ' + t('backup_schedule_saved', 'Planification Cron enregistrée avec succès !');
|
||||
msg.textContent = '✓ ' + (en ? t('backup_schedule_saved', 'Planification Cron enregistrée avec succès !') : t('backup_schedule_disabled', 'Planification automatique désactivée'));
|
||||
setTimeout(() => { if (msg) msg.style.display = 'none'; }, 5000);
|
||||
}
|
||||
} catch (e) {
|
||||
if (msg) {
|
||||
if (msg && !silent) {
|
||||
msg.style.display = 'block';
|
||||
msg.style.background = 'rgba(239,68,68,0.12)';
|
||||
msg.style.color = 'var(--red)';
|
||||
@@ -11593,13 +11615,16 @@ ${vpnBadgeTopo}
|
||||
btn.style.borderColor = 'var(--blue)';
|
||||
btn.style.background = 'rgba(56,189,248,0.18)';
|
||||
btn.style.boxShadow = '0 0 0 1px var(--blue)';
|
||||
btn.style.setProperty('color', '#ffffff', 'important');
|
||||
btn.style.fontWeight = '600';
|
||||
} else {
|
||||
btn.style.borderColor = 'var(--line)';
|
||||
btn.style.background = 'transparent';
|
||||
btn.style.boxShadow = 'none';
|
||||
btn.style.setProperty('color', '#ffffff', 'important');
|
||||
btn.style.fontWeight = 'normal';
|
||||
}
|
||||
btn.querySelectorAll('span').forEach(sp => sp.style.setProperty('color', '#ffffff', 'important'));
|
||||
btn.disabled = !en;
|
||||
});
|
||||
// Mettre à jour les boutons Distant dans la table des sauvegardes
|
||||
|
||||
@@ -1193,6 +1193,7 @@ window.I18N['en-gb'] = {
|
||||
"backup_last_run": "Last run:",
|
||||
"backup_never_run": "No run recorded yet",
|
||||
"backup_schedule_saved": "Cron schedule saved successfully!",
|
||||
"backup_schedule_disabled": "Automatic backup schedule disabled",
|
||||
"backup_creating_server": "Creating backup on server…",
|
||||
"backup_created_success": "Backup created successfully!",
|
||||
"backup_analyzing": "Inspecting backup file…",
|
||||
|
||||
@@ -1193,6 +1193,7 @@ window.I18N['en-us'] = {
|
||||
"backup_last_run": "Last run:",
|
||||
"backup_never_run": "No run recorded yet",
|
||||
"backup_schedule_saved": "Cron schedule saved successfully!",
|
||||
"backup_schedule_disabled": "Automatic backup schedule disabled",
|
||||
"backup_creating_server": "Creating backup on server…",
|
||||
"backup_created_success": "Backup created successfully!",
|
||||
"backup_analyzing": "Inspecting backup file…",
|
||||
|
||||
@@ -1193,6 +1193,7 @@ window.I18N['fr'] = {
|
||||
"backup_last_run": "Dernière exécution :",
|
||||
"backup_never_run": "Aucune exécution enregistrée",
|
||||
"backup_schedule_saved": "Planification Cron enregistrée avec succès !",
|
||||
"backup_schedule_disabled": "Planification automatique désactivée",
|
||||
"backup_creating_server": "Création de la sauvegarde sur le serveur en cours…",
|
||||
"backup_created_success": "Sauvegarde créée avec succès !",
|
||||
"backup_analyzing": "Analyse de la sauvegarde en cours…",
|
||||
|
||||
Reference in new issue
Block a user