diff --git a/app/Actions/Proxy/CheckProxy.php b/app/Actions/Proxy/CheckProxy.php index 41f961b59..5a1ae56cf 100644 --- a/app/Actions/Proxy/CheckProxy.php +++ b/app/Actions/Proxy/CheckProxy.php @@ -46,14 +46,14 @@ public function handle(Server $server, $fromUI = false) $port443 = is_resource($connection443) && fclose($connection443); if ($port80) { if ($fromUI) { - throw new \Exception("Port 80 is in use.
You must stop the process using this port.
Docs: https://coolify.io/docs
Discord: https://coollabs.io/discord"); + throw new \Exception("Port 80 is in use.
You must stop the process using this port.
Docs: https://coolify.io/docs
Discord: https://coollabs.io/discord"); } else { return false; } } if ($port443) { if ($fromUI) { - throw new \Exception("Port 443 is in use.
You must stop the process using this port.
Docs: https://coolify.io/docs
Discord: https://coollabs.io/discord"); + throw new \Exception("Port 443 is in use.
You must stop the process using this port.
Docs: https://coolify.io/docs
Discord: https://coollabs.io/discord"); } else { return false; } diff --git a/app/Livewire/Project/Shared/GetLogs.php b/app/Livewire/Project/Shared/GetLogs.php index 5a2053fc4..0d7510ef1 100644 --- a/app/Livewire/Project/Shared/GetLogs.php +++ b/app/Livewire/Project/Shared/GetLogs.php @@ -71,6 +71,9 @@ public function instantSave() } public function getLogs($refresh = false) { + if (!$this->server->isFunctional()) { + return; + } if ($this->resource?->getMorphClass() === 'App\Models\Application') { if (str($this->container)->contains('-pr-')) { $this->pull_request = "Pull Request: " . str($this->container)->afterLast('-pr-')->beforeLast('_')->value(); diff --git a/app/Livewire/Project/Shared/Logs.php b/app/Livewire/Project/Shared/Logs.php index 2958a31fd..d200ca69e 100644 --- a/app/Livewire/Project/Shared/Logs.php +++ b/app/Livewire/Project/Shared/Logs.php @@ -29,6 +29,9 @@ public function loadContainers($server_id) { try { $server = $this->servers->firstWhere('id', $server_id); + if (!$server->isFunctional()) { + return; + } if ($server->isSwarm()) { $containers = collect([ [ @@ -96,7 +99,6 @@ public function mount() $this->resource->databases()->get()->each(function ($database) { $this->containers->push(data_get($database, 'name') . '-' . data_get($this->resource, 'uuid')); }); - if ($this->resource->server->isFunctional()) { $this->servers = $this->servers->push($this->resource->server); } diff --git a/resources/views/livewire/project/shared/logs.blade.php b/resources/views/livewire/project/shared/logs.blade.php index a505361dd..d681d0617 100644 --- a/resources/views/livewire/project/shared/logs.blade.php +++ b/resources/views/livewire/project/shared/logs.blade.php @@ -7,16 +7,18 @@
Loading containers...
- @foreach ($servers as $server) + @forelse ($servers as $server)

@forelse (data_get($server,'containers',[]) as $container) - + @empty -
No containers are not running on server: {{$server->name}}
+
No containers are not running on server: {{ $server->name }}
@endforelse
- @endforeach + @empty +
No functional server found for the application.
+ @endforelse @elseif ($type === 'database')

Logs

@@ -26,7 +28,11 @@ @if ($loop->first)

Logs

@endif - + @if (data_get($servers, '0')) + + @else +
No functional server found for the database.
+ @endif @empty
No containers are not running.
@endforelse @@ -37,7 +43,11 @@ @if ($loop->first)

Logs

@endif - + @if (data_get($servers, '0')) + + @else +
No functional server found for the service.
+ @endif @empty
No containers are not running.
@endforelse