83 lines
2.3 KiB
PHP
83 lines
2.3 KiB
PHP
<!doctype html>
|
|
<html lang="es">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Logs de Seguridad</title>
|
|
<style>
|
|
body {
|
|
font-family: DejaVu Sans, Arial, sans-serif;
|
|
font-size: 11px;
|
|
color: #111;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 16px;
|
|
margin: 0 0 8px 0;
|
|
}
|
|
|
|
.meta {
|
|
margin-bottom: 10px;
|
|
color: #444;
|
|
}
|
|
|
|
table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
th,
|
|
td {
|
|
border: 1px solid #d1d5db;
|
|
padding: 6px;
|
|
vertical-align: top;
|
|
text-align: left;
|
|
}
|
|
|
|
th {
|
|
background: #f3f4f6;
|
|
font-weight: bold;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Logs de seguridad</h1>
|
|
<div class="meta">Generado el {{ now()->format('d/m/Y H:i:s') }} - Total de registros: {{ $logs->count() }}</div>
|
|
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 6%;">ID</th>
|
|
<th style="width: 12%;">Fecha y hora</th>
|
|
<th style="width: 12%;">Acción</th>
|
|
<th style="width: 8%;">Rol</th>
|
|
<th style="width: 12%;">IP origen</th>
|
|
<th style="width: 18%;">Responsable</th>
|
|
<th style="width: 32%;">Descripción</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($logs as $log)
|
|
@php
|
|
$fechaLog = $log->fechahora ? \Illuminate\Support\Carbon::parse($log->fechahora)->format('d/m/Y H:i:s') : '-';
|
|
$responsable = trim(($log->responsable?->nombre ?? '') . ' ' . ($log->responsable?->apellido ?? '')) ?: '-';
|
|
@endphp
|
|
<tr>
|
|
<td>{{ $log->id }}</td>
|
|
<td>{{ $fechaLog }}</td>
|
|
<td>{{ $log->accion?->descripcion ?? '-' }}</td>
|
|
<td>{{ $log->rol }}</td>
|
|
<td>{{ $log->IPorigen }}</td>
|
|
<td>{{ $responsable }}</td>
|
|
<td>{{ $log->descripcion }}</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="7">No hay logs registrados.</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</body>
|
|
</html>
|
|
|