fix: resource tab not loading if server is not reachable
This commit is contained in:
		@@ -263,17 +263,19 @@ class Server extends BaseModel
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    public function loadUnmanagedContainers()
 | 
					    public function loadUnmanagedContainers()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        $containers = instant_remote_process(["docker ps -a  --format '{{json .}}' "], $this);
 | 
					        if ($this->isFunctional()) {
 | 
				
			||||||
        $containers = format_docker_command_output_to_json($containers);
 | 
					            $containers = instant_remote_process(["docker ps -a  --format '{{json .}}' "], $this);
 | 
				
			||||||
        $containers = $containers->map(function ($container) {
 | 
					            $containers = format_docker_command_output_to_json($containers);
 | 
				
			||||||
            $labels = data_get($container, 'Labels');
 | 
					            $containers = $containers->map(function ($container) {
 | 
				
			||||||
            if (!str($labels)->contains("coolify.managed")) {
 | 
					                $labels = data_get($container, 'Labels');
 | 
				
			||||||
                return $container;
 | 
					                if (!str($labels)->contains("coolify.managed")) {
 | 
				
			||||||
            }
 | 
					                    return $container;
 | 
				
			||||||
            return null;
 | 
					                }
 | 
				
			||||||
        });
 | 
					                return null;
 | 
				
			||||||
        $containers = $containers->filter();
 | 
					            });
 | 
				
			||||||
        return collect($containers);
 | 
					            $containers = $containers->filter();
 | 
				
			||||||
 | 
					            return collect($containers);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    public function hasDefinedResources()
 | 
					    public function hasDefinedResources()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								public/svgs/internal-link.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								public/svgs/internal-link.svg
									
									
									
									
									
										Normal file
									
								
							@@ -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>
 | 
				
			||||||
| 
		 After Width: | Height: | Size: 203 B  | 
							
								
								
									
										1
									
								
								resources/views/components/internal-link.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								resources/views/components/internal-link.blade.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
				
			|||||||
 | 
					<img class="inline-flex w-4 h-4" src="{{ asset('svgs/internal-link.svg') }}">
 | 
				
			||||||
@@ -45,7 +45,7 @@
 | 
				
			|||||||
                                                        {{ data_get($resource, 'environment.name') }}
 | 
					                                                        {{ data_get($resource, 'environment.name') }}
 | 
				
			||||||
                                                    </td>
 | 
					                                                    </td>
 | 
				
			||||||
                                                    <td class="px-5 py-4 text-sm whitespace-nowrap"><a class=""
 | 
					                                                    <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>
 | 
				
			||||||
                                                    <td class="px-5 py-4 text-sm whitespace-nowrap">
 | 
					                                                    <td class="px-5 py-4 text-sm whitespace-nowrap">
 | 
				
			||||||
                                                        {{ str($resource->type())->headline() }}</td>
 | 
					                                                        {{ str($resource->type())->headline() }}</td>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user