@php $configuredCount = collect($domainRows)->where('is_suggested', false)->count(); $suggestedCount = collect($domainRows)->where('is_suggested', true)->count(); $hasRows = count($domainRows) > 0; $helperText = $isCompose ? 'Manage domains for every service in this Docker Compose application.' : 'Manage domains for this application.'; @endphp
@can('update', $application) Recheck DNS @endcan @if ($labelsAreWritable) Container label readonly mode is disabled. Domains must be set in the Labels section on the General page. @endif @if ($isCompose && count($composeServices) === 0) No non-database services found in the Docker Compose file. Domains can only be assigned to application services. @endif @cannot('update', $application) You don't have permission to manage domains. Contact your team administrator for access. @endcannot @if (! $isCompose) @if ($labelsAreWritable) @if ($application->redirect === 'both') @elseif ($application->redirect === 'www') @elseif ($application->redirect === 'non-www') @endif @else
@can('update', $application)
@endcan
@endif @elseif (! $labelsAreWritable && count($composeServices) > 0)

Per-service www/non-www redirects are available next to each service group in the table below.

@endif
{{-- Toolbar --}}

{{ $configuredCount }} domain{{ $configuredCount === 1 ? '' : 's' }} @if ($suggestedCount > 0) · {{ $suggestedCount }} not added @endif

@can('update', $application) @include('livewire.project.shared.cloudflare-autoconfigure') @unless ($labelsAreWritable) @if (! $isCompose || count($composeServices) > 0)
@if ($isCompose && count($composeServices) > 0) @foreach ($composeServices as $serviceName) @endforeach @endif @if ($addDomainDnsFailed) This domain does not currently resolve to this server. Traffic may not reach Coolify until you update DNS. Are you sure you want to add it anyway? @if (filled($addDomainDnsMessage))
{{ $addDomainDnsMessage }}
@endif
@endif
Generate domain
@if ($addDomainDnsFailed) Continue @else Save @endif
@endif @endunless @endcan
{{-- Table / empty --}}
@if ($isCompose && count($composeServices) === 0 && ! $hasRows) @elseif (! $hasRows) @elseif ($isCompose) @php $grouped = collect($domainRows)->groupBy(fn ($row) => $row['service'] ?? '__unknown'); $serviceOrder = $composeServices; foreach ($grouped->keys() as $name) { if ($name !== '__unknown' && ! in_array($name, $serviceOrder, true)) { $serviceOrder[] = $name; } } @endphp
@foreach ($serviceOrder as $serviceName) @php $rows = $grouped->get($serviceName, collect()); $serviceConfigured = $rows->where('is_suggested', false)->count(); $serviceSuggested = $rows->where('is_suggested', true)->count(); $redirectWireKey = $this->serviceRedirectWireKey($serviceName); @endphp

{{ $serviceName }}

{{ $serviceConfigured }} domain{{ $serviceConfigured === 1 ? '' : 's' }} @if ($serviceSuggested > 0) · {{ $serviceSuggested }} not added @endif

@unless ($labelsAreWritable)
@can('update', $application) @endcan
@endunless
@if ($rows->isEmpty()) @else
Domain Service DNS Check Last checked
@foreach ($rows as $row) @php $index = collect($domainRows)->search( fn ($item) => $item['url'] === $row['url'] && ($item['service'] ?? null) === ($row['service'] ?? null) && (bool) ($item['is_suggested'] ?? false) === (bool) ($row['is_suggested'] ?? false), ); @endphp @include('livewire.project.application.partials.domain-row', [ 'index' => $index, 'row' => $row, 'application' => $application, 'labelsAreWritable' => $labelsAreWritable, 'isCompose' => true, ]) @endforeach
@endif
@endforeach
@else
Domain DNS Check Last checked
@foreach ($domainRows as $index => $row) @include('livewire.project.application.partials.domain-row', [ 'index' => $index, 'row' => $row, 'application' => $application, 'labelsAreWritable' => $labelsAreWritable, 'isCompose' => false, ]) @endforeach
@endif
{{-- Edit domain modal: open/close is Alpine-only; server runs only on Save / Continue. --}}