An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: terminal view loading in async
Andras Bacsaib58cc05b8aea
diff --git a/app/Livewire/Terminal/Index.php b/app/Livewire/Terminal/Index.phpindex 945b25714e..a24a237c58 100644--- a/app/Livewire/Terminal/Index.php+++ b/app/Livewire/Terminal/Index.php@@ -14,13 +14,25 @@ class Index extends Componentpublic $containers = [];+ public bool $isLoadingContainers = true;+public function mount(){if (! auth()->user()->isAdmin()) {abort(403);}$this->servers = Server::isReachable()->get();- $this->containers = $this->getAllActiveContainers();+ }++ public function loadContainers()+ {+ try {+ $this->containers = $this->getAllActiveContainers();+ } catch (\Exception $e) {+ return handleError($e, $this);+ } finally {+ $this->isLoadingContainers = false;+ }}private function getAllActiveContainers()diff --git a/resources/views/livewire/terminal/index.blade.php b/resources/views/livewire/terminal/index.blade.phpindex 3572950022..0471a44a40 100644--- a/resources/views/livewire/terminal/index.blade.php+++ b/resources/views/livewire/terminal/index.blade.php@@ -8,27 +8,32 @@<x-helperhelper="If you're having trouble connecting to your server, make sure that the port is open.<br><br><a class='underline' href='https://coolify.io/docs/knowledge-base/server/firewall/#terminal' target='_blank'>Documentation</a>"></x-helper></div>- <div>- <form class="flex flex-col gap-2 justify-center xl:items-end xl:flex-row"- wire:submit="$dispatchSelf('connectToContainer')">- <x-forms.select id="server" required wire:model.live="selected_uuid">- @foreach ($servers as $server)- @if ($loop->first)- <option disabled value="default">Select a server or container</option>- @endif- <option value="{{ $server->uuid }}">{{ $server->name }}</option>- @foreach ($containers as $container)- @if ($container['server_uuid'] == $server->uuid)- <option value="{{ $container['uuid'] }}">- {{ $server->name }} -> {{ $container['name'] }}- </option>+ <div x-init="$wire.loadContainers()">+ @if ($isLoadingContainers)+ <div class="pt-1">+ <x-loading text="Loading servers and containers..." />+ </div>+ @else+ <form class="flex flex-col gap-2 justify-center xl:items-end xl:flex-row"+ wire:submit="$dispatchSelf('connectToContainer')">+ <x-forms.select id="server" required wire:model.live="selected_uuid">+ @foreach ($servers as $server)+ @if ($loop->first)+ <option disabled value="default">Select a server or container</option>@endif+ <option value="{{ $server->uuid }}">{{ $server->name }}</option>+ @foreach ($containers as $container)+ @if ($container['server_uuid'] == $server->uuid)+ <option value="{{ $container['uuid'] }}">+ {{ $server->name }} -> {{ $container['name'] }}+ </option>+ @endif+ @endforeach@endforeach- @endforeach- </x-forms.select>- <x-forms.button type="submit">Connect</x-forms.button>- </form>- <livewire:project.shared.terminal />+ </x-forms.select>+ <x-forms.button type="submit">Connect</x-forms.button>+ </form>+ <livewire:project.shared.terminal />+ @endif</div>-</div>