From 5394223f6bb658784b3b6143c41030fa1945d9d9 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 22 Aug 2024 16:50:29 +0200 Subject: [PATCH] fix:new parser only in dev --- app/Models/Application.php | 7 ++++--- bootstrap/helpers/shared.php | 13 +++++++++++++ .../livewire/project/application/general.blade.php | 8 +++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/Models/Application.php b/app/Models/Application.php index e328607d8..db76d07ec 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -1106,10 +1106,11 @@ public function parseCompose(int $pull_request_id = 0, ?int $preview_id = null) if (! $this->docker_compose_raw) { return collect([]); } + if (isDev()) { + $compose = dockerComposeParserForApplications($this); - // $compose = dockerComposeParserForApplications($this); - - // return $compose; + return $compose; + } $isNew = false; $isSameDockerComposeFile = false; diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index 427d3f14d..3d5346d47 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -1167,10 +1167,23 @@ function dockerComposeParserForApplications(Application $application): Collectio ]); } } + + // ray($environment); $environment = $application->environment_variables()->where('application_id', $application->id)->get()->mapWithKeys(function ($item) { return [$item['key'] => $item['value']]; }); + // if ($environment?->count() > 0) { + // $environment = $environment->map(function ($value, $key) use ($application) { + // $found = $application->environment_variables()->where('key', $key)->where('application_id', $application->id)->first(); + // if ($found) { + // $value = $found->value; + // } + + // return $value; + // }); + // } + // Labels $fqdns = collect([]); if ($application?->serviceType()) { diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php index 4d242fc6b..36bf5b461 100644 --- a/resources/views/livewire/project/application/general.blade.php +++ b/resources/views/livewire/project/application/general.blade.php @@ -254,9 +254,11 @@ class="underline" href="https://coolify.io/docs/knowledge-base/docker/registry" helper="You need to modify the docker compose file." monacoEditorLanguage="yaml" useMonacoEditor /> @else - {{-- --}} + @if (isDev()) + + @endif