Fase 3 (islas): historiales de seguridad y transacciones en React/TSX

Tabla genérica reutilizable HistoryTable (columnas por data-columns, filas por
json_script) + entry history_table:
- security_history: intentos de conexión (username/status/ip/fecha). Se elimina la
  caja "actividad" duplicada. Las vistas pasan login_attempts_data serializable.
- trans_history: historial de transacciones (StripeLog) con transactions_data.

Datos embebidos con json_script (sin endpoint extra). Verificado: check OK, ambas
plantillas renderizan la isla con datos.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-12 21:52:20 +00:00
parent cefa30dabc
commit 230d401c75
7 changed files with 107 additions and 82 deletions
+14 -1
View File
@@ -68,4 +68,17 @@ def security_history_view(request):
# Obtener los últimos 20 intentos de inicio de sesión
login_attempts = LoginAttempt.objects.filter(username=username).order_by('-timestamp')[:20]
return render(request, 'account/security_history.html', {'login_attempts': login_attempts})
login_attempts_data = [
{
'username': a.username,
'status': a.status,
'ip_address': a.ip_address,
'timestamp': a.timestamp.strftime('%d-%m-%Y %H:%M:%S') if a.timestamp else '',
}
for a in login_attempts
]
return render(request, 'account/security_history.html', {
'login_attempts': login_attempts,
'login_attempts_data': login_attempts_data,
})