From 6c5adce633bd5cc53d1975c045f25d246aa4fccb Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sat, 11 Oct 2025 13:30:44 +0200 Subject: [PATCH] fix: improve cloud-init scripts UI styling and behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix multiple UI/UX issues with cloud-init scripts management: 1. Fix card styling - Remove purple box background, use simple border - Changed from .box class to inline flex/border styling - Matches cloud provider tokens styling pattern 2. Remove script preview section - Preview was taking too much space and looked cluttered - Users can edit to see full script content 3. Make edit modal full width - Added fullWidth attribute to x-modal-input component - Provides better editing experience for long scripts 4. Fix fields clearing after update - Fields were being reset even in edit mode - Now only reset fields when creating new script - Edit mode preserves values after save 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/Livewire/Security/CloudInitScriptForm.php | 6 +- .../security/cloud-init-scripts.blade.php | 57 ++++++++----------- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/app/Livewire/Security/CloudInitScriptForm.php b/app/Livewire/Security/CloudInitScriptForm.php index 5307e28b3..ff670cd4f 100644 --- a/app/Livewire/Security/CloudInitScriptForm.php +++ b/app/Livewire/Security/CloudInitScriptForm.php @@ -78,7 +78,11 @@ public function save() $message = 'Cloud-init script created successfully.'; } - $this->reset(['name', 'script', 'scriptId']); + // Only reset fields if creating (not editing) + if (! $this->scriptId) { + $this->reset(['name', 'script']); + } + $this->dispatch('scriptSaved'); $this->dispatch('success', $message); diff --git a/resources/views/livewire/security/cloud-init-scripts.blade.php b/resources/views/livewire/security/cloud-init-scripts.blade.php index 910b87b32..aa7324e4b 100644 --- a/resources/views/livewire/security/cloud-init-scripts.blade.php +++ b/resources/views/livewire/security/cloud-init-scripts.blade.php @@ -12,42 +12,35 @@
@forelse ($scripts as $script) -
-
-
-
-
{{ $script->name }}
-
- Created {{ $script->created_at->diffForHumans() }} -
+
+
+
+
{{ $script->name }}
+
+ Created {{ $script->created_at->diffForHumans() }}
+
-
-
Script Preview:
-
{{ Str::limit($script->script, 200) }}
-
+
+ @can('update', $script) + + + + @endcan -
- @can('update', $script) - - - - @endcan - - @can('delete', $script) - - @endcan -
+ @can('delete', $script) + + @endcan
@empty