APmanageur Wi-Fi V1.0
This commit is contained in:
1 parent
a711982133
commit
2e7b5a4963
4 files changed
+40
-12
No files matched your search
+37
-12
@@ -437,6 +437,16 @@
|
|||||||
color: var(--blue-text, #071326);
|
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 {
|
#btnAuthPasskey {
|
||||||
border: 1px solid rgba(56, 189, 248, 0.4);
|
border: 1px solid rgba(56, 189, 248, 0.4);
|
||||||
background: rgba(56, 189, 248, 0.08);
|
background: rgba(56, 189, 248, 0.08);
|
||||||
@@ -5021,10 +5031,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<label style="display:inline-flex;align-items:center;gap:10px;cursor:pointer;font-weight:600;user-select:none">
|
<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>
|
<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>
|
</label>
|
||||||
</div>
|
</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 id="backupCronFields" style="display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin-top:12px">
|
||||||
<div>
|
<div>
|
||||||
<label class="label" for="backupCronDay" data-i18n="backup_cron_day_label">Fréquence / Jour</label>
|
<label class="label" for="backupCronDay" data-i18n="backup_cron_day_label">Fréquence / Jour</label>
|
||||||
@@ -5074,7 +5087,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<span id="backupCronLastRun" class="muted" style="font-size:12px"></span>
|
<span id="backupCronLastRun" class="muted" style="font-size:12px"></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="backupScheduleMsg" style="margin-top:10px;font-size:12px;display:none;padding:8px 12px;border-radius:6px"></div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Stockage distant (FTP, SFTP, Google Drive, Dropbox, WebDAV, S3, Webhook) -->
|
<!-- Stockage distant (FTP, SFTP, Google Drive, Dropbox, WebDAV, S3, Webhook) -->
|
||||||
@@ -9130,7 +9143,6 @@ ${vpnBadgeTopo}
|
|||||||
if (btn) btn.disabled = false;
|
if (btn) btn.disabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========================================================
|
/* ========================================================
|
||||||
Gestion des catégories et logos de types d'appareils
|
Gestion des catégories et logos de types d'appareils
|
||||||
======================================================== */
|
======================================================== */
|
||||||
@@ -9344,6 +9356,7 @@ ${vpnBadgeTopo}
|
|||||||
'vehicule': 'vehicle',
|
'vehicule': 'vehicle',
|
||||||
'velo': 'bicycle',
|
'velo': 'bicycle',
|
||||||
'trottinette': 'scooter',
|
'trottinette': 'scooter',
|
||||||
|
'drone': 'drone',
|
||||||
'cle': 'key',
|
'cle': 'key',
|
||||||
'thermostat': 'thermostat',
|
'thermostat': 'thermostat',
|
||||||
'temperature': 'thermometer',
|
'temperature': 'thermometer',
|
||||||
@@ -11039,12 +11052,20 @@ ${vpnBadgeTopo}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onBackupCronToggle() {
|
async function onBackupCronToggle(fromUserClick = false) {
|
||||||
const en = !!($('backupCronEnabled') && $('backupCronEnabled').checked);
|
const en = !!($('backupCronEnabled') && $('backupCronEnabled').checked);
|
||||||
const box = $('backupCronFields');
|
const body = $('backupCronBody');
|
||||||
if (box) box.style.opacity = en ? '1' : '0.65';
|
if (body) {
|
||||||
|
body.style.display = en ? 'block' : 'none';
|
||||||
|
}
|
||||||
|
if (en) {
|
||||||
|
initBackupCronSelects();
|
||||||
updateBackupCronSummary();
|
updateBackupCronSummary();
|
||||||
}
|
}
|
||||||
|
if (fromUserClick && !en) {
|
||||||
|
await saveBackupSchedule(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function syncBackupCronFromSelects() {
|
function syncBackupCronFromSelects() {
|
||||||
const d = $('backupCronDay')?.value || '*';
|
const d = $('backupCronDay')?.value || '*';
|
||||||
@@ -11232,11 +11253,12 @@ ${vpnBadgeTopo}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveBackupSchedule() {
|
async function saveBackupSchedule(silent = false) {
|
||||||
const msg = $('backupScheduleMsg');
|
const msg = $('backupScheduleMsg');
|
||||||
const btn = $('btnSaveBackupSchedule');
|
const btn = $('btnSaveBackupSchedule');
|
||||||
const expr = ($('backupCronExpr')?.value || '').trim();
|
const expr = ($('backupCronExpr')?.value || '0 3 * * *').trim();
|
||||||
if (expr.split(/\s+/).length !== 5) {
|
const en = !!($('backupCronEnabled') && $('backupCronEnabled').checked);
|
||||||
|
if (en && expr.split(/\s+/).length !== 5) {
|
||||||
if (msg) {
|
if (msg) {
|
||||||
msg.style.display = 'block';
|
msg.style.display = 'block';
|
||||||
msg.style.background = 'rgba(239,68,68,0.12)';
|
msg.style.background = 'rgba(239,68,68,0.12)';
|
||||||
@@ -11248,7 +11270,7 @@ ${vpnBadgeTopo}
|
|||||||
if (btn) btn.disabled = true;
|
if (btn) btn.disabled = true;
|
||||||
try {
|
try {
|
||||||
const payload = {
|
const payload = {
|
||||||
enabled: !!($('backupCronEnabled') && $('backupCronEnabled').checked),
|
enabled: en,
|
||||||
day: $('backupCronDay')?.value || '*',
|
day: $('backupCronDay')?.value || '*',
|
||||||
hour: $('backupCronHour')?.value ?? '3',
|
hour: $('backupCronHour')?.value ?? '3',
|
||||||
minute: parseInt($('backupCronMinute')?.value || '0', 10) || 0,
|
minute: parseInt($('backupCronMinute')?.value || '0', 10) || 0,
|
||||||
@@ -11267,11 +11289,11 @@ ${vpnBadgeTopo}
|
|||||||
msg.style.display = 'block';
|
msg.style.display = 'block';
|
||||||
msg.style.background = 'rgba(50,213,131,0.12)';
|
msg.style.background = 'rgba(50,213,131,0.12)';
|
||||||
msg.style.color = 'var(--green)';
|
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);
|
setTimeout(() => { if (msg) msg.style.display = 'none'; }, 5000);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (msg) {
|
if (msg && !silent) {
|
||||||
msg.style.display = 'block';
|
msg.style.display = 'block';
|
||||||
msg.style.background = 'rgba(239,68,68,0.12)';
|
msg.style.background = 'rgba(239,68,68,0.12)';
|
||||||
msg.style.color = 'var(--red)';
|
msg.style.color = 'var(--red)';
|
||||||
@@ -11593,13 +11615,16 @@ ${vpnBadgeTopo}
|
|||||||
btn.style.borderColor = 'var(--blue)';
|
btn.style.borderColor = 'var(--blue)';
|
||||||
btn.style.background = 'rgba(56,189,248,0.18)';
|
btn.style.background = 'rgba(56,189,248,0.18)';
|
||||||
btn.style.boxShadow = '0 0 0 1px var(--blue)';
|
btn.style.boxShadow = '0 0 0 1px var(--blue)';
|
||||||
|
btn.style.setProperty('color', '#ffffff', 'important');
|
||||||
btn.style.fontWeight = '600';
|
btn.style.fontWeight = '600';
|
||||||
} else {
|
} else {
|
||||||
btn.style.borderColor = 'var(--line)';
|
btn.style.borderColor = 'var(--line)';
|
||||||
btn.style.background = 'transparent';
|
btn.style.background = 'transparent';
|
||||||
btn.style.boxShadow = 'none';
|
btn.style.boxShadow = 'none';
|
||||||
|
btn.style.setProperty('color', '#ffffff', 'important');
|
||||||
btn.style.fontWeight = 'normal';
|
btn.style.fontWeight = 'normal';
|
||||||
}
|
}
|
||||||
|
btn.querySelectorAll('span').forEach(sp => sp.style.setProperty('color', '#ffffff', 'important'));
|
||||||
btn.disabled = !en;
|
btn.disabled = !en;
|
||||||
});
|
});
|
||||||
// Mettre à jour les boutons Distant dans la table des sauvegardes
|
// Mettre à jour les boutons Distant dans la table des sauvegardes
|
||||||
|
|||||||
@@ -1193,6 +1193,7 @@ window.I18N['en-gb'] = {
|
|||||||
"backup_last_run": "Last run:",
|
"backup_last_run": "Last run:",
|
||||||
"backup_never_run": "No run recorded yet",
|
"backup_never_run": "No run recorded yet",
|
||||||
"backup_schedule_saved": "Cron schedule saved successfully!",
|
"backup_schedule_saved": "Cron schedule saved successfully!",
|
||||||
|
"backup_schedule_disabled": "Automatic backup schedule disabled",
|
||||||
"backup_creating_server": "Creating backup on server…",
|
"backup_creating_server": "Creating backup on server…",
|
||||||
"backup_created_success": "Backup created successfully!",
|
"backup_created_success": "Backup created successfully!",
|
||||||
"backup_analyzing": "Inspecting backup file…",
|
"backup_analyzing": "Inspecting backup file…",
|
||||||
|
|||||||
@@ -1193,6 +1193,7 @@ window.I18N['en-us'] = {
|
|||||||
"backup_last_run": "Last run:",
|
"backup_last_run": "Last run:",
|
||||||
"backup_never_run": "No run recorded yet",
|
"backup_never_run": "No run recorded yet",
|
||||||
"backup_schedule_saved": "Cron schedule saved successfully!",
|
"backup_schedule_saved": "Cron schedule saved successfully!",
|
||||||
|
"backup_schedule_disabled": "Automatic backup schedule disabled",
|
||||||
"backup_creating_server": "Creating backup on server…",
|
"backup_creating_server": "Creating backup on server…",
|
||||||
"backup_created_success": "Backup created successfully!",
|
"backup_created_success": "Backup created successfully!",
|
||||||
"backup_analyzing": "Inspecting backup file…",
|
"backup_analyzing": "Inspecting backup file…",
|
||||||
|
|||||||
@@ -1193,6 +1193,7 @@ window.I18N['fr'] = {
|
|||||||
"backup_last_run": "Dernière exécution :",
|
"backup_last_run": "Dernière exécution :",
|
||||||
"backup_never_run": "Aucune exécution enregistrée",
|
"backup_never_run": "Aucune exécution enregistrée",
|
||||||
"backup_schedule_saved": "Planification Cron enregistrée avec succès !",
|
"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_creating_server": "Création de la sauvegarde sur le serveur en cours…",
|
||||||
"backup_created_success": "Sauvegarde créée avec succès !",
|
"backup_created_success": "Sauvegarde créée avec succès !",
|
||||||
"backup_analyzing": "Analyse de la sauvegarde en cours…",
|
"backup_analyzing": "Analyse de la sauvegarde en cours…",
|
||||||
|
|||||||
Reference in new issue
Block a user