fix: resource tab not loading if server is not reachable

This commit is contained in:
Andras Bacsai 2024-02-28 09:51:45 +01:00
parent e98170f921
commit c8332ca9bf
4 changed files with 18 additions and 12 deletions

View File

@ -263,6 +263,7 @@ public function startUnmanaged($id)
}
public function loadUnmanagedContainers()
{
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) {
@ -275,6 +276,7 @@ public function loadUnmanagedContainers()
$containers = $containers->filter();
return collect($containers);
}
}
public function hasDefinedResources()
{
$applications = $this->applications()->count() > 0;

View 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

View File

@ -0,0 +1 @@
<img class="inline-flex w-4 h-4" src="{{ asset('svgs/internal-link.svg') }}">

View File

@ -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>