diff --git a/app/Livewire/Project/Resource/Create.php b/app/Livewire/Project/Resource/Create.php index a0951330bd..fba079cf9b 100644 --- a/app/Livewire/Project/Resource/Create.php +++ b/app/Livewire/Project/Resource/Create.php @@ -177,6 +177,27 @@ class Create extends Component public function render() { - return view('livewire.project.resource.create'); + return view('livewire.project.resource.create', $this->pendingResource()); + } + + /** + * @return array{pendingName: ?string, pendingLogo: ?string} + */ + private function pendingResource(): array + { + if (! $this->pendingType) { + return ['pendingName' => null, 'pendingLogo' => null]; + } + $type = str($this->pendingType); + if (in_array($type->value(), DATABASE_TYPES, true)) { + return ['pendingName' => $type->headline()->value(), 'pendingLogo' => null]; + } + $services = get_service_templates(); + $key = resolve_service_template_key($type->after('one-click-service-')->value(), $services); + + return [ + 'pendingName' => str($key)->headline()->value(), + 'pendingLogo' => service_logo_urls(data_get($services, "$key.logo"))['logo'], + ]; } } diff --git a/resources/views/livewire/project/resource/create.blade.php b/resources/views/livewire/project/resource/create.blade.php index 035968fd4c..909313fe05 100644 --- a/resources/views/livewire/project/resource/create.blade.php +++ b/resources/views/livewire/project/resource/create.blade.php @@ -3,7 +3,16 @@ {{ data_get_str($project, 'name')->limit(10) }} > New | Coolify @if ($pendingType) -
Setting up the resource. You will be redirected when it is ready.
+