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()) +
+
+

{{ __('Applications') }}

+
+ + @if($applications->isEmpty()) +
+
+
+ None. +
+
+
+ @else +
+ + + + + + + + + + + + + @foreach($applications->sortBy('name', SORT_NATURAL|SORT_FLAG_CASE) as $app) + + + + + + + + + @endforeach + +
{{ __('Server') }}{{ __('Name') }}{{ __('Description') }}{{ __('Sku') }}{{ __('Version') }}
+ + + {{ $app->server->name }} + + + + + + {{ $app->name }} + + + + {{ $app->description }} + + {{ $app->sku }} + + {{ $app->version }} + + @if(Auth::user()->canManageApps()) + + @endif +
+
+ @endif +
+ +@endif \ No newline at end of file diff --git a/resources/views/home/index.blade.php b/resources/views/home/index.blade.php index 91cbdb6..6b94d5b 100644 --- a/resources/views/home/index.blade.php +++ b/resources/views/home/index.blade.php @@ -8,6 +8,8 @@ {{ __('Servers') }} @elseif($tab === 'domains') {{ __('Domains') }} + @elseif($tab === 'applications') + {{ __('Applications') }} @elseif($tab === 'traces') {{ __('Traces') }} @elseif($tab === 'interdependencies') @@ -58,6 +60,14 @@ @endif @if(Auth::user()->canListServers()) + + @endif + @if(Auth::user()->canListServers())