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: resource tab not loading if server is not reachable
Andras Bacsaic8332ca9bf8e
diff --git a/app/Models/Server.php b/app/Models/Server.phpindex 73e10a587b..d43256c8d3 100644--- a/app/Models/Server.php+++ b/app/Models/Server.php@@ -263,17 +263,19 @@ class Server extends BaseModel}public function loadUnmanagedContainers(){- $containers = instant_remote_process(["docker ps -a --format '{{json .}}' "], $this);- $containers = format_docker_command_output_to_json($containers);- $containers = $containers->map(function ($container) {- $labels = data_get($container, 'Labels');- if (!str($labels)->contains("coolify.managed")) {- return $container;- }- return null;- });- $containers = $containers->filter();- return collect($containers);+ if ($this->isFunctional()) {+ $containers = instant_remote_process(["docker ps -a --format '{{json .}}' "], $this);+ $containers = format_docker_command_output_to_json($containers);+ $containers = $containers->map(function ($container) {+ $labels = data_get($container, 'Labels');+ if (!str($labels)->contains("coolify.managed")) {+ return $container;+ }+ return null;+ });+ $containers = $containers->filter();+ return collect($containers);+ }}public function hasDefinedResources(){diff --git a/public/svgs/internal-link.svg b/public/svgs/internal-link.svgnew file mode 100644index 0000000000..a85b16d477--- /dev/null+++ b/public/svgs/internal-link.svg@@ -0,0 +1,3 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">+ <path fill="white" stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14m-6 6l6-6m-6-6l6 6"/>+</svg>diff --git a/resources/views/components/internal-link.blade.php b/resources/views/components/internal-link.blade.phpnew file mode 100644index 0000000000..19fe52635e--- /dev/null+++ b/resources/views/components/internal-link.blade.php@@ -0,0 +1 @@+<img class="inline-flex w-4 h-4" src="{{ asset('svgs/internal-link.svg') }}">diff --git a/resources/views/livewire/server/resources.blade.php b/resources/views/livewire/server/resources.blade.phpindex 2f43960f12..9c943eb656 100644--- a/resources/views/livewire/server/resources.blade.php+++ b/resources/views/livewire/server/resources.blade.php@@ -45,7 +45,7 @@{{ data_get($resource, 'environment.name') }}</td><td class="px-5 py-4 text-sm whitespace-nowrap"><a class=""- href="{{ $resource->link() }}">{{ $resource->name }} </a>+ href="{{ $resource->link() }}">{{ $resource->name }} <x-internal-link/></a></td><td class="px-5 py-4 text-sm whitespace-nowrap">{{ str($resource->type())->headline() }}</td>