APmanageur Wi-Fi V1.0

This commit is contained in:
yoannmultigaming committed 2026-11-22 20:17:05 +01:00
1 parent 4df1918a5b
commit 1331fd30cf
3 files changed
+166 -133

No files matched your search

+10 -2
View File
@@ -9538,10 +9538,11 @@ ${vpnBadgeTopo}
if ((!devName || devName === 'Nom non communiqué' || devIp === 'Non attribuée') && log.mac && log.mac.includes(':')) {
const mUpper = log.mac.toUpperCase();
const known = ((typeof devicesDataCache !== 'undefined' && Array.isArray(devicesDataCache)) ? devicesDataCache.find(d => d.mac && d.mac.toUpperCase() === mUpper) : null) ||
((typeof clients !== 'undefined' && Array.isArray(clients)) ? clients.find(c => c.mac && c.mac.toUpperCase() === mUpper) : null);
((typeof clients !== 'undefined' && Array.isArray(clients)) ? clients.find(c => c.mac && c.mac.toUpperCase() === mUpper) : null) ||
((typeof logsDataCache !== 'undefined' && Array.isArray(logsDataCache)) ? logsDataCache.find(l => l.mac && l.mac.toUpperCase() === mUpper && l.name && l.name !== 'Nom non communiqué') : null);
if (known) {
if (!devName || devName === 'Nom non communiqué') devName = known.name;
if (devIp === 'Non attribuée' && known.ip && known.ip !== 'Non attribuée') devIp = known.ip;
if (devIp === 'Non attribuée' && known.ip && known.ip !== 'Non attribuée' && known.ip !== 'SYSTEM') devIp = known.ip;
}
}
return `<tr><td>${log.time}</td><td>${eventHtml}</td><td>${escapeHtml(devName || 'Nom non communiqué')}${vpnBadgeLog}</td><td>${devIp}</td><td>${macText}</td></tr>`;
@@ -9632,6 +9633,7 @@ ${vpnBadgeTopo}
if (!tbody) return;
let filtered = devicesDataCache.filter(d => {
if (!d || !d.mac || d.mac === '—' || !d.mac.includes(':')) return false;
if (devicesFilter === 'connected' && !d.connected) return false;
if (devicesFilter === 'offline' && d.connected) return false;
if (devicesFilter === 'blocked' && !d.blocked) return false;
@@ -9645,6 +9647,12 @@ ${vpnBadgeTopo}
return true;
});
if (!filtered.length) {
tbody.innerHTML = `<tr><td colspan="8" class="empty">${t('no_clients', 'Aucun équipement enregistré')}</td></tr>`;
renderPagination('devicesPagination', 1, 0, 'changeDevicesPage', 10);
return;
}
const paged = filtered.slice((devicesPage - 1) * 10, devicesPage * 10);
tbody.innerHTML = paged.map(d => {
const icon = getDeviceTypeIcon(d.device_type);