refactor(ui): simplify container selection form in execute-container-command view

This commit is contained in:
Andras Bacsai
2025-06-20 09:35:39 +02:00
parent 04aec48495
commit 7d985e3915

View File

@@ -20,23 +20,21 @@
@if (count($containers) === 0) @if (count($containers) === 0)
<div>No containers are running or terminal access is disabled on this server.</div> <div>No containers are running or terminal access is disabled on this server.</div>
@else @else
@foreach ($containers as $container) <form class="w-full flex gap-2 items-end" wire:submit="$dispatchSelf('connectToContainer')">
<form class="w-full flex gap-2 items-end" wire:submit="$dispatchSelf('connectToContainer')"> <x-forms.select label="Container" id="container" required wire:model="selected_container">
<x-forms.select label="Container" id="container" required wire:model="selected_container"> @foreach ($containers as $container)
@foreach ($containers as $container) @if ($loop->first)
@if ($loop->first) <option disabled value="default">Select a container</option>
<option disabled value="default">Select a container</option> @endif
@endif <option value="{{ data_get($container, 'container.Names') }}">
<option value="{{ data_get($container, 'container.Names') }}"> {{ data_get($container, 'container.Names') }}
{{ data_get($container, 'container.Names') }} ({{ data_get($container, 'server.name') }})
({{ data_get($container, 'server.name') }}) </option>
</option> @endforeach
@endforeach </x-forms.select>
</x-forms.select> <x-forms.button :disabled="$isConnecting"
<x-forms.button :disabled="$isConnecting" type="submit">{{ $isConnecting ? 'Connecting...' : 'Connect' }}</x-forms.button>
type="submit">{{ $isConnecting ? 'Connecting...' : 'Connect' }}</x-forms.button> </form>
</form>
@endforeach
<div class="mx-auto w-full"> <div class="mx-auto w-full">
<livewire:project.shared.terminal /> <livewire:project.shared.terminal />
</div> </div>