diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 7051b3b..50d9bda 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -106,7 +106,12 @@ public function index(Request $request) if ($tab === "applications") { $applications = $servers->flatMap(fn(YnhServer $server) => $server->applications); } - return view('home.index', compact('tab', 'servers', 'orders', 'users', 'invitations', 'memory_usage', 'disk_usage', 'security_events', 'interdependencies', 'traces', 'pendingActions', 'domains', 'applications')); + + $backups = collect(); + if ($tab === 'backups') { + $backups = $servers->flatMap(fn(YnhServer $server) => $server->backups); + } + return view('home.index', compact('tab', 'servers', 'orders', 'users', 'invitations', 'memory_usage', 'disk_usage', 'security_events', 'interdependencies', 'traces', 'pendingActions', 'domains', 'applications', 'backups')); } private function memoryUsage(Collection $servers): Collection diff --git a/resources/views/home/cards/_towerify_backups.blade.php b/resources/views/home/cards/_towerify_backups.blade.php new file mode 100644 index 0000000..84db5c6 --- /dev/null +++ b/resources/views/home/cards/_towerify_backups.blade.php @@ -0,0 +1,97 @@ +@if(Auth::user()->canListServers()) + +
{{ __('Date') }} | +{{ __('Server') }} | +{{ __('Name') }} | +{{ __('Size') }} | ++ |
---|---|---|---|---|
+ {{ $backup->updated_at->format('Y-m-d H:i:s') }} + | ++ {{ $backup->server->name }} + | ++ {{ $backup->name }} + | ++ {{ formatBytes($backup->size) }} + | ++ @if($server->isReady() && Auth::user()->canManageServers()) + + + + @endif + | +
+ @foreach($backup->result['apps'] as $app => $status) + @if($status === 'Success') + {{ $app }} + @else + {{ $app }} + @endif + @endforeach + | +