chore: Add validation to prevent selecting 'default' server or container in RunCommand.php

This commit is contained in:
Andras Bacsai
2024-09-17 11:30:29 +02:00
parent 7b4559c5e6
commit 5818c9cf6b

View File

@@ -90,6 +90,12 @@ class RunCommand extends Component
#[On('connectToContainer')] #[On('connectToContainer')]
public function 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); $container = collect($this->containers)->firstWhere('uuid', $this->selected_uuid);
$this->dispatch('send-terminal-command', $this->dispatch('send-terminal-command',