diff --git a/app/Actions/Application/StopApplication.php b/app/Actions/Application/StopApplication.php index 81148e3d8..66ceb95f6 100644 --- a/app/Actions/Application/StopApplication.php +++ b/app/Actions/Application/StopApplication.php @@ -28,7 +28,7 @@ class StopApplication if ($server->isSwarm()) { instant_remote_process(["docker stack rm {$application->uuid}"], $server); - return; + continue; } $containers = $previewDeployments @@ -57,17 +57,15 @@ class StopApplication } } + $status = ['status' => 'exited']; if ($resetRestartCount) { - $application->update([ + $status = array_merge($status, [ 'restart_count' => 0, 'last_restart_at' => null, 'last_restart_type' => null, ]); - } else { - $application->update([ - 'status' => 'exited', - ]); } + $application->update($status); ServiceStatusChanged::dispatch($application->environment->project->team->id); } diff --git a/app/Actions/Database/StopDatabase.php b/app/Actions/Database/StopDatabase.php index 5bbef7d7d..a3a7f16ef 100644 --- a/app/Actions/Database/StopDatabase.php +++ b/app/Actions/Database/StopDatabase.php @@ -30,6 +30,7 @@ class StopDatabase // Reset restart tracking when database is manually stopped $database->update([ + 'status' => 'exited', 'restart_count' => 0, 'last_restart_at' => null, 'last_restart_type' => null, diff --git a/app/Actions/Service/StopService.php b/app/Actions/Service/StopService.php index 9817bf32d..5e34c8e6a 100644 --- a/app/Actions/Service/StopService.php +++ b/app/Actions/Service/StopService.php @@ -49,6 +49,9 @@ class StopService $this->stopContainersInParallel($containersToStop, $server); } + $applications->each->update(['status' => 'exited']); + $dbs->each->update(['status' => 'exited']); + if ($deleteConnectedNetworks) { $service->deleteConnectedNetworks(); } diff --git a/app/Actions/Service/StopServiceApplication.php b/app/Actions/Service/StopServiceApplication.php index 724e1a254..184dcb491 100644 --- a/app/Actions/Service/StopServiceApplication.php +++ b/app/Actions/Service/StopServiceApplication.php @@ -2,6 +2,7 @@ namespace App\Actions\Service; +use App\Events\ServiceStatusChanged; use App\Models\ServiceApplication; use App\Models\ServiceDatabase; use Lorisleiva\Actions\Concerns\AsAction; @@ -21,5 +22,8 @@ class StopServiceApplication instant_remote_process([ "docker stop {$containerName}", ], $server); + + $serviceApplication->update(['status' => 'exited']); + ServiceStatusChanged::dispatch($service->environment->project->team->id); } } diff --git a/app/Livewire/Project/Application/Previews.php b/app/Livewire/Project/Application/Previews.php index e70636628..e07a985b4 100644 --- a/app/Livewire/Project/Application/Previews.php +++ b/app/Livewire/Project/Application/Previews.php @@ -3,6 +3,7 @@ namespace App\Livewire\Project\Application; use App\Actions\Docker\GetContainersStatus; +use App\Events\ServiceStatusChanged; use App\Jobs\DeleteResourceJob; use App\Models\Application; use App\Models\ApplicationPreview; @@ -373,6 +374,11 @@ class Previews extends Component $this->stopContainers($containers, $server); } + ApplicationPreview::where('application_id', $this->application->id) + ->where('pull_request_id', $pull_request_id) + ->update(['status' => 'exited']); + ServiceStatusChanged::dispatch($this->application->environment->project->team->id); + GetContainersStatus::run($server); $this->application->refresh(); $this->dispatch('containerStatusUpdated'); diff --git a/app/Livewire/Storage/Create.php b/app/Livewire/Storage/Create.php index 49da0ef68..d741e6918 100644 --- a/app/Livewire/Storage/Create.php +++ b/app/Livewire/Storage/Create.php @@ -26,7 +26,7 @@ class Create extends Component public string $bucket; - public string $endpoint; + public string $endpoint = ''; public S3Storage $storage; diff --git a/resources/views/components/forms/domain-input.blade.php b/resources/views/components/forms/domain-input.blade.php index 030fc0f5f..e7fc1c063 100644 --- a/resources/views/components/forms/domain-input.blade.php +++ b/resources/views/components/forms/domain-input.blade.php @@ -3,6 +3,8 @@ 'wire' => true, 'value' => '', 'errorId' => null, + 'hostLabel' => 'Domain', + 'hostPlaceholder' => 'app.example.com', ])
{{ $message }}
+ @php + preg_match('/(https?:\/\/\S+)$/', $message, $validationLinkMatches); + $validationLink = $validationLinkMatches[1] ?? null; + @endphp ++ @if ($validationLink) + {{ str($message)->beforeLast($validationLink)->trim() }} + Set them here. + @else + {{ $message }} + @endif +
@enderror