feat(reception): add strict anti-capture expiration to dynamic QR and fix Buenos Aires timezone display (v3.8.49)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "3.8.48",
|
||||
"version": "3.8.49",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
+3
-3
@@ -86,9 +86,9 @@ const env = nunjucks.configure(path.join(__dirname, '../views'), {
|
||||
});
|
||||
|
||||
// Versiones institucionales del sistema
|
||||
const APP_VERSION = '3.8.48';
|
||||
const FRONTEND_VERSION = '3.8.48';
|
||||
const BACKEND_VERSION = '3.8.48';
|
||||
const APP_VERSION = '3.8.49';
|
||||
const FRONTEND_VERSION = '3.8.49';
|
||||
const BACKEND_VERSION = '3.8.49';
|
||||
|
||||
env.addGlobal('app_version', APP_VERSION);
|
||||
env.addGlobal('frontend_version', FRONTEND_VERSION);
|
||||
|
||||
@@ -27,7 +27,24 @@ router.get('/scanner', async (req, res) => {
|
||||
req.apiClient.get('/reception/recent-logs', { params: { limit: 15 } })
|
||||
]);
|
||||
buildings = respBld.data?.buildings || respBld.data || [];
|
||||
recentLogs = respLogs.data?.items || [];
|
||||
recentLogs = (respLogs.data?.items || []).map(l => {
|
||||
let timeStr = l.scanned_time;
|
||||
if (!timeStr && l.scanned_at) {
|
||||
try {
|
||||
const raw = l.scanned_at;
|
||||
const d = new Date(raw.endsWith('Z') || raw.includes('+') || raw.includes('-') ? raw : raw + 'Z');
|
||||
timeStr = d.toLocaleTimeString('es-AR', {
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
hour12: false,
|
||||
timeZone: 'America/Argentina/Buenos_Aires'
|
||||
}) + ' hs';
|
||||
} catch (e) {
|
||||
timeStr = l.scanned_at.substring(11, 16) + ' hs';
|
||||
}
|
||||
}
|
||||
return { ...l, scanned_time: timeStr || '--' };
|
||||
});
|
||||
} catch (err) {
|
||||
console.warn('Reception scanner init notice:', err.message);
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user