2024-02-16 20:56:38 +00:00
|
|
|
<div>
|
2024-06-07 09:01:10 +00:00
|
|
|
<x-slot:title>
|
|
|
|
{{ data_get_str($server, 'name')->limit(10) }} > Server Resources | Coolify
|
|
|
|
</x-slot>
|
2024-02-16 20:56:38 +00:00
|
|
|
<x-server.navbar :server="$server" :parameters="$parameters" />
|
2024-05-08 18:59:58 +00:00
|
|
|
<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'managed' }" class="flex flex-col h-full gap-8 md:flex-row">
|
|
|
|
<div class="flex flex-row gap-4 md:flex-col">
|
2024-03-31 16:38:26 +00:00
|
|
|
<a :class="activeTab === 'managed' && 'dark:text-white'"
|
|
|
|
@click.prevent="activeTab = 'managed'; window.location.hash = 'managed'" href="#">Managed</a>
|
|
|
|
<a :class="activeTab === 'unmanaged' && 'dark:text-white'"
|
|
|
|
@click.prevent="activeTab = 'unmanaged'; window.location.hash = 'unmanaged'" href="#">Unmanaged</a>
|
|
|
|
</div>
|
2024-05-05 15:23:25 +00:00
|
|
|
<div class="w-full">
|
2024-03-31 16:38:26 +00:00
|
|
|
<div x-cloak x-show="activeTab === 'managed'" class="h-full">
|
|
|
|
<div class="flex flex-col">
|
|
|
|
<div class="flex gap-2">
|
|
|
|
<h2>Resources</h2>
|
|
|
|
<x-forms.button wire:click="refreshStatus">Refresh</x-forms.button>
|
2024-03-20 11:54:06 +00:00
|
|
|
</div>
|
2024-03-31 16:38:26 +00:00
|
|
|
<div class="subtitle">Here you can find all resources that are managed by Coolify.</div>
|
|
|
|
</div>
|
|
|
|
@if ($server->definedResources()->count() > 0)
|
|
|
|
<div class="flex flex-col">
|
2024-03-20 11:54:06 +00:00
|
|
|
<div class="flex flex-col">
|
2024-03-31 16:38:26 +00:00
|
|
|
<div class="overflow-x-auto">
|
|
|
|
<div class="inline-block min-w-full">
|
|
|
|
<div class="overflow-hidden">
|
|
|
|
<table class="min-w-full">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">
|
|
|
|
Project
|
|
|
|
</th>
|
|
|
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">
|
|
|
|
Environment</th>
|
|
|
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">
|
|
|
|
Name
|
|
|
|
</th>
|
|
|
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">
|
|
|
|
Type
|
|
|
|
</th>
|
|
|
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">
|
|
|
|
Status
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@forelse ($server->definedResources()->sortBy('name',SORT_NATURAL) as $resource)
|
2024-03-21 11:44:32 +00:00
|
|
|
<tr>
|
2024-03-31 16:38:26 +00:00
|
|
|
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
|
|
|
{{ data_get($resource->project(), 'name') }}
|
|
|
|
</td>
|
|
|
|
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
|
|
|
{{ data_get($resource, 'environment.name') }}
|
|
|
|
</td>
|
|
|
|
<td class="px-5 py-4 text-sm whitespace-nowrap hover:underline">
|
|
|
|
<a class=""
|
|
|
|
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>
|
|
|
|
<td class="px-5 py-4 text-sm font-medium whitespace-nowrap">
|
|
|
|
@if ($resource->type() === 'service')
|
|
|
|
<x-status.services :service="$resource"
|
|
|
|
:showRefreshButton="false" />
|
|
|
|
@else
|
|
|
|
<x-status.index :resource="$resource" :showRefreshButton="false" />
|
|
|
|
@endif
|
|
|
|
</td>
|
2024-03-20 11:54:06 +00:00
|
|
|
</tr>
|
2024-03-31 16:38:26 +00:00
|
|
|
@empty
|
|
|
|
@endforelse
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2024-03-20 11:54:06 +00:00
|
|
|
</div>
|
2024-02-16 22:09:35 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-03-31 16:38:26 +00:00
|
|
|
@else
|
|
|
|
<div>No resources found.</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
<div x-cloak x-show="activeTab === 'unmanaged'" class="h-full">
|
|
|
|
<div class="flex flex-col" x-init="$wire.loadUnmanagedContainers()">
|
|
|
|
<div class="flex gap-2">
|
|
|
|
<h2>Resources</h2>
|
|
|
|
<x-forms.button wire:click="refreshStatus">Refresh</x-forms.button>
|
|
|
|
</div>
|
|
|
|
<div class="subtitle">Here you can find all other containers running on the server.</div>
|
|
|
|
</div>
|
|
|
|
@if ($unmanagedContainers->count() > 0)
|
|
|
|
<div class="flex flex-col">
|
2024-02-16 22:09:35 +00:00
|
|
|
<div class="flex flex-col">
|
2024-03-31 16:38:26 +00:00
|
|
|
<div class="overflow-x-auto">
|
|
|
|
<div class="inline-block min-w-full">
|
|
|
|
<div class="overflow-hidden">
|
|
|
|
<table class="min-w-full">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">
|
|
|
|
Name
|
|
|
|
</th>
|
|
|
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">
|
|
|
|
Image
|
|
|
|
</th>
|
|
|
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">
|
|
|
|
Status
|
|
|
|
</th>
|
|
|
|
<th class="px-5 py-3 text-xs font-medium text-left uppercase">
|
|
|
|
Action
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@forelse ($unmanagedContainers->sortBy('name',SORT_NATURAL) as $resource)
|
2024-03-21 11:44:32 +00:00
|
|
|
<tr>
|
2024-03-31 16:38:26 +00:00
|
|
|
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
|
|
|
{{ data_get($resource, 'Names') }}
|
|
|
|
</td>
|
|
|
|
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
|
|
|
{{ data_get($resource, 'Image') }}
|
|
|
|
</td>
|
|
|
|
<td class="px-5 py-4 text-sm whitespace-nowrap">
|
|
|
|
{{ data_get($resource, 'State') }}
|
|
|
|
</td>
|
|
|
|
<td class="flex gap-2 px-5 py-4 text-sm whitespace-nowrap">
|
|
|
|
@if (data_get($resource, 'State') === 'running')
|
|
|
|
<x-forms.button
|
|
|
|
wire:click="restartUnmanaged('{{ data_get($resource, 'ID') }}')"
|
|
|
|
wire:key="{{ data_get($resource, 'ID') }}">Restart</x-forms.button>
|
|
|
|
<x-forms.button isError
|
|
|
|
wire:click="stopUnmanaged('{{ data_get($resource, 'ID') }}')"
|
|
|
|
wire:key="{{ data_get($resource, 'ID') }}">Stop</x-forms.button>
|
|
|
|
@elseif (data_get($resource, 'State') === 'exited')
|
|
|
|
<x-forms.button
|
|
|
|
wire:click="startUnmanaged('{{ data_get($resource, 'ID') }}')"
|
|
|
|
wire:key="{{ data_get($resource, 'ID') }}">Start</x-forms.button>
|
|
|
|
@elseif (data_get($resource, 'State') === 'restarting')
|
|
|
|
<x-forms.button
|
|
|
|
wire:click="stopUnmanaged('{{ data_get($resource, 'ID') }}')"
|
|
|
|
wire:key="{{ data_get($resource, 'ID') }}">Stop</x-forms.button>
|
|
|
|
@endif
|
|
|
|
</td>
|
2024-02-16 22:09:35 +00:00
|
|
|
</tr>
|
2024-03-31 16:38:26 +00:00
|
|
|
@empty
|
|
|
|
@endforelse
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2024-02-16 22:09:35 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-03-31 16:38:26 +00:00
|
|
|
</div>
|
|
|
|
@else
|
|
|
|
<div>No resources found.</div>
|
|
|
|
@endif
|
2024-02-16 22:09:35 +00:00
|
|
|
</div>
|
2024-02-16 20:56:38 +00:00
|
|
|
</div>
|
2024-03-31 16:38:26 +00:00
|
|
|
</div>
|
2024-02-16 20:56:38 +00:00
|
|
|
</div>
|