@php $applicationMenuItems = [ [ 'label' => 'Configuration', 'route' => 'project.application.configuration', 'active' => request()->routeIs('project.application.configuration'), ], [ 'label' => 'Deployments', 'route' => 'project.application.deployment.index', 'active' => request()->routeIs('project.application.deployment.index', 'project.application.deployment.show'), ], [ 'label' => 'Backups', 'route' => 'project.application.backup.index', 'active' => request()->routeIs('project.application.backup.*'), ], [ 'label' => 'Logs', 'route' => 'project.application.logs', 'active' => request()->routeIs('project.application.logs'), ], [ 'label' => 'Terminal', 'route' => 'project.application.command', 'active' => request()->routeIs('project.application.command'), 'navigate' => false, 'visible' => ! $application->destination->server->isSwarm() && auth()->user()?->can('canAccessTerminal'), ], ]; $configurationMenuItems = [ [ 'label' => 'General', 'route' => 'project.application.configuration', 'active' => request()->routeIs('project.application.configuration'), ], [ 'label' => 'Advanced', 'route' => 'project.application.advanced', 'active' => request()->routeIs('project.application.advanced'), ], [ 'label' => 'Swarm', 'route' => 'project.application.swarm', 'active' => request()->routeIs('project.application.swarm'), 'visible' => $application->destination->server->isSwarm(), ], [ 'label' => 'Environment Variables', 'route' => 'project.application.environment-variables', 'active' => request()->routeIs('project.application.environment-variables'), ], [ 'label' => 'Persistent Storage', 'route' => 'project.application.persistent-storage', 'active' => request()->routeIs('project.application.persistent-storage'), ], [ 'label' => 'Git Source', 'route' => 'project.application.source', 'active' => request()->routeIs('project.application.source'), 'visible' => $application->git_based(), ], [ 'label' => 'Servers', 'route' => 'project.application.servers', 'active' => request()->routeIs('project.application.servers'), ], [ 'label' => 'Scheduled Tasks', 'route' => 'project.application.scheduled-tasks.show', 'active' => request()->routeIs('project.application.scheduled-tasks.show', 'project.application.scheduled-tasks'), ], [ 'label' => 'Webhooks', 'route' => 'project.application.webhooks', 'active' => request()->routeIs('project.application.webhooks'), ], [ 'label' => 'Preview Deployments', 'route' => 'project.application.preview-deployments', 'active' => request()->routeIs('project.application.preview-deployments'), 'visible' => $application->git_based() || $application->build_pack === 'dockerimage', ], [ 'label' => 'Healthcheck', 'route' => 'project.application.healthcheck', 'active' => request()->routeIs('project.application.healthcheck'), 'visible' => $application->build_pack !== 'dockercompose', ], [ 'label' => 'Rollback', 'route' => 'project.application.rollback', 'active' => request()->routeIs('project.application.rollback'), ], [ 'label' => 'Resource Limits', 'route' => 'project.application.resource-limits', 'active' => request()->routeIs('project.application.resource-limits'), ], [ 'label' => 'Resource Operations', 'route' => 'project.application.resource-operations', 'active' => request()->routeIs('project.application.resource-operations'), ], [ 'label' => 'Metrics', 'route' => 'project.application.metrics', 'active' => request()->routeIs('project.application.metrics'), ], [ 'label' => 'Tags', 'route' => 'project.application.tags', 'active' => request()->routeIs('project.application.tags'), ], [ 'label' => 'Danger Zone', 'route' => 'project.application.danger', 'active' => request()->routeIs('project.application.danger'), ], ]; $applicationMenuItems = array_values(array_filter( $applicationMenuItems, fn (array $item): bool => $item['visible'] ?? true, )); $configurationMenuItems = array_values(array_filter( $configurationMenuItems, fn (array $item): bool => $item['visible'] ?? true, )); $activeConfigurationMenuItem = collect($configurationMenuItems)->firstWhere('active', true); $activeApplicationMenuItem = collect($applicationMenuItems)->firstWhere('active', true); $activeMobileMenuItem = $activeConfigurationMenuItem ?? $activeApplicationMenuItem ?? $applicationMenuItems[0]; $activeMobileMenuGroup = $activeConfigurationMenuItem ? 'configuration' : 'application'; $activeMobileNavigation = ($activeMobileMenuItem['navigate'] ?? true) ? 'navigate' : 'location'; $activeMobileMenuValue = $activeMobileNavigation.'|'.$activeMobileMenuGroup.'|'.route($activeMobileMenuItem['route'], $parameters); $mobileSectionChangeHandler = <<<'JS' const value = $event.target.value; if (!value) { return; } if (value.startsWith('navigate|')) { const url = value.split('|').slice(2).join('|'); window.Livewire?.navigate ? window.Livewire.navigate(url) : window.location.href = url; return; } if (value.startsWith('location|')) { const url = value.split('|').slice(2).join('|'); window.location.href = url; return; } resetToCurrent(); if (value.startsWith('external:')) { window.open(value.slice(9), '_blank', 'noopener'); return; } const action = value.slice(7); document.getElementById(`application-mobile-${action}-trigger`)?.click(); JS; @endphp
@if (!($application->build_pack === 'dockercompose' && is_null($application->docker_compose_raw)))
Actions
@if (!str($application->status)->startsWith('exited')) @if (!$application->destination->server->isSwarm()) @endif @if ($application->build_pack !== 'dockercompose') @if ($application->destination->server->isSwarm()) @else @endif @endif Stop @else @endif @if (!$application->destination->server->isSwarm()) @if ($application->status === 'running') @else @endif @endif
@endif
Configuration Deployments Backups
Logs @if ($application->restart_count > 0 && (!str($application->status)->startsWith('exited') || $application->stoppedAfterRestartLimit())) @endif
@if (!$application->destination->server->isSwarm()) @can('canAccessTerminal') Terminal @endcan @endif
@if ($application->build_pack === 'dockercompose' && is_null($application->docker_compose_raw))
Please load a Compose file.
@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