coolify/resources/views/livewire/project/shared/destination.blade.php

91 lines
4.8 KiB
PHP
Raw Normal View History

2023-08-07 22:14:21 +02:00
<div>
2024-02-07 14:55:06 +01:00
<h2>Servers</h2>
<div class="">Server related configurations.</div>
2024-02-07 14:55:06 +01:00
<div class="grid grid-cols-1 gap-4 py-4">
<div class="flex gap-2">
<div class="relative flex flex-col text-white cursor-default box-without-bg bg-coolgray-100 w-96">
<div class="text-xl font-bold">Primary Server</div>
2024-02-07 14:55:06 +01:00
@if (str($resource->realStatus())->startsWith('running'))
2024-03-19 15:37:16 +01:00
<div title="{{ $resource->realStatus() }}" class="absolute bg-success -top-1 -left-1 badge ">
2024-02-07 14:55:06 +01:00
</div>
@elseif (str($resource->realStatus())->startsWith('exited'))
2024-03-19 15:37:16 +01:00
<div title="{{ $resource->realStatus() }}" class="absolute bg-error -top-1 -left-1 badge ">
2024-02-07 14:55:06 +01:00
</div>
@endif
<div>
Server: {{ data_get($resource, 'destination.server.name') }}
</div>
<div>
Network: {{ data_get($resource, 'destination.network') }}
2024-02-07 14:55:06 +01:00
</div>
</div>
@if ($resource?->additional_networks?->count() > 0)
<x-forms.button
wire:click="redeploy('{{ data_get($resource, 'destination.id') }}','{{ data_get($resource, 'destination.server.id') }}')">Deploy</x-forms.button>
@if (str($resource->realStatus())->startsWith('running'))
<x-forms.button isError
wire:click="stop('{{ data_get($resource, 'destination.server.id') }}')">Stop</x-forms.button>
@endif
2024-02-07 14:55:06 +01:00
@endif
</div>
@if ($resource?->additional_networks?->count() > 0)
@foreach ($resource->additional_networks as $destination)
2024-02-07 14:55:06 +01:00
<div class="flex gap-2">
<div class="relative flex flex-col box w-96">
2024-02-07 14:55:06 +01:00
@if (str(data_get($destination, 'pivot.status'))->startsWith('running'))
<div title="{{ data_get($destination, 'pivot.status') }}"
2024-03-19 15:37:16 +01:00
class="absolute bg-success -top-1 -left-1 badge "></div>
2024-02-07 14:55:06 +01:00
@elseif (str(data_get($destination, 'pivot.status'))->startsWith('exited'))
<div title="{{ data_get($destination, 'pivot.status') }}"
2024-03-19 15:37:16 +01:00
class="absolute bg-error -top-1 -left-1 badge "></div>
2024-02-07 14:55:06 +01:00
@endif
<div>
Server: {{ data_get($destination, 'server.name') }}
</div>
<div>
Network: {{ data_get($destination, 'network') }}
2024-02-07 14:55:06 +01:00
</div>
</div>
<x-forms.button
wire:click="redeploy('{{ data_get($destination, 'id') }}','{{ data_get($destination, 'server.id') }}')">Deploy</x-forms.button>
<x-forms.button
wire:click="promote('{{ data_get($destination, 'id') }}','{{ data_get($destination, 'server.id') }}')">Promote
to Primary </x-forms.button>
@if (data_get_str($destination, 'pivot.status')->startsWith('running'))
<x-forms.button isError
wire:click="stop('{{ data_get($destination, 'server.id') }}')">Stop</x-forms.button>
@endif
2024-03-20 12:54:06 +01:00
<x-modal-confirmation
2024-02-07 14:55:06 +01:00
action="removeServer({{ data_get($destination, 'id') }},{{ data_get($destination, 'server.id') }})"
isErrorButton buttonTitle="Remove Server">
This will stop the running application in this server and remove it as a deployment
destination.<br><br>Please think again.
2024-03-20 12:54:06 +01:00
</x-modal-confirmation>
</div>
@endforeach
@endif
2023-08-07 22:14:21 +02:00
</div>
@if ($resource->getMorphClass() === 'App\Models\Application')
2024-02-07 14:55:06 +01:00
@if (count($networks) > 0)
<h4>Choose another server</h4>
<div class="pb-4 description">(experimental) </div>
<div class="grid grid-cols-1 gap-4">
2024-02-07 14:55:06 +01:00
@foreach ($networks as $network)
<div wire:click="addServer('{{ $network->id }}','{{ data_get($network, 'server.id') }}')"
class="relative flex flex-col text-white cursor-default box w-96">
<div>
Server: {{ data_get($network, 'server.name') }}
</div>
<div>
Network: {{ data_get($network, 'name') }}
</div>
2024-02-07 14:55:06 +01:00
</div>
@endforeach
</div>
@else
<div class="text-neutral-500">No additional servers available to attach.</div>
@endif
@endif
2023-08-07 22:14:21 +02:00
</div>