From 5818c9cf6bfe9f2a10c03e6d22eee9fd442a1d8b Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 17 Sep 2024 11:30:29 +0200 Subject: [PATCH] chore: Add validation to prevent selecting 'default' server or container in RunCommand.php --- app/Livewire/RunCommand.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Livewire/RunCommand.php b/app/Livewire/RunCommand.php index 290618bef..4eae773e1 100644 --- a/app/Livewire/RunCommand.php +++ b/app/Livewire/RunCommand.php @@ -90,6 +90,12 @@ class RunCommand extends Component #[On('connectToContainer')] public function connectToContainer() { + if ($this->selected_uuid === 'default') { + $this->dispatch('error', 'Please select a server or a container.'); + + return; + } + $container = collect($this->containers)->firstWhere('uuid', $this->selected_uuid); $this->dispatch('send-terminal-command',