feat(terminal): dispatch focus event for terminal after connection and enhance focus handling in JavaScript

This commit is contained in:
Andras Bacsai
2025-07-18 21:19:32 +02:00
parent fe900d3cd7
commit 43ff38d914
3 changed files with 29 additions and 1 deletions

View File

@@ -45,7 +45,8 @@
<livewire:server.navbar :server="$servers->first()" />
@if ($servers->first()->isTerminalEnabled() && $servers->first()->isFunctional())
<form class="w-full flex gap-2 items-start" wire:submit="$dispatchSelf('connectToServer')"
wire:init="$dispatchSelf('connectToServer')">
x-data="{ autoConnected: false }"
x-on:terminal-websocket-ready.window="if (!autoConnected) { autoConnected = true; $wire.dispatchSelf('connectToServer'); }">
<h2 class="pb-4">Terminal</h2>
<x-forms.button :disabled="$isConnecting"
type="submit">{{ $isConnecting ? 'Connecting...' : 'Connect' }}</x-forms.button>