From 504524ea567b042992e23291a73a9da2857e2320 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 16 Apr 2024 10:54:28 +0200 Subject: [PATCH] Refactor stop button in heading.blade.php to use modal confirmation component --- app/Livewire/Project/Resource/Create.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Livewire/Project/Resource/Create.php b/app/Livewire/Project/Resource/Create.php index 01ee3efd8..3705d6f93 100644 --- a/app/Livewire/Project/Resource/Create.php +++ b/app/Livewire/Project/Resource/Create.php @@ -40,7 +40,7 @@ class Create extends Component $database = create_standalone_keydb($environment->id, $destination_uuid); } else if ($type->value() === 'dragonfly') { $database = create_standalone_dragonfly($environment->id, $destination_uuid); - }else if ($type->value() === 'clickhouse') { + } else if ($type->value() === 'clickhouse') { $database = create_standalone_clickhouse($environment->id, $destination_uuid); } return redirect()->route('project.database.configuration', [ @@ -60,7 +60,7 @@ class Create extends Component } if ($oneClickService) { $destination = StandaloneDocker::whereUuid($destination_uuid)->first(); - $service = Service::create([ + $service_payload = [ 'name' => "$oneClickServiceName-" . str()->random(10), 'docker_compose_raw' => base64_decode($oneClickService), 'environment_id' => $environment->id, @@ -68,7 +68,11 @@ class Create extends Component 'server_id' => (int) $server_id, 'destination_id' => $destination->id, 'destination_type' => $destination->getMorphClass(), - ]); + ]; + if ($oneClickServiceName === 'cloudflared') { + data_set($service_payload, 'connect_to_docker_network', true); + } + $service = Service::create($service_payload); $service->name = "$oneClickServiceName-" . $service->uuid; $service->save(); if ($oneClickDotEnvs?->count() > 0) {