feat(reception): add strict anti-capture expiration to dynamic QR and fix Buenos Aires timezone display (v3.8.49)

This commit is contained in:
2026-10-28 13:32:30 -03:00
parent 3dbd22cc3c
commit 4668117c35
12 changed files with 138 additions and 51 deletions
+19 -2
View File
@@ -161,7 +161,7 @@
<td><span class="badge bg-light text-dark border">{{ log.user_role or 'ALUMNO' }}</span></td>
<td>{{ log.user_dni or '--' }}</td>
<td>{{ log.building_name }}</td>
<td>{{ log.scanned_at | replace('T', ' ') | truncate(16, true, '') }}</td>
<td>{{ log.scanned_time if log.scanned_time else (log.scanned_at | replace('T', ' ') | truncate(16, true, '')) }}</td>
<td class="text-center">
{% if log.status == 'AUTORIZADO' %}
<span class="badge bg-success-subtle text-success">OK</span>
@@ -397,7 +397,7 @@
<td><span class="badge bg-light text-dark border">${l.user_role || 'ALUMNO'}</span></td>
<td>${l.user_dni || '--'}</td>
<td>${l.building_name}</td>
<td>${l.scanned_at ? l.scanned_at.replace('T', ' ').substring(11, 16) + ' hs' : '--'}</td>
<td>${formatLogTime(l)}</td>
<td class="text-center">
<span class="badge ${l.status === 'AUTORIZADO' ? 'bg-success-subtle text-success' : 'bg-danger-subtle text-danger'}">
${l.status === 'AUTORIZADO' ? 'OK' : l.status}
@@ -411,6 +411,23 @@
}
}
function formatLogTime(l) {
if (l.scanned_time) return l.scanned_time;
if (!l.scanned_at) return '--';
try {
const raw = l.scanned_at;
const d = new Date(raw.endsWith('Z') || raw.includes('+') || raw.includes('-') ? raw : raw + 'Z');
return d.toLocaleTimeString('es-AR', {
hour: '2-digit',
minute: '2-digit',
hour12: false,
timeZone: 'America/Argentina/Buenos_Aires'
}) + ' hs';
} catch (e) {
return l.scanned_at.substring(11, 16) + ' hs';
}
}
// Feedback sonoro opcional vía Web Audio API
function playBeep(success) {
try {