APmanageur Wi-Fi V1.0
This commit is contained in:
1 parent
38c7ace89e
commit
a3c51d28e6
5 files changed
+240
-12
No files matched your search
@@ -1634,6 +1634,14 @@ DEFAULT_NOTIFICATION_TEMPLATES = {
|
||||
"stats_report": {
|
||||
"title": "📊 Rapport statistiques & métriques Wi‑Fi",
|
||||
"message": "📊 Rapport Wi‑Fi ({date}) :\n• {clients_count} appareil(s) connecté(s) (↓ {traffic_down} • ↑ {traffic_up})\n• Aujourd'hui : {today_unique} visiteur(s) unique(s) ({today_total} sessions)\n• Cette semaine : {week_unique} unique(s) | Ce mois : {month_unique} unique(s)\n• VPN : {active_vpns} tunnel(s) actif(s) ({vpn_routed_clients} appareil(s) routé(s))\n• Passerelle WAN : {gateway_status} ({gateway_ip})\n• Top clients (Consommation de données) :\n{top_clients}"
|
||||
},
|
||||
"backup_success": {
|
||||
"title": "💾 Sauvegarde créée avec succès",
|
||||
"message": "La sauvegarde « {filename} » ({size}) a été créée avec succès ({trigger})."
|
||||
},
|
||||
"backup_remote_success": {
|
||||
"title": "☁️ Sauvegarde téléversée sur le stockage distant",
|
||||
"message": "La sauvegarde « {filename} » ({size}) a été téléversée avec succès sur {provider} ({host})."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1707,7 +1715,9 @@ DEFAULT_NOTIFICATIONS_CONFIG = {
|
||||
"vpn_profile_connected": True, # Connexion d'un profil VPN (tunnel actif)
|
||||
"vpn_profile_disconnected": True, # Déconnexion d'un profil VPN (tunnel coupé)
|
||||
"quota_exceeded": True, # Quota de données dépassé par un équipement Wi-Fi
|
||||
"stats_report": False # Rapport planifié des statistiques et métriques (Tâche Cron)
|
||||
"stats_report": False, # Rapport planifié des statistiques et métriques (Tâche Cron)
|
||||
"backup_success": True, # Sauvegarde créée avec succès (locale)
|
||||
"backup_remote_success": True # Sauvegarde envoyée sur le stockage distant (si configuré)
|
||||
},
|
||||
"stats_report_schedule": {
|
||||
"enabled": False,
|
||||
@@ -8070,6 +8080,32 @@ def create_server_backup(trigger='manual'):
|
||||
print(f"[ap-backup] Erreur démarrage téléversement distant : {e_th}", flush=True)
|
||||
|
||||
st = os.stat(full_path)
|
||||
# Notification d'événement : Sauvegarde créée avec succès
|
||||
try:
|
||||
trigger_label = "automatique (Cron)" if tag == 'auto' else "manuelle"
|
||||
dispatch_notification(
|
||||
'backup_success',
|
||||
"💾 Sauvegarde créée avec succès",
|
||||
f"La sauvegarde « {fname} » ({format_bytes(st.st_size)}) a été créée avec succès ({trigger_label}).",
|
||||
details={
|
||||
"Fichier": fname,
|
||||
"Taille": format_bytes(st.st_size),
|
||||
"Déclenchement": trigger_label,
|
||||
"Date": time.strftime('%d/%m/%Y %H:%M:%S')
|
||||
},
|
||||
priority=3,
|
||||
level="success",
|
||||
vars_dict={
|
||||
"filename": fname,
|
||||
"file": fname,
|
||||
"size": format_bytes(st.st_size),
|
||||
"trigger": trigger_label,
|
||||
"date": time.strftime('%d/%m/%Y %H:%M:%S')
|
||||
}
|
||||
)
|
||||
except Exception as e_notif:
|
||||
print(f"[ap-backup] Avertissement notification sauvegarde : {e_notif}", flush=True)
|
||||
|
||||
return {
|
||||
'filename': fname,
|
||||
'size': st.st_size,
|
||||
@@ -8563,6 +8599,41 @@ def upload_backup_to_remote(local_filepath_or_name, custom_cfg=None, remote_file
|
||||
up_files[fname] = {'time': now_ts, 'provider': provider}
|
||||
saved['uploaded_files'] = up_files
|
||||
set_pref('backup_remote_config', json.dumps(saved, ensure_ascii=False))
|
||||
|
||||
# Notification d'événement : Sauvegarde envoyée sur l'hôte distant
|
||||
if not fname.startswith('ap-manageur-test-'):
|
||||
try:
|
||||
st_size_str = ""
|
||||
if os.path.isfile(local_path):
|
||||
st_size_str = format_bytes(os.path.getsize(local_path))
|
||||
prov_name = {'ftp':'FTP','sftp':'SFTP','gdrive':'Google Drive','dropbox':'Dropbox','webdav':'WebDAV','s3':'S3 / MinIO','webhook':'Webhook'}.get(provider, provider.upper())
|
||||
target_host = p_cfg.get('host') or p_cfg.get('url') or p_cfg.get('endpoint') or p_cfg.get('bucket') or prov_name
|
||||
dispatch_notification(
|
||||
'backup_remote_success',
|
||||
"☁️ Sauvegarde téléversée sur le stockage distant",
|
||||
f"La sauvegarde « {fname} » {f'({st_size_str}) ' if st_size_str else ''}a été téléversée avec succès sur {prov_name} ({target_host}).",
|
||||
details={
|
||||
"Fichier": fname,
|
||||
"Taille": st_size_str or "Inconnue",
|
||||
"Stockage distant": prov_name,
|
||||
"Cible": str(target_host),
|
||||
"Date": time.strftime('%d/%m/%Y %H:%M:%S')
|
||||
},
|
||||
priority=4,
|
||||
level="success",
|
||||
vars_dict={
|
||||
"filename": fname,
|
||||
"file": fname,
|
||||
"size": st_size_str or "",
|
||||
"provider": prov_name,
|
||||
"host": str(target_host),
|
||||
"cible": str(target_host),
|
||||
"date": time.strftime('%d/%m/%Y %H:%M:%S')
|
||||
}
|
||||
)
|
||||
except Exception as e_notif:
|
||||
print(f"[ap-backup] Avertissement notification stockage distant : {e_notif}", flush=True)
|
||||
|
||||
print(f"[ap-backup] Sauvegarde {fname} transmise vers {provider.upper()} : {msg}", flush=True)
|
||||
return True, msg
|
||||
except Exception as e:
|
||||
|
||||
+153
-8
@@ -3970,6 +3970,10 @@
|
||||
coupé)</span></label>
|
||||
<label class="check" style="margin:0"><input id="notifEvtQuotaExceeded" type="checkbox" checked><span
|
||||
data-i18n="notif_evt_quota_exceeded">⚖️ Quota de données dépassé par un appareil</span></label>
|
||||
<label class="check" style="margin:0"><input id="notifEvtBackupSuccess" type="checkbox" checked><span
|
||||
data-i18n="notif_evt_backup_success">💾 Sauvegarde créée avec succès</span></label>
|
||||
<label class="check" style="margin:0"><input id="notifEvtBackupRemoteSuccess" type="checkbox" checked><span
|
||||
data-i18n="notif_evt_backup_remote_success">☁️ Sauvegarde envoyée sur l’hôte distant (si configuré)</span></label>
|
||||
<label class="check"
|
||||
style="margin:0;grid-column:1/-1;background:var(--panel);padding:10px 14px;border-radius:10px;border:1px solid var(--line);font-weight:600">
|
||||
<input id="notifEvtStatsReport" type="checkbox" onchange="toggleStatsReportSchedule(this.checked)">
|
||||
@@ -4717,6 +4721,99 @@
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<!-- 14. Sauvegarde créée avec succès -->
|
||||
<details class="notif-tmpl-item card" style="padding:10px 14px;background:var(--panel);border-radius:10px"
|
||||
data-event="backup_success">
|
||||
<summary
|
||||
style="font-weight:700;font-size:14px;cursor:pointer;user-select:none;display:flex;align-items:center;justify-content:space-between">
|
||||
<span data-i18n="notif_event_backup_success">💾 Sauvegarde créée avec succès</span>
|
||||
<span class="muted" style="font-size:12px" data-i18n="notif_tmpl_customize">Personnaliser ▾</span>
|
||||
</summary>
|
||||
<div style="padding-top:12px">
|
||||
<label class="label" data-i18n="notif_tmpl_title_label" for="notifTmplTitle_backup_success"
|
||||
style="font-size:12px">Titre / Sujet</label>
|
||||
<input id="notifTmplTitle_backup_success" type="text"
|
||||
style="margin:4px 0 10px;padding:9px 12px;font-size:14px">
|
||||
<label class="label" data-i18n="notif_tmpl_msg_label" for="notifTmplMsg_backup_success"
|
||||
style="font-size:12px">Contenu du message</label>
|
||||
<textarea id="notifTmplMsg_backup_success" rows="2"
|
||||
style="width:100%;margin:4px 0 8px;padding:9px 12px;border-radius:9px;border:1px solid var(--line);background:var(--panel2);color:var(--text);font-family:inherit;font-size:14px;resize:vertical"></textarea>
|
||||
<div
|
||||
style="display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;margin-top:4px">
|
||||
<div style="display:flex;align-items:center;gap:6px;flex-wrap:wrap">
|
||||
<span class="muted" style="font-size:11px" data-i18n="notif_tmpl_vars_label">Variables :</span>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('backup_success','{filename}')">{filename}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('backup_success','{size}')">{size}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('backup_success','{trigger}')">{trigger}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('backup_success','{date}')">{date}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('backup_success','{heure}')">{heure}</button>
|
||||
</div>
|
||||
<button type="button" class="secondary"
|
||||
style="font-size:11px;padding:3px 10px;border-radius:6px;cursor:pointer"
|
||||
onclick="resetNotificationTemplate('backup_success')" data-i18n="notif_tmpl_reset_btn">↺ Rétablir
|
||||
par défaut</button>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<!-- 15. Sauvegarde envoyée sur l'hôte distant -->
|
||||
<details class="notif-tmpl-item card" style="padding:10px 14px;background:var(--panel);border-radius:10px"
|
||||
data-event="backup_remote_success">
|
||||
<summary
|
||||
style="font-weight:700;font-size:14px;cursor:pointer;user-select:none;display:flex;align-items:center;justify-content:space-between">
|
||||
<span data-i18n="notif_event_backup_remote_success">☁️ Sauvegarde téléversée sur le stockage distant</span>
|
||||
<span class="muted" style="font-size:12px" data-i18n="notif_tmpl_customize">Personnaliser ▾</span>
|
||||
</summary>
|
||||
<div style="padding-top:12px">
|
||||
<label class="label" data-i18n="notif_tmpl_title_label" for="notifTmplTitle_backup_remote_success"
|
||||
style="font-size:12px">Titre / Sujet</label>
|
||||
<input id="notifTmplTitle_backup_remote_success" type="text"
|
||||
style="margin:4px 0 10px;padding:9px 12px;font-size:14px">
|
||||
<label class="label" data-i18n="notif_tmpl_msg_label" for="notifTmplMsg_backup_remote_success"
|
||||
style="font-size:12px">Contenu du message</label>
|
||||
<textarea id="notifTmplMsg_backup_remote_success" rows="2"
|
||||
style="width:100%;margin:4px 0 8px;padding:9px 12px;border-radius:9px;border:1px solid var(--line);background:var(--panel2);color:var(--text);font-family:inherit;font-size:14px;resize:vertical"></textarea>
|
||||
<div
|
||||
style="display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px;margin-top:4px">
|
||||
<div style="display:flex;align-items:center;gap:6px;flex-wrap:wrap">
|
||||
<span class="muted" style="font-size:11px" data-i18n="notif_tmpl_vars_label">Variables :</span>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('backup_remote_success','{filename}')">{filename}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('backup_remote_success','{size}')">{size}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('backup_remote_success','{provider}')">{provider}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('backup_remote_success','{host}')">{host}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('backup_remote_success','{date}')">{date}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('backup_remote_success','{heure}')">{heure}</button>
|
||||
</div>
|
||||
<button type="button" class="secondary"
|
||||
style="font-size:11px;padding:3px 10px;border-radius:6px;cursor:pointer"
|
||||
onclick="resetNotificationTemplate('backup_remote_success')" data-i18n="notif_tmpl_reset_btn">↺ Rétablir
|
||||
par défaut</button>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -5054,7 +5151,13 @@
|
||||
</div>
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px">
|
||||
<div><label class="label" for="remoteFtpUser" data-i18n="backup_remote_user">Utilisateur</label><input id="remoteFtpUser" type="text" placeholder="backup_user"></div>
|
||||
<div><label class="label" for="remoteFtpPass" data-i18n="backup_remote_pass">Mot de passe</label><input id="remoteFtpPass" type="password" placeholder="••••••••"></div>
|
||||
<div>
|
||||
<label class="label" for="remoteFtpPass" data-i18n="backup_remote_pass">Mot de passe</label>
|
||||
<div style="display:flex;gap:6px;align-items:center">
|
||||
<input id="remoteFtpPass" type="password" placeholder="••••••••" style="margin:0;flex:1">
|
||||
<button id="toggleRemoteFtpPass" class="secondary" type="button" aria-label="Afficher le mot de passe" title="Afficher le mot de passe" data-i18n-title="btn_show_pwd" data-i18n-aria-label="btn_show_pwd" style="padding:7px 10px;height:38px;display:inline-flex;align-items:center;justify-content:center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.5-8 10-8 10 8 10 8-3.5 8-10 8S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></svg></button>
|
||||
</div>
|
||||
</div>
|
||||
<div><label class="label" for="remoteFtpPath" data-i18n="backup_remote_path">Dossier distant</label><input id="remoteFtpPath" type="text" value="backups/" placeholder="backups/ ou vide pour la racine"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -5068,7 +5171,13 @@
|
||||
</div>
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr;gap:10px">
|
||||
<div><label class="label" for="remoteSftpUser" data-i18n="backup_remote_user">Utilisateur</label><input id="remoteSftpUser" type="text" placeholder="root ou backup"></div>
|
||||
<div><label class="label" for="remoteSftpPass" data-i18n="backup_remote_pass">Mot de passe (si pas de clé SSH)</label><input id="remoteSftpPass" type="password" placeholder="••••••••"></div>
|
||||
<div>
|
||||
<label class="label" for="remoteSftpPass" data-i18n="backup_remote_pass">Mot de passe (si pas de clé SSH)</label>
|
||||
<div style="display:flex;gap:6px;align-items:center">
|
||||
<input id="remoteSftpPass" type="password" placeholder="••••••••" style="margin:0;flex:1">
|
||||
<button id="toggleRemoteSftpPass" class="secondary" type="button" aria-label="Afficher le mot de passe" title="Afficher le mot de passe" data-i18n-title="btn_show_pwd" data-i18n-aria-label="btn_show_pwd" style="padding:7px 10px;height:38px;display:inline-flex;align-items:center;justify-content:center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.5-8 10-8 10 8 10 8-3.5 8-10 8S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></svg></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label" for="remoteSftpKey" data-i18n="backup_remote_ssh_key">Clé privée SSH (facultative — format PEM / OpenSSH)</label>
|
||||
@@ -5086,7 +5195,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:grid;grid-template-columns:2fr 1fr;gap:10px">
|
||||
<div><label class="label" for="remoteGdriveToken" data-i18n="backup_remote_token">Jeton d’accès OAuth2 (Access Token)</label><input id="remoteGdriveToken" type="password" placeholder="ya29.a0..."></div>
|
||||
<div>
|
||||
<label class="label" for="remoteGdriveToken" data-i18n="backup_remote_token">Jeton d’accès OAuth2 (Access Token)</label>
|
||||
<div style="display:flex;gap:6px;align-items:center">
|
||||
<input id="remoteGdriveToken" type="password" placeholder="ya29.a0..." style="margin:0;flex:1">
|
||||
<button id="toggleRemoteGdriveToken" class="secondary" type="button" aria-label="Afficher le jeton" title="Afficher le jeton" data-i18n-title="settings_show_token" data-i18n-aria-label="settings_show_token" style="padding:7px 10px;height:38px;display:inline-flex;align-items:center;justify-content:center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.5-8 10-8 10 8 10 8-3.5 8-10 8S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></svg></button>
|
||||
</div>
|
||||
</div>
|
||||
<div><label class="label" for="remoteGdriveFolder" data-i18n="backup_remote_gdrive_folder">ID du dossier Drive (facultatif)</label><input id="remoteGdriveFolder" type="text" placeholder="1AbCdEfGhIjKlMnOp..."></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -5101,7 +5216,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:grid;grid-template-columns:2fr 1fr;gap:10px">
|
||||
<div><label class="label" for="remoteDropboxToken" data-i18n="backup_remote_token">Jeton d’accès (Access Token Dropbox)</label><input id="remoteDropboxToken" type="password" placeholder="sl.B..."></div>
|
||||
<div>
|
||||
<label class="label" for="remoteDropboxToken" data-i18n="backup_remote_token">Jeton d’accès (Access Token Dropbox)</label>
|
||||
<div style="display:flex;gap:6px;align-items:center">
|
||||
<input id="remoteDropboxToken" type="password" placeholder="sl.B..." style="margin:0;flex:1">
|
||||
<button id="toggleRemoteDropboxToken" class="secondary" type="button" aria-label="Afficher le jeton" title="Afficher le jeton" data-i18n-title="settings_show_token" data-i18n-aria-label="settings_show_token" style="padding:7px 10px;height:38px;display:inline-flex;align-items:center;justify-content:center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.5-8 10-8 10 8 10 8-3.5 8-10 8S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></svg></button>
|
||||
</div>
|
||||
</div>
|
||||
<div><label class="label" for="remoteDropboxPath" data-i18n="backup_remote_path">Dossier distant</label><input id="remoteDropboxPath" type="text" value="/AP-Manageur-Backups/" placeholder="/AP-Manageur-Backups/"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -5111,7 +5232,13 @@
|
||||
<div><label class="label" for="remoteWebdavUrl" data-i18n="backup_remote_webdav_url">URL WebDAV (Nextcloud / ownCloud / Synology / kDrive)</label><input id="remoteWebdavUrl" type="url" placeholder="https://cloud.exemple.fr/remote.php/dav/files/user/Backups/"></div>
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr;gap:10px">
|
||||
<div><label class="label" for="remoteWebdavUser" data-i18n="backup_remote_user">Utilisateur</label><input id="remoteWebdavUser" type="text" placeholder="utilisateur"></div>
|
||||
<div><label class="label" for="remoteWebdavPass" data-i18n="backup_remote_pass">Mot de passe / Mot de passe d’application</label><input id="remoteWebdavPass" type="password" placeholder="••••••••"></div>
|
||||
<div>
|
||||
<label class="label" for="remoteWebdavPass" data-i18n="backup_remote_pass">Mot de passe / Mot de passe d’application</label>
|
||||
<div style="display:flex;gap:6px;align-items:center">
|
||||
<input id="remoteWebdavPass" type="password" placeholder="••••••••" style="margin:0;flex:1">
|
||||
<button id="toggleRemoteWebdavPass" class="secondary" type="button" aria-label="Afficher le mot de passe" title="Afficher le mot de passe" data-i18n-title="btn_show_pwd" data-i18n-aria-label="btn_show_pwd" style="padding:7px 10px;height:38px;display:inline-flex;align-items:center;justify-content:center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.5-8 10-8 10 8 10 8-3.5 8-10 8S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></svg></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5124,7 +5251,13 @@
|
||||
</div>
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px">
|
||||
<div><label class="label" for="remoteS3AccessKey">Access Key</label><input id="remoteS3AccessKey" type="text" placeholder="AKIA..."></div>
|
||||
<div><label class="label" for="remoteS3SecretKey">Secret Key</label><input id="remoteS3SecretKey" type="password" placeholder="••••••••"></div>
|
||||
<div>
|
||||
<label class="label" for="remoteS3SecretKey">Secret Key</label>
|
||||
<div style="display:flex;gap:6px;align-items:center">
|
||||
<input id="remoteS3SecretKey" type="password" placeholder="••••••••" style="margin:0;flex:1">
|
||||
<button id="toggleRemoteS3SecretKey" class="secondary" type="button" aria-label="Afficher la clé" title="Afficher la clé" data-i18n-title="settings_show_key" data-i18n-aria-label="settings_show_key" style="padding:7px 10px;height:38px;display:inline-flex;align-items:center;justify-content:center"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12s3.5-8 10-8 10 8 10 8-3.5 8-10 8S2 12 2 12Z"/><circle cx="12" cy="12" r="3"/></svg></button>
|
||||
</div>
|
||||
</div>
|
||||
<div><label class="label" for="remoteS3Path" data-i18n="backup_remote_path">Préfixe / Dossier</label><input id="remoteS3Path" type="text" value="backups/" placeholder="backups/"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -11737,7 +11870,7 @@ ${vpnBadgeTopo}
|
||||
? t('settings_hide_cur_pwd', 'Masquer le mot de passe actuel')
|
||||
: t('settings_show_cur_pwd', 'Afficher le mot de passe actuel');
|
||||
}
|
||||
if (bid.includes('pushoveruser')) {
|
||||
if (bid.includes('pushoveruser') || bid.includes('secretkey')) {
|
||||
return isText
|
||||
? t('settings_hide_key', 'Masquer la clé')
|
||||
: t('settings_show_key', 'Afficher la clé');
|
||||
@@ -11795,6 +11928,12 @@ ${vpnBadgeTopo}
|
||||
bindPasswordToggle('toggleNotifPushoverUser', 'notifPushoverUser');
|
||||
bindPasswordToggle('toggleNotifPushoverToken', 'notifPushoverToken');
|
||||
bindPasswordToggle('toggleNotifTelegramToken', 'notifTelegramToken');
|
||||
bindPasswordToggle('toggleRemoteFtpPass', 'remoteFtpPass');
|
||||
bindPasswordToggle('toggleRemoteSftpPass', 'remoteSftpPass');
|
||||
bindPasswordToggle('toggleRemoteGdriveToken', 'remoteGdriveToken');
|
||||
bindPasswordToggle('toggleRemoteDropboxToken', 'remoteDropboxToken');
|
||||
bindPasswordToggle('toggleRemoteWebdavPass', 'remoteWebdavPass');
|
||||
bindPasswordToggle('toggleRemoteS3SecretKey', 'remoteS3SecretKey');
|
||||
const authCurrInput = $('authCurrentPassword');
|
||||
const twoFaCurrInput = $('twoFaCurrentPassword');
|
||||
if (authCurrInput && twoFaCurrInput) {
|
||||
@@ -12524,7 +12663,9 @@ ${vpnBadgeTopo}
|
||||
vpn_profile_connected: { defaultTitle: "🛡️ Tunnel VPN connecté", defaultMsg: "Le profil VPN « {name} » ({type}) est désormais connecté avec succès (interface {iface})." },
|
||||
vpn_profile_disconnected: { defaultTitle: "⚠️ Tunnel VPN déconnecté", defaultMsg: "Le profil VPN « {name} » ({type}) a été déconnecté (interface {iface})." },
|
||||
quota_exceeded: { defaultTitle: "⚠️ Quota de données dépassé", defaultMsg: "L'appareil « {name} » ({ip}) a dépassé son quota de {quota} (consommé : {consumption}). L'accès Internet a été coupé." },
|
||||
stats_report: { defaultTitle: "📊 Rapport statistiques & métriques Wi‑Fi", defaultMsg: "📊 Rapport Wi‑Fi ({date}) :\n• {clients_count} appareil(s) connecté(s) (↓ {traffic_down} • ↑ {traffic_up})\n• Aujourd'hui : {today_unique} visiteur(s) unique(s) ({today_total} sessions)\n• Cette semaine : {week_unique} unique(s) | Ce mois : {month_unique} unique(s)\n• VPN : {active_vpns} tunnel(s) actif(s) ({vpn_routed_clients} appareil(s) routé(s))\n• Passerelle WAN : {gateway_status} ({gateway_ip})\n• Top clients (Consommation de données) :\n{top_clients}" }
|
||||
stats_report: { defaultTitle: "📊 Rapport statistiques & métriques Wi‑Fi", defaultMsg: "📊 Rapport Wi‑Fi ({date}) :\n• {clients_count} appareil(s) connecté(s) (↓ {traffic_down} • ↑ {traffic_up})\n• Aujourd'hui : {today_unique} visiteur(s) unique(s) ({today_total} sessions)\n• Cette semaine : {week_unique} unique(s) | Ce mois : {month_unique} unique(s)\n• VPN : {active_vpns} tunnel(s) actif(s) ({vpn_routed_clients} appareil(s) routé(s))\n• Passerelle WAN : {gateway_status} ({gateway_ip})\n• Top clients (Consommation de données) :\n{top_clients}" },
|
||||
backup_success: { defaultTitle: "💾 Sauvegarde créée avec succès", defaultMsg: "La sauvegarde « {filename} » ({size}) a été créée avec succès ({trigger})." },
|
||||
backup_remote_success: { defaultTitle: "☁️ Sauvegarde téléversée sur le stockage distant", defaultMsg: "La sauvegarde « {filename} » ({size}) a été téléversée avec succès sur {provider} ({host})." }
|
||||
};
|
||||
|
||||
function insertNotifVariable(ev, varName) {
|
||||
@@ -12701,6 +12842,8 @@ ${vpnBadgeTopo}
|
||||
if ($('notifEvtVpnProfileConnected')) $('notifEvtVpnProfileConnected').checked = !!evts.vpn_profile_connected;
|
||||
if ($('notifEvtVpnProfileDisconnected')) $('notifEvtVpnProfileDisconnected').checked = !!evts.vpn_profile_disconnected;
|
||||
if ($('notifEvtQuotaExceeded')) $('notifEvtQuotaExceeded').checked = evts.quota_exceeded !== undefined ? !!evts.quota_exceeded : true;
|
||||
if ($('notifEvtBackupSuccess')) $('notifEvtBackupSuccess').checked = evts.backup_success !== undefined ? !!evts.backup_success : true;
|
||||
if ($('notifEvtBackupRemoteSuccess')) $('notifEvtBackupRemoteSuccess').checked = evts.backup_remote_success !== undefined ? !!evts.backup_remote_success : true;
|
||||
|
||||
const sched = cfg.stats_report_schedule || {};
|
||||
const isStatsRep = !!(evts.stats_report || sched.enabled);
|
||||
@@ -12801,6 +12944,8 @@ ${vpnBadgeTopo}
|
||||
vpn_profile_connected: $('notifEvtVpnProfileConnected')?.checked || false,
|
||||
vpn_profile_disconnected: $('notifEvtVpnProfileDisconnected')?.checked || false,
|
||||
quota_exceeded: $('notifEvtQuotaExceeded')?.checked ?? true,
|
||||
backup_success: $('notifEvtBackupSuccess')?.checked ?? true,
|
||||
backup_remote_success: $('notifEvtBackupRemoteSuccess')?.checked ?? true,
|
||||
stats_report: $('notifEvtStatsReport')?.checked || false
|
||||
},
|
||||
stats_report_schedule: {
|
||||
|
||||
+5
-1
@@ -1260,5 +1260,9 @@ window.I18N['en-gb'] = {
|
||||
"log_suppr_distant": "🗑️ Delete from drive",
|
||||
"log_export_sauvegarde": "💾 Backup export",
|
||||
"log_export_sqlite": "💾 SQLite export",
|
||||
"log_export_json": "💾 JSON export"
|
||||
"log_export_json": "💾 JSON export",
|
||||
"notif_evt_backup_success": "💾 Backup successfully created",
|
||||
"notif_evt_backup_remote_success": "☁️ Backup uploaded to remote host (if configured)",
|
||||
"notif_event_backup_success": "💾 Backup successfully created",
|
||||
"notif_event_backup_remote_success": "☁️ Backup uploaded to remote storage"
|
||||
};
|
||||
+5
-1
@@ -1260,5 +1260,9 @@ window.I18N['en-us'] = {
|
||||
"log_suppr_distant": "🗑️ Delete from drive",
|
||||
"log_export_sauvegarde": "💾 Backup export",
|
||||
"log_export_sqlite": "💾 SQLite export",
|
||||
"log_export_json": "💾 JSON export"
|
||||
"log_export_json": "💾 JSON export",
|
||||
"notif_evt_backup_success": "💾 Backup successfully created",
|
||||
"notif_evt_backup_remote_success": "☁️ Backup uploaded to remote host (if configured)",
|
||||
"notif_event_backup_success": "💾 Backup successfully created",
|
||||
"notif_event_backup_remote_success": "☁️ Backup uploaded to remote storage"
|
||||
};
|
||||
+5
-1
@@ -1260,5 +1260,9 @@ window.I18N['fr'] = {
|
||||
"log_suppr_distant": "🗑️ Suppr. sur le drive",
|
||||
"log_export_sauvegarde": "💾 Export sauvegarde",
|
||||
"log_export_sqlite": "💾 Export SQLite",
|
||||
"log_export_json": "💾 Export JSON"
|
||||
"log_export_json": "💾 Export JSON",
|
||||
"notif_evt_backup_success": "💾 Sauvegarde créée avec succès",
|
||||
"notif_evt_backup_remote_success": "☁️ Sauvegarde envoyée sur l’hôte distant (si configuré)",
|
||||
"notif_event_backup_success": "💾 Sauvegarde créée avec succès",
|
||||
"notif_event_backup_remote_success": "☁️ Sauvegarde téléversée sur le stockage distant"
|
||||
};
|
||||
Reference in new issue
Block a user