@extends('layouts.app') @section('content')

SHIFTBRIDGE ENTERPRISE BACKUP

Backup, Restore & Disaster Recovery Platform
Create Backup
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- HEALTH MONITORING BANNER --}} @if(!$stats['system_protected'])
Critical: No successful backup found. System is not protected. Create a backup immediately.
@elseif($stats['last_successful_backup'] && \Carbon\Carbon::parse($stats['last_successful_backup'])->diffInDays() > 7)
Warning: Last successful backup was {{ \Carbon\Carbon::parse($stats['last_successful_backup'])->diffForHumans() }}. Consider running a backup.
@endif {{-- SYSTEM PROTECTION STATUS --}}
System Protection Status
@if($stats['system_protected']) @else @endif
{{ $stats['system_protected'] ? 'Protected' : 'Not Protected' }}
Overall Status
{{ $stats['last_backup'] ? \Carbon\Carbon::parse($stats['last_backup'])->diffForHumans() : 'Never' }}
Last Backup
{{ $stats['last_successful_backup'] ? \Carbon\Carbon::parse($stats['last_successful_backup'])->diffForHumans() : 'Never' }}
Last Successful
{{ number_format($stats['total_size'] / 1024 / 1024, 2) }} MB
Total Size
{{-- SCHEDULED BACKUPS --}}
Scheduled Backups Run backups automatically on a schedule
@csrf
@if(($policies ?? collect())->isNotEmpty())
@foreach($policies as $p) @php $pScope = json_decode($p->scope, true) ?? []; @endphp @endforeach
Name Frequency Time Contents Keep Next run Last run Status Actions
{{ $p->name }} {{ ucfirst($p->schedule_type) }} {{ $p->schedule_expression ?: '02:00' }} {{ in_array('cdr', $pScope) ? 'Full' : 'Configuration' }} {{ $p->retention_days }}d {{ $p->next_run_at ? \Carbon\Carbon::parse($p->next_run_at)->format('M d, H:i') : '—' }} {{ $p->last_run_at ? \Carbon\Carbon::parse($p->last_run_at)->diffForHumans() : 'Never' }} @if($p->enabled) Enabled @else Paused @endif
@csrf
@csrf @method('DELETE')
@else
No schedules yet. Add one above — e.g. a daily configuration backup at 02:00.
@endif
{{-- BACKUP CATALOG --}}
Backup Catalog {{ $backups->total() }}
@forelse($backups as $backup) @empty @endforelse
Name Type Status Size Created Verified Actions
{{ $backup->name }}
@if($backup->type === 'snapshot') Snapshot @endif @if($backup->destination_id)
Dest: {{ $backup->destination_id }}
@endif
{{ ucfirst($backup->type) }} @if($backup->encrypted) @endif @if($backup->status === 'completed') Completed @elseif($backup->status === 'running') Running @elseif($backup->status === 'failed') Failed @else {{ ucfirst($backup->status) }} @endif {{ number_format($backup->size_bytes / 1024 / 1024, 2) }} MB {{ \Carbon\Carbon::parse($backup->created_at)->format('M d, H:i') }} @if($backup->verified) Verified @else Pending @endif
@if($backup->status === 'completed' && $backup->file_path) @if($backup->type === 'snapshot') @else @endif @endif
@csrf @method('DELETE')
No backups found. Create your first backup to get started.
{{-- RECENT SNAPSHOTS --}}
Recent Pre-Change Snapshots
@php $snapshots = DB::table('backup_jobs') ->where('type', 'snapshot') ->orderBy('created_at', 'desc') ->limit(5) ->get(); @endphp @forelse($snapshots as $snapshot) @empty @endforelse
Snapshot Name Context Created Actions
{{ $snapshot->name }}
@php $details = json_decode(DB::table('backup_audit_log') ->where('backup_job_id', $snapshot->id) ->where('action', 'snapshot_created') ->value('details'), true); @endphp @if($details)
Context: {{ $details['context'] ?? 'N/A' }}
@endif
@if(isset($details['context'])) {{ ucfirst($details['context']) }} @endif {{ \Carbon\Carbon::parse($snapshot->created_at)->format('M d, H:i:s') }}
@if($snapshot->status === 'completed' && $snapshot->file_path) @endif
No snapshots found. Snapshots are automatically created before configuration changes.
@endsection