An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
feat(ui): add yaml syntax highlighting to dynamic proxy configs and file mounts
Andras Bacsai12b35957ebbe
diff --git a/app/Livewire/Project/Service/FileStorage.php b/app/Livewire/Project/Service/FileStorage.phpindex 87acbda781..7c6a2917ba 100644--- a/app/Livewire/Project/Service/FileStorage.php+++ b/app/Livewire/Project/Service/FileStorage.php@@ -372,6 +372,7 @@ class FileStorage extends Componentreturn view('livewire.project.service.file-storage', ['deletionCheckboxes' => $deletionCheckboxes,'deletionActions' => $deletionActions,+ 'isYamlFile' => str($this->fileStorage->fs_path)->lower()->endsWith(['.yml', '.yaml']),]);}}diff --git a/resources/views/components/forms/monaco-editor.blade.php b/resources/views/components/forms/monaco-editor.blade.phpindex 69466f7daa..00310c83c0 100644--- a/resources/views/components/forms/monaco-editor.blade.php+++ b/resources/views/components/forms/monaco-editor.blade.php@@ -87,7 +87,7 @@}@endifconst editor = monaco.editor.create($refs.monacoEditorElement, {- value: monacoContent,+ value: monacoContent ?? '',theme: document.documentElement.classList.contains('dark') ? 'coolify-dark' : 'vs',wordWrap: 'on',readOnly: '{{ $readonly ?? false }}',@@ -138,8 +138,8 @@@endif$watch('monacoContent', value => {- if (editor.getValue() !== value) {- editor.setValue(value);+ if (editor.getValue() !== (value ?? '')) {+ editor.setValue(value ?? '');}});diff --git a/resources/views/components/forms/textarea.blade.php b/resources/views/components/forms/textarea.blade.phpindex 7d2f4994bb..a8abfcb4af 100644--- a/resources/views/components/forms/textarea.blade.php+++ b/resources/views/components/forms/textarea.blade.php@@ -31,7 +31,7 @@<div class="w-full" @if ($monacoRows > 0) style="--editor-height: {{ $monacoRows * 23 + 38 }}px" @endif><x-forms.monaco-editor id="{{ $modelBinding }}" language="{{ $monacoEditorLanguage }}" name="{{ $name }}"name="{{ $modelBinding }}" model="{{ $value ?? $modelBinding }}" wire:model="{{ $value ?? $modelBinding }}"- readonly="{{ $readonly }}" label="dockerfile" autofocus="{{ $autofocus }}" />+ readonly="{{ $readonly || $disabled }}" label="dockerfile" autofocus="{{ $autofocus }}" /></div>@else@if ($type === 'password')diff --git a/resources/views/livewire/project/service/file-storage.blade.php b/resources/views/livewire/project/service/file-storage.blade.phpindex 6500b0ce28..c3be252697 100644--- a/resources/views/livewire/project/service/file-storage.blade.php+++ b/resources/views/livewire/project/service/file-storage.blade.php@@ -108,7 +108,7 @@<x-forms.textarealabel="{{ $fileStorage->is_based_on_git ? 'Content (refreshed after a successful deployment)' : 'Content' }}"helper="The content shown may be outdated. Click 'Load from server' to fetch the latest version."- rows="20" id="content"+ rows="20" id="content" :useMonacoEditor="$isYamlFile" monacoEditorLanguage="yaml"readonly="{{ $fileStorage->is_based_on_git || $fileStorage->is_binary || $fileStorage->is_too_large }}"></x-forms.textarea>@else@if (data_get($resource, 'settings.is_preserve_repository_enabled'))@@ -141,7 +141,7 @@<x-forms.textarealabel="{{ $fileStorage->is_based_on_git ? 'Content (refreshed after a successful deployment)' : 'Content' }}"helper="The content shown may be outdated. Click 'Load from server' to fetch the latest version."- rows="20" id="content" disabled></x-forms.textarea>+ rows="20" id="content" :useMonacoEditor="$isYamlFile" monacoEditorLanguage="yaml" disabled></x-forms.textarea>@else<x-callout type="info" title="Hidden (only admins can view)">The file content can contain secrets.diff --git a/resources/views/livewire/server/proxy/new-dynamic-configuration.blade.php b/resources/views/livewire/server/proxy/new-dynamic-configuration.blade.phpindex 7f203f6892..40b727ea36 100644--- a/resources/views/livewire/server/proxy/new-dynamic-configuration.blade.php+++ b/resources/views/livewire/server/proxy/new-dynamic-configuration.blade.php@@ -1,6 +1,7 @@<form wire:submit.prevent="addDynamicConfiguration" class="flex flex-col w-full gap-4"><x-forms.input canGate="update" :canResource="$server" id="fileName" label="Filename" required />- <x-forms.textarea canGate="update" :canResource="$server" allowTab useMonacoEditor id="value" label="Configuration"+ <x-forms.textarea canGate="update" :canResource="$server" allowTab useMonacoEditor+ monacoEditorLanguage="{{ $server->proxyType() === \App\Enums\ProxyTypes::TRAEFIK->value ? 'yaml' : '' }}" id="value" label="Configuration"required rows="20" /><x-forms.button canGate="update" :canResource="$server" type="submit" @click="slideOverOpen=false">Save</x-forms.button></form>