@extends('layouts.app') @section('title', 'Gestión de Respaldos') @section('content')
Gestión de Respaldos
Último Respaldo

{{ $lastBackup ? $lastBackup->created_at->diffForHumans() : 'Nunca' }}

Total Respaldos

{{ $totalBackups }}

Espacio Usado

{{ formatBytes($totalSize) }}

Estado Sistema

{{ $systemStatus ? 'Activo' : 'Inactivo' }}

Historial de Respaldos
@forelse($backups as $backup) @empty @endforelse
Tipo Archivo Tamaño Estado Duración Fecha Usuario Acciones
{{ strtoupper($backup->type) }}
{{ basename($backup->filename) }}
{{ $backup->path }}
{{ formatBytes($backup->file_size) }} {{ ucfirst($backup->status) }} @if($backup->completed_at && $backup->started_at) {{ $backup->started_at->diffInSeconds($backup->completed_at) }}s @else - @endif {{ $backup->created_at->format('d/m/Y H:i') }} {{ $backup->createdBy->name ?? 'Sistema' }}
@if($backup->status === 'completed') @can('backup-restore') @endcan @endif @can('backup-delete') @endcan
No hay respaldos disponibles
@if($backups->hasPages())
{{ $backups->links() }}
@endif
@endsection @push('scripts') @endpush @php function formatBytes($bytes, $precision = 2) { $units = array('B', 'KB', 'MB', 'GB', 'TB'); for ($i = 0; $bytes > 1024 && $i < count($units) - 1; $i++) { $bytes /= 1024; } return round($bytes, $precision) . ' ' . $units[$i]; } function getTypeColor($type) { $colors = [ 'full' => 'primary', 'incremental' => 'info', 'differential' => 'warning', 'manual' => 'success', 'scheduled' => 'secondary' ]; return $colors[$type] ?? 'dark'; } function getStatusColor($status) { $colors = [ 'completed' => 'success', 'failed' => 'danger', 'in_progress' => 'warning', 'cancelled' => 'secondary' ]; return $colors[$status] ?? 'secondary'; } @endphp