@php $routeIs = fn (string|array $routes): bool => \Illuminate\Support\Str::is($routes, $activeRouteName); // Settings covers all configuration sub-pages (General, Webhooks, Domains, …), // not only project.application.configuration. Primary tabs that are NOT settings: // backups, console, deployment logs, runtime logs. $isSettingsRoute = $routeIs('project.application.*') && ! $routeIs([ 'project.application.backup.*', 'project.application.command', 'project.application.deployment.*', 'project.application.logs', ]); $applicationMenuItems = [ [ 'label' => 'Settings', 'route' => 'project.application.configuration', 'active' => $isSettingsRoute, ], [ 'label' => 'Backups', 'route' => 'project.application.backup.index', 'active' => $routeIs('project.application.backup.*'), ], [ 'label' => 'Console', 'route' => 'project.application.command', 'active' => $routeIs('project.application.command'), 'navigate' => false, 'visible' => ! $application->destination->server->isSwarm() && auth()->user()?->can('canAccessTerminal'), ], [ 'label' => 'Deployment Logs', 'route' => 'project.application.deployment.index', 'active' => $routeIs(['project.application.deployment.index', 'project.application.deployment.show']), ], [ 'label' => 'Runtime Logs', 'route' => 'project.application.logs', 'active' => $routeIs('project.application.logs'), ], ]; $applicationMenuItems = array_values(array_filter( $applicationMenuItems, fn (array $item): bool => $item['visible'] ?? true, )); $applicationStatus = str($application->status ?? 'exited'); [$applicationStatusLabel, $applicationStatusType] = match (true) { $applicationStatus->startsWith('running') => ['Running', 'success'], $applicationStatus->startsWith('degraded') => ['Degraded', 'warning'], $applicationStatus->startsWith('restarting'), $applicationStatus->startsWith('starting') => ['Starting', 'warning'], $applicationStatus->startsWith('exited') => ['Stopped', 'neutral'], default => ['Deploying', 'warning'], }; @endphp

{{ $application->name }}

@if (!($application->build_pack === 'dockercompose' && is_null($application->docker_compose_raw)))
@if (!str($application->status)->startsWith('exited')) @if (!$application->destination->server->isSwarm()) @can('deploy', $application) @else @endcan @endif @if ($application->build_pack !== 'dockercompose') @if ($application->destination->server->isSwarm()) @can('deploy', $application) @else @endcan @else @can('deploy', $application) @else @endcan @endif @endif @can('deploy', $application) @else @endcan @else @can('deploy', $application) @else @endcan @endif @if (!$application->destination->server->isSwarm()) @can('deploy', $application) @else @endcan @endif
@endif
{{-- Tabs may scroll; keep Links outside overflow so the dropdown never creates a scrollbar. --}} @foreach ($applicationMenuItems as $menuItem) $menuItem['active'], ]) @if ($menuItem['active']) aria-current="page" @endif @if ($menuItem['navigate'] ?? true) {{ wireNavigate() }} @endif href="{{ route($menuItem['route'], $parameters) }}"> {{ $menuItem['label'] }} @endforeach
{{-- Layer-2 top nav: one unified bar — menus left, actions right --}}
{{-- Tabs alone may scroll; keep Links outside overflow so the dropdown never creates a scrollbar. --}} @foreach ($applicationMenuItems as $menuItem) $menuItem['active'], ]) @if ($menuItem['active']) aria-current="page" @endif @if ($menuItem['navigate'] ?? true) {{ wireNavigate() }} @endif href="{{ route($menuItem['route'], $parameters) }}"> {{ $menuItem['label'] }} @if ($menuItem['label'] === 'Runtime Logs' && $application->restart_count > 0 && (!str($application->status)->startsWith('exited') || $application->stoppedAfterRestartLimit())) @endif @endforeach
{{-- Status badge temporarily hidden — will be redesigned later: --}} @if ($application->build_pack === 'dockercompose' && is_null($application->docker_compose_raw)) Load a Compose file to deploy. @else @if (!$application->destination->server->isSwarm()) @endif @if (!str($application->status)->startsWith('exited')) @if (!$application->destination->server->isSwarm()) Redeploy @endif @if ($application->build_pack !== 'dockercompose') @if ($application->destination->server->isSwarm()) Update Service @else Restart @endif @endif Stop @else Deploy @endif @endif
{{-- Spacer: in-flow stand-in for the fixed layer-2 nav (h-12). Not visible content — keeps page body clear of the bar. --}}