chore: Refactor terminal component and select form layout
This commit is contained in:
@@ -11,6 +11,7 @@ class Terminal extends Component
|
||||
#[On('send-terminal-command')]
|
||||
public function sendTerminalCommand($isContainer, $identifier, $serverUuid)
|
||||
{
|
||||
|
||||
$server = Server::ownedByCurrentTeam()->whereUuid($serverUuid)->firstOrFail();
|
||||
|
||||
// if (auth()->user()) {
|
||||
@@ -21,9 +22,7 @@ class Terminal extends Component
|
||||
// }
|
||||
|
||||
if ($isContainer) {
|
||||
ray($identifier);
|
||||
$status = getContainerStatus($server, $identifier);
|
||||
ray($status);
|
||||
if ($status !== 'running') {
|
||||
return handleError(new \Exception('Container is not running'), $this);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ use Livewire\Component;
|
||||
|
||||
class RunCommand extends Component
|
||||
{
|
||||
public $selected_uuid;
|
||||
public $selected_uuid = 'default';
|
||||
|
||||
public $servers = [];
|
||||
|
||||
@@ -16,7 +16,6 @@ class RunCommand extends Component
|
||||
public function mount($servers)
|
||||
{
|
||||
$this->servers = $servers;
|
||||
$this->selected_uuid = $servers[0]->uuid;
|
||||
$this->containers = $this->getAllActiveContainers();
|
||||
}
|
||||
|
||||
@@ -83,6 +82,11 @@ class RunCommand extends Component
|
||||
});
|
||||
}
|
||||
|
||||
public function updatedSelectedUuid($value)
|
||||
{
|
||||
$this->connectToContainer();
|
||||
}
|
||||
|
||||
#[On('connectToContainer')]
|
||||
public function connectToContainer()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user