diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index ef4fe30..7051b3b 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -12,6 +12,8 @@ use Illuminate\Support\Collection; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Log; +use Illuminate\Support\Str; class HomeController extends Controller { @@ -98,7 +100,13 @@ public function index(Request $request) if ($tab === 'domains') { $domains = $servers->flatMap(fn(YnhServer $server) => $server->domains); } - return view('home.index', compact('tab', 'servers', 'orders', 'users', 'invitations', 'memory_usage', 'disk_usage', 'security_events', 'interdependencies', 'traces', 'pendingActions', 'domains')); + + $applications = collect(); + + 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')); } private function memoryUsage(Collection $servers): Collection diff --git a/resources/views/home/cards/_towerify_applications.blade.php b/resources/views/home/cards/_towerify_applications.blade.php new file mode 100644 index 0000000..9550bcb --- /dev/null +++ b/resources/views/home/cards/_towerify_applications.blade.php @@ -0,0 +1,115 @@ +@if(Auth::user()->canListApps()) +
{{ __('Server') }} | +{{ __('Name') }} | +{{ __('Description') }} | +{{ __('Sku') }} | +{{ __('Version') }} | ++ |
---|---|---|---|---|---|
+ + + {{ $app->server->name }} + + + | ++ + + {{ $app->name }} + + + | ++ {{ $app->description }} + | ++ {{ $app->sku }} + | ++ {{ $app->version }} + | ++ @if(Auth::user()->canManageApps()) + + @endif + | +