coolify/resources/views/livewire/project/service/edit-compose.blade.php

66 lines
3.2 KiB
PHP
Raw Normal View History

<div x-data="{
raw: true,
showNormalTextarea: false,
editorHeight: 400,
calculateEditorHeight() {
// Get viewport height
const viewportHeight = window.innerHeight;
// Modal max height is calc(100vh - 2rem) = viewport - 32px
const modalMaxHeight = viewportHeight - 32;
// Account for: modal header (~80px) + info text (~60px) + checkboxes (~80px) + buttons (~80px) + padding (~48px)
const fixedElementsHeight = 348;
// Calculate available height for editor
const availableHeight = modalMaxHeight - fixedElementsHeight;
// Set minimum height of 300px and maximum of available space
this.editorHeight = Math.max(300, Math.min(availableHeight, viewportHeight - 200));
}
}" x-init="calculateEditorHeight(); window.addEventListener('resize', () => calculateEditorHeight())">
2024-03-21 11:44:32 +00:00
<div class="pb-4">Volume names are updated upon save. The service UUID will be added as a prefix to all volumes, to
prevent
name collision. <br>To see the actual volume names, check the Deployable Compose file, or go to Storage
menu.</div>
2024-07-17 12:52:40 +00:00
<div class="compose-editor-container" x-bind:style="`--editor-height: ${editorHeight}px`">
<div x-cloak x-show="raw" class="font-mono">
<div x-cloak x-show="showNormalTextarea">
<x-forms.textarea x-bind:style="`height: ${editorHeight}px`" id="dockerComposeRaw">
</x-forms.textarea>
</div>
<div x-cloak x-show="!showNormalTextarea">
<x-forms.textarea allowTab useMonacoEditor monacoEditorLanguage="yaml" id="dockerComposeRaw">
</x-forms.textarea>
</div>
</div>
<div x-cloak x-show="raw === false" class="font-mono">
<x-forms.textarea x-bind:style="`height: ${editorHeight}px`" readonly id="dockerCompose">
</x-forms.textarea>
</div>
2024-03-21 11:44:32 +00:00
</div>
<div class="pt-2 flex gap-2">
<div class="flex flex-col gap-2">
<x-forms.checkbox label="Escape special characters in labels?"
helper="By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $$.<br><br>If you want to use env variables inside the labels, turn this off."
Complete Livewire legacy model binding migration (25+ components) This completes the migration from Livewire's legacy `id="model.property"` pattern to explicit properties with manual synchronization. This allows disabling the `legacy_model_binding` feature flag. **Components Migrated (Final Session - 9 components):** - Server/Proxy.php (1 field) - Service/EditDomain.php (1 field) - Fixed Collection/string bug & parent sync - Application/Previews.php (2 fields - array handling) - Service/EditCompose.php (4 fields) - Service/FileStorage.php (6 fields) - Service/Database.php (7 fields) - Service/ServiceApplicationView.php (10 fields) - Application/General.php (53 fields) - LARGEST migration - Application/PreviewsCompose.php (1 field) **Total Migration Summary:** - 25+ components migrated across all phases - 150+ explicit properties added - 0 legacy bindings remaining (verified via grep) - All wire:model, id, @entangle bindings updated - All updater hooks renamed (updatedApplicationX → updatedX) **Technical Changes:** - Added explicit public properties (camelCase) - Implemented syncData(bool $toModel) bidirectional sync - Updated validation rules (removed model. prefix) - Updated all action methods (mount, submit, instantSave) - Fixed updater hooks: updatedBuildPack, updatedBaseDirectory, updatedIsStatic - Updated Blade views (id & wire:model bindings) - Applied Collection/string confusion fixes - Added model refresh + re-sync pattern **Critical Fixes:** - EditDomain.php Collection/string confusion (use intermediate variables) - EditDomain.php parent component sync (refresh + re-sync after save) - General.php domain field empty (syncData at end of mount) - General.php wire:model bindings (application.* → property) - General.php updater hooks (wrong naming convention) **Files Modified:** 34 files - 17 PHP Livewire components - 17 Blade view templates - 1 MIGRATION_REPORT.md (documentation) **Ready to disable legacy_model_binding flag in config/livewire.php** 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 13:38:59 +00:00
id="isContainerLabelEscapeEnabled" instantSave></x-forms.checkbox>
<x-forms.checkbox label="Show Normal Textarea" x-model="showNormalTextarea"></x-forms.checkbox>
</div>
2024-07-17 12:52:40 +00:00
</div>
<div class="flex w-full gap-2 pt-4">
<div x-cloak x-show="raw">
<x-forms.button class="w-64" @click.prevent="raw = !raw">Show Deployable Compose</x-forms.button>
</div>
<div x-cloak x-show="raw === false">
<x-forms.button class="w-64" @click.prevent="raw = !raw">Show Source
Compose</x-forms.button>
2024-03-21 11:44:32 +00:00
</div>
<div class="flex-1"></div>
@if (blank($service->service_type))
<x-forms.button class="w-28" wire:click.prevent='validateCompose'>
Validate
</x-forms.button>
@endif
<x-forms.button class="w-28" wire:click.prevent='saveEditedCompose'>
2024-03-21 11:44:32 +00:00
Save
</x-forms.button>
</div>
</div>