diff --git a/app/Livewire/Project/Service/FileStorage.php b/app/Livewire/Project/Service/FileStorage.php index 87acbda781..7c6a2917ba 100644 --- a/app/Livewire/Project/Service/FileStorage.php +++ b/app/Livewire/Project/Service/FileStorage.php @@ -372,6 +372,7 @@ class FileStorage extends Component return 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.php index 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 @@ } @endif const 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.php index 7d2f4994bb..a8abfcb4af 100644 --- a/resources/views/components/forms/textarea.blade.php +++ b/resources/views/components/forms/textarea.blade.php @@ -31,7 +31,7 @@
0) style="--editor-height: {{ $monacoRows * 23 + 38 }}px" @endif> + readonly="{{ $readonly || $disabled }}" label="dockerfile" autofocus="{{ $autofocus }}" />
@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.php index 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 @@ @else @if (data_get($resource, 'settings.is_preserve_repository_enabled')) @@ -141,7 +141,7 @@ + rows="20" id="content" :useMonacoEditor="$isYamlFile" monacoEditorLanguage="yaml" disabled> @else 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.php index 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 @@
- Save