An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix(ui): declutter domains toolbar with DNS menu and card header
Andras Bacsaic410f355e74b
diff --git a/resources/views/livewire/project/application/domains.blade.php b/resources/views/livewire/project/application/domains.blade.phpindex 68c42d87b8..63e8f80bc6 100644--- a/resources/views/livewire/project/application/domains.blade.php+++ b/resources/views/livewire/project/application/domains.blade.php@@ -79,113 +79,79 @@</x-callout>@endcannot- {{-- Toolbar --}}- <div id="domains-section" class="flex flex-wrap items-center gap-2">- @if ($hasRows)- <div class="relative w-full sm:w-64">- <x-reicon name="search"- class="pointer-events-none absolute top-1/2 left-2.5 z-10 size-3.5 -translate-y-1/2 text-neutral-400 dark:text-fg-faint" />- <input type="search" x-model="domainSearch" aria-label="Search services or domains"- class="input h-8! w-full pl-8! text-[13px]!" placeholder="Search services or domains" />- </div>- @endif- <div class="ml-auto flex flex-wrap items-center gap-2">- @can('update', $application)- <x-forms.button wire:click="checkAllDns" :showLoadingIndicator="false" wire:loading.attr="disabled" wire:target="checkAllDns,checkDomainDns">- <x-reicon name="refresh" class="size-3.5" />- Check all DNS- </x-forms.button>- <div class="relative shrink-0">- @include('livewire.project.shared.cloudflare-autoconfigure')+ <x-application.settings-section id="domains-section" title="Domains" :flush="$hasRows" class="scroll-mt-28">+ <x-slot:actions>+ @if ($hasRows)+ <div class="relative w-full sm:w-64">+ <x-reicon name="search"+ class="pointer-events-none absolute top-1/2 left-2.5 z-10 size-3.5 -translate-y-1/2 text-neutral-400 dark:text-fg-faint" />+ <input type="search" x-model="domainSearch" aria-label="Search services or domains"+ class="input h-8! w-full pl-8! text-[13px]!" placeholder="Search services or domains" /></div>- @unless ($labelsAreWritable)- @if (! $isCompose || count($composeServices) > 0)- <x-modal-input title="Add domain" :closeOutside="false" :wireIgnore="false"- canGate="update" :canResource="$application">- <x-slot:content>- <button type="button"- class="button button-highlighted">- <x-reicon name="plus" class="size-3.5" />- Add domain- </button>- </x-slot:content>- <form wire:submit="addDomain" class="application-settings-form flex flex-col gap-4">- @if ($isCompose && count($composeServices) > 0)- <x-forms.listbox canGate="update" :canResource="$application" label="Service" id="newDomainService" required- :options="collect($composeServices)->map(fn ($serviceName) => [- 'value' => $serviceName,- 'label' => $serviceName,- ])->values()->all()"- :disabled="! auth()->user()->can('update', $application)" />- @endif+ @endif+ <div class="flex flex-wrap items-center gap-2">+ @can('update', $application)+ <div class="relative shrink-0">+ @include('livewire.project.shared.cloudflare-autoconfigure', ['showCheckAllDns' => $hasRows])+ </div>+ @unless ($labelsAreWritable)+ @if (! $isCompose || count($composeServices) > 0)+ <x-modal-input title="Add domain" :closeOutside="false" :wireIgnore="false"+ canGate="update" :canResource="$application">+ <x-slot:content>+ <button type="button"+ class="button button-highlighted">+ <x-reicon name="plus" class="size-3.5" />+ Add domain+ </button>+ </x-slot:content>+ <form wire:submit="addDomain" class="application-settings-form flex flex-col gap-4">+ @if ($isCompose && count($composeServices) > 0)+ <x-forms.listbox canGate="update" :canResource="$application" label="Service" id="newDomainService" required+ :options="collect($composeServices)->map(fn ($serviceName) => [+ 'value' => $serviceName,+ 'label' => $serviceName,+ ])->values()->all()"+ :disabled="! auth()->user()->can('update', $application)" />+ @endif- <x-forms.domain-input id="newDomainParts" errorId="newDomain" />+ <x-forms.domain-input id="newDomainParts" errorId="newDomain" />- @if ($addDomainDnsFailed)- <x-callout type="danger" title="DNS is not pointing to the right IP">- 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))- <div class="pt-2">{{ $addDomainDnsMessage }}</div>- @endif- </x-callout>- @endif+ @if ($addDomainDnsFailed)+ <x-callout type="danger" title="DNS is not pointing to the right IP">+ 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))+ <div class="pt-2">{{ $addDomainDnsMessage }}</div>+ @endif+ </x-callout>+ @endif- <div class="flex flex-wrap items-center justify-between gap-2 pt-2">- <x-forms.button type="button" wire:click="generateDomain">- Generate domain- </x-forms.button>- <div class="flex flex-wrap gap-2">- @if ($addDomainDnsFailed)- <x-forms.button type="button" wire:click="confirmAddDomainDespiteDns" isError>- Continue- </x-forms.button>- @else- <x-forms.button type="submit" isHighlighted>- Save- </x-forms.button>- @endif+ <div class="flex flex-wrap items-center justify-between gap-2 pt-2">+ <x-forms.button type="button" wire:click="generateDomain">+ Generate domain+ </x-forms.button>+ <div class="flex flex-wrap gap-2">+ @if ($addDomainDnsFailed)+ <x-forms.button type="button" wire:click="confirmAddDomainDespiteDns" isError>+ Continue+ </x-forms.button>+ @else+ <x-forms.button type="submit" isHighlighted>+ Save+ </x-forms.button>+ @endif+ </div></div>- </div>- </form>- </x-modal-input>- @endif- @endunless- @endcan- </div>- </div>-- @if ($hasRows && ! $labelsAreWritable)- <div class="flex flex-wrap items-center justify-end gap-2 service-domains-https">- @if ($hasHttpsDomains)- <label for="isForceHttpsEnabled-trigger" class="mb-0! text-[12px]!">Redirect HTTP to HTTPS</label>- <x-helper helper="Disable only when Cloudflare Tunnel or another proxy connects to Coolify over HTTP. Keep enabled when Cloudflare uses Full or Full (Strict) SSL." />- <div class="w-28 shrink-0">- <x-forms.listbox canGate="update" :canResource="$application" id="isForceHttpsEnabled"- onChange="updateForceHttps" portal- :options="[- ['value' => true, 'label' => 'Enabled'],- ['value' => false, 'label' => 'Disabled'],- ]" :disabled="! auth()->user()->can('update', $application)" />- </div>- @endif- <label for="isPermanentRedirectEnabled-trigger" class="mb-0! text-[12px]!">Redirect type</label>- <x-helper helper="Applies to the HTTP to HTTPS and www redirects. Permanent (301/308) is better for SEO, but browsers cache it. Use Temporary (302/307) while you test a redirect." />- <div class="w-32 shrink-0">- <x-forms.listbox canGate="update" :canResource="$application" id="isPermanentRedirectEnabled"- onChange="updatePermanentRedirect" portal- :options="[- ['value' => false, 'label' => 'Temporary'],- ['value' => true, 'label' => 'Permanent'],- ]" :disabled="! auth()->user()->can('update', $application)" />+ </form>+ </x-modal-input>+ @endif+ @endunless+ @endcan</div>- </div>- @endif+ </x-slot:actions>- {{-- Table / empty --}}- <div id="domains-table-section"- class="application-settings-section-body mt-1 scroll-mt-28 {{ $hasRows ? 'is-flush' : '' }} w-full">@if ($hasRows)<div class="data-table-header service-domains-overview-grid"><span>Domain</span>@@ -287,7 +253,31 @@description="No domain matches your search." icon-name="search" /></div>@endif- </div>+ </x-application.settings-section>++ @if ($hasRows && ! $labelsAreWritable)+ <x-application.settings-section id="domain-redirects-section" title="Redirects"+ helper="Applies to all domains of this application.">+ <div class="grid gap-4 lg:grid-cols-2">+ @if ($hasHttpsDomains)+ <x-forms.listbox canGate="update" :canResource="$application" id="isForceHttpsEnabled"+ label="Redirect HTTP to HTTPS" onChange="updateForceHttps"+ helper="Disable only when Cloudflare Tunnel or another proxy connects to Coolify over HTTP. Keep enabled when Cloudflare uses Full or Full (Strict) SSL."+ :options="[+ ['value' => true, 'label' => 'Enabled'],+ ['value' => false, 'label' => 'Disabled'],+ ]" :disabled="! auth()->user()->can('update', $application)" />+ @endif+ <x-forms.listbox canGate="update" :canResource="$application" id="isPermanentRedirectEnabled"+ label="Redirect type" onChange="updatePermanentRedirect"+ helper="Applies to the HTTP to HTTPS and www redirects. Permanent (301/308) is better for SEO, but browsers cache it. Use Temporary (302/307) while you test a redirect."+ :options="[+ ['value' => false, 'label' => 'Temporary'],+ ['value' => true, 'label' => 'Permanent'],+ ]" :disabled="! auth()->user()->can('update', $application)" />+ </div>+ </x-application.settings-section>+ @endif{{-- One dialog for address edits and automatically saved domain settings. --}}<div class="relative h-auto w-auto" :class="{ 'z-40': modalOpen }"diff --git a/resources/views/livewire/project/service/domains.blade.php b/resources/views/livewire/project/service/domains.blade.phpindex 0b661401bd..4576b17345 100644--- a/resources/views/livewire/project/service/domains.blade.php+++ b/resources/views/livewire/project/service/domains.blade.php@@ -79,16 +79,9 @@@endif<div class="ml-auto flex flex-wrap items-center gap-2">@can('update', $service)- @if ($configuredCount > 0)- <x-forms.button wire:click="checkAllDns" :showLoadingIndicator="false" wire:loading.attr="disabled"- wire:target="checkAllDns,checkDomainDns">- <x-reicon name="refresh" class="size-3.5" />- Check all DNS- </x-forms.button>- @endif@if ($serviceAppCount > 0)<div class="relative shrink-0">- @include('livewire.project.shared.cloudflare-autoconfigure')+ @include('livewire.project.shared.cloudflare-autoconfigure', ['showCheckAllDns' => $configuredCount > 0])</div><x-modal-input title="Add domain" :closeOutside="false" :wireIgnore="false"canGate="update" :canResource="$service">diff --git a/resources/views/livewire/project/shared/cloudflare-autoconfigure.blade.php b/resources/views/livewire/project/shared/cloudflare-autoconfigure.blade.phpindex 9b565c4e98..12a68650ea 100644--- a/resources/views/livewire/project/shared/cloudflare-autoconfigure.blade.php+++ b/resources/views/livewire/project/shared/cloudflare-autoconfigure.blade.php@@ -1,4 +1,4 @@-{{-- DNS entries: Domain Connect (Cloud only + key) and/or generic Type/Name/Value records. --}}+{{-- DNS menu: check all DNS, Domain Connect (Cloud only + key) and/or generic Type/Name/Value records. --}}@php$domainConnectAvailable = $this->domainConnectAvailable();$dnsAuthResource = property_exists($this, 'application') ? $this->application : $this->service;@@ -6,9 +6,9 @@<div x-data="{ dnsEntriesOpen: false }" class="relative" @click.outside="dnsEntriesOpen = false"><button type="button" class="button" @click="dnsEntriesOpen = !dnsEntriesOpen" aria-haspopup="menu"- x-bind:aria-expanded="dnsEntriesOpen" title="DNS entries for this server">+ x-bind:aria-expanded="dnsEntriesOpen" title="DNS checks and records for this server"><x-reicon name="globe" class="size-3.5" />- DNS entries+ DNS<span class="inline-flex transition-transform" :class="dnsEntriesOpen && 'rotate-180'"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2"stroke="currentColor" class="size-3.5 shrink-0 opacity-60">@@ -18,6 +18,14 @@</button><div x-show="dnsEntriesOpen" x-cloak role="menu" x-transition.origin.top.rightclass="listbox-panel left-auto! right-0! z-[90]! w-56! min-w-56!">+ @if ($showCheckAllDns ?? false)+ <button type="button" class="listbox-option justify-start! gap-2.5!" role="menuitem"+ wire:click="checkAllDns" wire:loading.attr="disabled" wire:target="checkAllDns,checkDomainDns"+ @click="dnsEntriesOpen = false">+ <x-reicon name="refresh" class="size-3.5 shrink-0 opacity-70" />+ Check all DNS+ </button>+ @endif@if ($domainConnectAvailable)<button type="button" class="listbox-option justify-start! gap-2.5!" role="menuitem"wire:click="openCloudflareAutoconfigureModal" @click="dnsEntriesOpen = false">diff --git a/tests/Feature/ApplicationDomainsTest.php b/tests/Feature/ApplicationDomainsTest.phpindex 65b3c38740..15315aa3f7 100644--- a/tests/Feature/ApplicationDomainsTest.php+++ b/tests/Feature/ApplicationDomainsTest.php@@ -720,7 +720,7 @@ it('shows the compose service redirect control in domain settings', function ()it('shows dns entries control next to Add', function () {Livewire::test(Domains::class, ['application' => $this->application->fresh()])->assertSuccessful()- ->assertSee('DNS entries')+ ->assertSee('DNS checks and records for this server')->assertSee('Manual records');});@@ -731,7 +731,7 @@ it('shows dns entries when domains are managed through labels', function () {Livewire::test(Domains::class, ['application' => $this->application->fresh(['settings'])])->assertSuccessful()- ->assertSee('DNS entries')+ ->assertSee('DNS checks and records for this server')->assertSee('Manual records');});diff --git a/tests/Feature/ServiceDomainsTest.php b/tests/Feature/ServiceDomainsTest.phpindex b660d4d174..6b23366766 100644--- a/tests/Feature/ServiceDomainsTest.php+++ b/tests/Feature/ServiceDomainsTest.php@@ -326,7 +326,7 @@ it('does not add a single-label hostname as a service domain', function () {it('shows dns entries control next to Add', function () {Livewire::test(Domains::class, ['service' => $this->service->fresh(['applications', 'server'])])->assertSuccessful()- ->assertSee('DNS entries')+ ->assertSee('DNS checks and records for this server')->assertSee('Manual records');});diff --git a/tests/v4/Browser/ApplicationConfigurationTest.php b/tests/v4/Browser/ApplicationConfigurationTest.phpindex 451051ca7e..6348a60c9c 100644--- a/tests/v4/Browser/ApplicationConfigurationTest.php+++ b/tests/v4/Browser/ApplicationConfigurationTest.php@@ -331,7 +331,11 @@ it('uses compact application domains with unified settings and a form save butto$url = applicationConfigurationUrl($this->stack['project'], $this->stack['environment'], $this->application).'/domains';$page = visit($url);$page->click('Accept and close')+ ->click('[title="DNS checks and records for this server"]')->assertSee('Check all DNS')+ ->screenshot(filename: 'application-domains-dns-menu')+ ->click('[title="DNS checks and records for this server"]')+ ->assertSee('Redirect type')->assertSee('Protocol redirect')->assertSee('Search indexing')->assertDontSee('Search engine indexing')diff --git a/tests/v4/Browser/ServiceConfigurationTest.php b/tests/v4/Browser/ServiceConfigurationTest.phpindex 158a123255..d818573a80 100644--- a/tests/v4/Browser/ServiceConfigurationTest.php+++ b/tests/v4/Browser/ServiceConfigurationTest.php@@ -205,7 +205,9 @@ it('keeps domain settings out of the overview and supports editing and removal',$url = serviceConfigurationUrl($this->stack['project'], $this->stack['environment'], $this->service).'/domains';$page = visit($url);$page->click('Accept and close')+ ->click('[title="DNS checks and records for this server"]')->assertSee('Check all DNS')+ ->click('[title="DNS checks and records for this server"]')->assertVisible('[aria-label="Internal port 8080"]')->assertDontSee('Search engine indexing')->assertDontSee('Remove domain')