APmanageur Wi-Fi V1.0
This commit is contained in:
1 parent
ecc8e872f7
commit
b4aa9ab0f6
6 files changed
+151
-5
No files matched your search
+87
-1
@@ -130,6 +130,14 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#apControl {
|
||||
min-width: 96px;
|
||||
}
|
||||
|
||||
#apRestart {
|
||||
min-width: 98px;
|
||||
}
|
||||
|
||||
.btn-update-available {
|
||||
background: rgba(16, 185, 129, 0.15) !important;
|
||||
border: 1px solid #10b981 !important;
|
||||
@@ -4455,6 +4463,8 @@
|
||||
<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"><input id="notifEvtUpdateAvailable" type="checkbox"
|
||||
checked><span data-i18n="notif_evt_update_available">🚀 Mise à jour disponible pour AP Manageur</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)">
|
||||
@@ -5298,6 +5308,54 @@
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<!-- 16. Mise à jour disponible -->
|
||||
<details class="notif-tmpl-item card" style="padding:10px 14px;background:var(--panel);border-radius:10px"
|
||||
data-event="update_available">
|
||||
<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_update_available">🚀 Mise à jour disponible pour AP Manageur</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_update_available"
|
||||
style="font-size:12px">Titre / Sujet</label>
|
||||
<input id="notifTmplTitle_update_available" type="text"
|
||||
style="margin:4px 0 10px;padding:9px 12px;font-size:14px">
|
||||
<label class="label" data-i18n="notif_tmpl_msg_label" for="notifTmplMsg_update_available"
|
||||
style="font-size:12px">Contenu du message</label>
|
||||
<textarea id="notifTmplMsg_update_available" 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('update_available','{latest_commit}')">{latest_commit}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('update_available','{current_commit}')">{current_commit}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('update_available','{cmd}')">{cmd}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('update_available','{message}')">{message}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('update_available','{author}')">{author}</button>
|
||||
<button type="button" class="secondary"
|
||||
style="padding:2px 7px;font-size:11px;border-radius:6px;cursor:pointer"
|
||||
onclick="insertNotifVariable('update_available','{date}')">{date}</button>
|
||||
</div>
|
||||
<button type="button" class="secondary"
|
||||
style="font-size:11px;padding:3px 10px;border-radius:6px;cursor:pointer"
|
||||
onclick="resetNotificationTemplate('update_available')" data-i18n="notif_tmpl_reset_btn">↺ Rétablir
|
||||
par défaut</button>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -9585,6 +9643,31 @@ ${vpnBadgeTopo}
|
||||
const firstSeenHtml = escapeHtml(d.first_seen || '—');
|
||||
|
||||
return `<tr>
|
||||
<td>
|
||||
<div class="client">
|
||||
<div class="avatar" style="font-size:16px;cursor:pointer;position:relative" title="${t('modal_device_type_click', 'Cliquer pour changer le type d’appareil')}" onclick="openDeviceTypeModal('${escapeHtml(d.mac)}')">
|
||||
${icon}
|
||||
<span style="position:absolute;bottom:-3px;right:-3px;font-size:9px;background:var(--panel);border:1px solid var(--line);border-radius:50%;width:14px;height:14px;display:flex;align-items:center;justify-content:center;line-height:1">✏️</span>
|
||||
</div>
|
||||
<div>
|
||||
<div style="display:flex;align-items:center;gap:6px;flex-wrap:wrap">
|
||||
<strong>${nameHtml}</strong>
|
||||
${vpnBadge}
|
||||
</div>
|
||||
<div class="muted" style="font-size:11px;margin-top:2px">
|
||||
<span style="cursor:pointer;color:var(--blue);text-decoration:underline dashed;text-underline-offset:2px" onclick="openDeviceTypeModal('${escapeHtml(d.mac)}')" title="${t('modal_device_type_title', 'Modifier le type d’appareil')}">${escapeHtml(devTypeLabel)}</span> • ${d.connected ? t('status_online_live', 'En direct') : t('stored_in_db', 'Mémorisé en BDD')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td><code>${macHtml}</code></td>
|
||||
<td>${ipDisplay}</td>
|
||||
<td>${statusPill}</td>
|
||||
<td>${limitsHtml}</td>
|
||||
<td><span style="font-size:13px">${lastSeenHtml}</span></td>
|
||||
<td><span class="muted" style="font-size:12px">${firstSeenHtml}</span></td>
|
||||
<td style="text-align:right">
|
||||
<div style="display:inline-flex;gap:4px;align-items:center;justify-content:flex-end">
|
||||
<button class="secondary" type="button" style="padding:4px 9px;font-size:12px;display:inline-flex;align-items:center;gap:3px" onclick="openDeviceLimitsModal('${escapeHtml(d.mac)}')" title="${t('modal_limits_title_attr', 'Définir un quota et limiter la bande passante')}">⚖️ <span style="font-size:10px">${t('th_quota', 'Quota')}</span></button>
|
||||
<button class="secondary" type="button" style="padding:4px 9px;font-size:12px" onclick="openDeviceTypeModal('${escapeHtml(d.mac)}')" title="${t('modal_device_type_attr', 'Modifier le type d’appareil (Smartphone, Tablette, PC, TV...)')}">🏷️</button>
|
||||
<button class="secondary" type="button" style="padding:4px 9px;font-size:12px" onclick="renameDevice('${escapeHtml(d.mac)}')" title="${t('rename_device_attr', 'Renommer cet appareil')}">✏️</button>
|
||||
@@ -13582,7 +13665,8 @@ ${vpnBadgeTopo}
|
||||
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}" },
|
||||
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})." }
|
||||
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})." },
|
||||
update_available: { defaultTitle: "🚀 Mise à jour disponible pour AP Manageur", defaultMsg: "Une nouvelle version de AP Manageur est prête sur le dépôt ({latest_commit}) ! Exécutez « {cmd} » pour mettre à jour." }
|
||||
};
|
||||
|
||||
function insertNotifVariable(ev, varName) {
|
||||
@@ -13761,6 +13845,7 @@ ${vpnBadgeTopo}
|
||||
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;
|
||||
if ($('notifEvtUpdateAvailable')) $('notifEvtUpdateAvailable').checked = evts.update_available !== undefined ? !!evts.update_available : true;
|
||||
|
||||
const sched = cfg.stats_report_schedule || {};
|
||||
const isStatsRep = !!(evts.stats_report || sched.enabled);
|
||||
@@ -13863,6 +13948,7 @@ ${vpnBadgeTopo}
|
||||
quota_exceeded: $('notifEvtQuotaExceeded')?.checked ?? true,
|
||||
backup_success: $('notifEvtBackupSuccess')?.checked ?? true,
|
||||
backup_remote_success: $('notifEvtBackupRemoteSuccess')?.checked ?? true,
|
||||
update_available: $('notifEvtUpdateAvailable')?.checked ?? true,
|
||||
stats_report: $('notifEvtStatsReport')?.checked || false
|
||||
},
|
||||
stats_report_schedule: {
|
||||
|
||||
Reference in new issue
Block a user