From 69ba001e21cd29efb3c579535247e08c34ca635c Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 10 Aug 2026 15:10:30 +0200 Subject: [PATCH] feat(domains): add inline indexing and redirect controls Move domain indexing and redirect settings into domain management views and include noindex changes in deployment configuration diffs. --- UI_REDESIGN.md | 2 + app/Livewire/Project/Application/Domains.php | 38 ++++++++++ app/Livewire/Project/Application/General.php | 27 -------- app/Livewire/Project/Service/Domains.php | 53 +++++++++++++- app/Livewire/Project/Service/EditDomain.php | 28 -------- app/Models/Application.php | 2 +- .../ApplicationConfigurationSnapshot.php | 1 + .../ConfigurationDiffer.php | 16 ++++- .../views/components/forms/listbox.blade.php | 25 ++++++- .../project/application/domains.blade.php | 69 +++++++++---------- .../project/application/general.blade.php | 19 ----- .../application/partials/domain-row.blade.php | 1 + .../project/service/domains.blade.php | 51 +++++++------- .../project/service/edit-domain.blade.php | 20 ------ .../service/partials/domain-table.blade.php | 8 ++- .../shared/cloudflare-autoconfigure.blade.php | 7 +- .../ApplicationConfigurationChangedTest.php | 36 ++++++++++ tests/Feature/ApplicationDomainsTest.php | 29 ++++++-- .../Feature/ApplicationNoindexDomainsTest.php | 9 ++- .../Livewire/ConfigurationCheckerTest.php | 20 ++++++ .../Service/EditDomainPortValidationTest.php | 6 +- tests/Feature/ServiceDomainsTest.php | 45 ++++++++++-- 22 files changed, 327 insertions(+), 185 deletions(-) diff --git a/UI_REDESIGN.md b/UI_REDESIGN.md index 46b605ebc..bc690cd1c 100644 --- a/UI_REDESIGN.md +++ b/UI_REDESIGN.md @@ -24,6 +24,8 @@ compact divided list, not legacy green check SVGs or fixed-width status rows. > - Build frontend assets in the Vitee container with > `docker exec coolify-vite npm run build`. > - Use existing components before adding another styling abstraction. +> - Use `` for dropdown controls. Never add a native +> ` - - - - +
+
@else {{ $redirectLabel }} @@ -384,6 +371,14 @@ @enderror + @unless ($labelsAreWritable) + + @endunless + @if ($editDomainDnsFailed) This domain does not currently resolve to this server. diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php index 769502e44..b3775a1dd 100644 --- a/resources/views/livewire/project/application/general.blade.php +++ b/resources/views/livewire/project/application/general.blade.php @@ -71,25 +71,6 @@ - @if ($buildPack !== 'dockercompose' && $application->settings->is_container_label_readonly_enabled && count($this->configuredDomains) > 0) -
-
-

Search engine indexing

- -
- @foreach ($this->configuredDomains as $domain) - - @endforeach -
- @endif @if ($buildPack !== 'dockercompose') diff --git a/resources/views/livewire/project/application/partials/domain-row.blade.php b/resources/views/livewire/project/application/partials/domain-row.blade.php index 6f6446ba0..785a27a9e 100644 --- a/resources/views/livewire/project/application/partials/domain-row.blade.php +++ b/resources/views/livewire/project/application/partials/domain-row.blade.php @@ -107,6 +107,7 @@ index: {{ $index }}, url: @js($row['url']), service: @js($row['service'] ?? null), + indexing: @js($application->isDomainNoindexed($row['url']) ? 'noindex' : 'index'), })" class="icon-button shrink-0" title="Edit domain" aria-label="Edit domain"> diff --git a/resources/views/livewire/project/service/domains.blade.php b/resources/views/livewire/project/service/domains.blade.php index 91d2413ce..d2755b039 100644 --- a/resources/views/livewire/project/service/domains.blade.php +++ b/resources/views/livewire/project/service/domains.blade.php @@ -22,11 +22,15 @@ localEditingIndex: @js($editingIndex), localEditingDomain: @js($editingDomain), localEditingServiceApplicationId: @js($editingServiceApplicationId), - openEditDomain(index, url, serviceApplicationId, serviceLabel) { + localDirection: 'both', + localIndexing: 'index', + openEditDomain(index, url, serviceApplicationId, serviceLabel, direction, indexing) { this.localEditingIndex = index; this.localEditingDomain = url; this.localEditingServiceApplicationId = serviceApplicationId; this.editingServiceLabel = serviceLabel || ''; + this.localDirection = direction || 'both'; + this.localIndexing = indexing || 'index'; this.modalOpen = true; this.$nextTick(() => document.getElementById('editingDomainLocal')?.focus?.()); }, @@ -41,6 +45,8 @@ $wire.editingIndex = this.localEditingIndex; $wire.editingDomain = this.localEditingDomain; $wire.editingServiceApplicationId = this.localEditingServiceApplicationId; + $wire.editingDirection = this.localDirection; + $wire.editingIndexing = this.localIndexing; $wire.showEditDomainModal = true; }, matchesDomainSearch(value) { @@ -50,7 +56,7 @@ return values.some((value) => this.matchesDomainSearch(value)); }, }" - @open-edit-domain.window="openEditDomain($event.detail.index, $event.detail.url, $event.detail.serviceApplicationId, $event.detail.serviceLabel)" + @open-edit-domain.window="openEditDomain($event.detail.index, $event.detail.url, $event.detail.serviceApplicationId, $event.detail.serviceLabel, $event.detail.direction, $event.detail.indexing)" @edit-domain-saved.window="closeEditDomain()"> @can('update', $service) @@ -94,7 +100,9 @@ @endif @can('update', $service) @if ($serviceAppCount > 0) - @include('livewire.project.shared.cloudflare-autoconfigure') +
+ @include('livewire.project.shared.cloudflare-autoconfigure') +
@@ -177,31 +185,12 @@ @php $app = collect($serviceApps)->firstWhere('id', (int) $appId); $heading = \Illuminate\Support\Str::headline($app['name'] ?? $rows->first()['service_name'] ?? 'Service'); - $redirect = $serviceRedirects[$appId] ?? 'both'; - $redirectLabel = match ($redirect) { - 'www' => 'Redirect to www', - 'non-www' => 'Redirect to non-www', - default => 'Allow both', - }; @endphp
-
+
{{ $heading }} - @can('update', $service) -
- -
- @else - {{ $redirectLabel }} - @endcan
@@ -210,7 +199,7 @@ 'domainRows' => $domainRows, 'service' => $service, 'showServiceColumn' => false, - 'showHeader' => false, + 'showHeader' => true, ])
@@ -279,6 +268,20 @@ @enderror +
+ + +
+ @if ($editDomainDnsFailed) This domain does not currently resolve to this server. diff --git a/resources/views/livewire/project/service/edit-domain.blade.php b/resources/views/livewire/project/service/edit-domain.blade.php index 981ac4fbc..52474c8d9 100644 --- a/resources/views/livewire/project/service/edit-domain.blade.php +++ b/resources/views/livewire/project/service/edit-domain.blade.php @@ -16,26 +16,6 @@ - @if (count($this->configuredDomains) > 0) -
-
-

Search Engine Indexing

- -
- @foreach ($this->configuredDomains as $domain) - - @endforeach -
- @endif -
    diff --git a/resources/views/livewire/project/service/partials/domain-table.blade.php b/resources/views/livewire/project/service/partials/domain-table.blade.php index 6f3236b7d..48bd1658e 100644 --- a/resources/views/livewire/project/service/partials/domain-table.blade.php +++ b/resources/views/livewire/project/service/partials/domain-table.blade.php @@ -131,9 +131,11 @@ @click="$dispatch('open-edit-domain', { index: {{ $index }}, url: @js($row['url']), - serviceApplicationId: {{ (int) ($row['service_application_id'] ?? 0) }}, - serviceLabel: @js($serviceLabel), - })" + serviceApplicationId: {{ (int) ($row['service_application_id'] ?? 0) }}, + serviceLabel: @js($serviceLabel), + direction: @js($serviceRedirects[$row['service_application_id']] ?? 'both'), + indexing: @js($service->applications->firstWhere('id', $row['service_application_id'])?->isDomainNoindexed($row['url']) ? 'noindex' : 'index'), + })" class="icon-button shrink-0" title="Edit domain" aria-label="Edit domain"> diff --git a/resources/views/livewire/project/shared/cloudflare-autoconfigure.blade.php b/resources/views/livewire/project/shared/cloudflare-autoconfigure.blade.php index 499ffc54e..43ea25439 100644 --- a/resources/views/livewire/project/shared/cloudflare-autoconfigure.blade.php +++ b/resources/views/livewire/project/shared/cloudflare-autoconfigure.blade.php @@ -8,9 +8,10 @@ x-bind:aria-expanded="dnsEntriesOpen" title="DNS entries for this server"> DNS entries - - - + + +