fix: no coolify.yaml found

This commit is contained in:
Andras Bacsai 2024-02-22 14:45:56 +01:00
parent 7233c86f3d
commit 836458ad85
3 changed files with 6 additions and 1 deletions

View File

@ -22,7 +22,9 @@ public function loadDynamicConfigurations()
$files = collect(explode("\n", $files))->filter(fn ($file) => !empty($file));
$files = $files->map(fn ($file) => trim($file));
$files = $files->sort();
$files = $files->filter(fn ($file) => $file !== 'coolify.yaml')->prepend('coolify.yaml');
if ($files->contains('coolify.yaml')) {
$files = $files->filter(fn ($file) => $file !== 'coolify.yaml')->prepend('coolify.yaml');
}
$contents = collect([]);
foreach ($files as $file) {
$without_extension = str_replace('.', '|', $file);

View File

@ -62,6 +62,7 @@ public function addDynamicConfiguration()
instant_remote_process(["echo '{$base64_value}' | base64 -d > {$file}"], $this->server);
$this->dispatch('loadDynamicConfigurations');
$this->dispatch('dynamic-configuration-added');
$this->dispatch('success', 'Success', 'Dynamic configuration saved.');
} catch (\Throwable $e) {
return handleError($e, $this);
}

View File

@ -44,6 +44,8 @@ class="font-normal text-white normal-case border-none rounded btn btn-primary bt
@endif
</div>
@endforeach
@else
<div wire:loading.remove> No dynamic configurations found.</div>
@endif
</div>