add swarm server grouping

fixes for swarm
This commit is contained in:
Andras Bacsai
2023-12-19 13:47:12 +01:00
parent ef595dd4c2
commit 798acb8ee5
8 changed files with 79 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
@if (Str::of($status)->startsWith('running'))
<x-status.running :status="$status" />
@elseif(Str::of($status)->startsWith('restarting'))
@elseif(Str::of($status)->startsWith('restarting') || Str::of($status)->startsWith('starting'))
<x-status.restarting :status="$status" />
@else
<x-status.stopped :status="$status" />

View File

@@ -205,7 +205,7 @@
@if ($isDatabase)
<div class="flex items-center justify-center pt-4">
<x-forms.checkbox instantSave wire:model="includeSwarm"
helper="Swarm clusters are excluded from this list by default. For database (or services with database) to work with Swarm,
helper="Swarm clusters are excluded from this list by default. For database, services or complex compose deployments with databases to work with Swarm,
you need to set a few things on the server. Read more <a class='text-white underline' href='https://coolify.io/docs/swarm#database-requirements' target='_blank'>here</a>."
label="Include Swarm Clusters" />
</div>

View File

@@ -54,26 +54,28 @@
<x-forms.checkbox instantSave
helper="If you are using Cloudflare Tunnels, enable this. It will proxy all ssh requests to your server through Cloudflare.<span class='text-warning'>Coolify does not install/setup Cloudflare (cloudflared) on your server.</span>"
id="server.settings.is_cloudflare_tunnel" label="Cloudflare Tunnel" />
{{-- @if ($server->settings->is_swarm_worker)
@if ($server->isSwarm())
<div class="pt-6"> Swarm support is in alpha version. </div>
@endif
@if ($server->settings->is_swarm_worker)
<x-forms.checkbox disabled instantSave type="checkbox" id="server.settings.is_swarm_manager"
helper="For more information, please read the documentation <a class='text-white' href='https://coolify.io/docs/swarm' target='_blank'>here</a>."
label="Is it a Swarm Manager?<span class='font-bold text-warning'>(alpha)</span>" />
label="Is it a Swarm Manager?" />
@else
<x-forms.checkbox instantSave type="checkbox" id="server.settings.is_swarm_manager"
helper="For more information, please read the documentation <a class='text-white' href='https://coolify.io/docs/swarm' target='_blank'>here</a>."
label="Is it a Swarm Manager?<span class='font-bold text-warning'>(alpha)</span>"" />
label="Is it a Swarm Manager?" />
@endif
@if ($server->settings->is_swarm_manager)
<x-forms.checkbox disabled instantSave type="checkbox" id="server.settings.is_swarm_worker"
helper="For more information, please read the documentation <a class='text-white' href='https://coolify.io/docs/swarm' target='_blank'>here</a>."
label="Is it a Swarm Worker?<span class='font-bold text-warning'>(alpha)</span>" />
label="Is it a Swarm Worker?" />
@else
<x-forms.checkbox instantSave type="checkbox" id="server.settings.is_swarm_worker"
helper="For more information, please read the documentation <a class='text-white' href='https://coolify.io/docs/swarm' target='_blank'>here</a>."
label="Is it a Swarm Worker?<span class='font-bold text-warning'>(alpha)</span>" />
@endif --}}
label="Is it a Swarm Worker?" />
@endif
@endif
</div>
</div>

View File

@@ -25,26 +25,40 @@
@endif
@endforeach
</x-forms.select>
{{-- <div class="w-72">
<div class="w-72">
<div class="pt-6"> Swarm support is in alpha version. </div>
@if ($is_swarm_worker)
<x-forms.checkbox disabled instantSave type="checkbox" id="is_swarm_manager"
helper="For more information, please read the documentation <a class='text-white' href='https://coolify.io/docs/swarm' target='_blank'>here</a>."
label="Is it a Swarm Manager?<span class='font-bold text-warning'>(alpha)</span>" />
label="Is it a Swarm Manager?" />
@else
<x-forms.checkbox instantSave type="checkbox" id="is_swarm_manager"
<x-forms.checkbox type="checkbox" instantSave id="is_swarm_manager"
helper="For more information, please read the documentation <a class='text-white' href='https://coolify.io/docs/swarm' target='_blank'>here</a>."
label="Is it a Swarm Manager?<span class='font-bold text-warning'>(alpha)</span>" />
label="Is it a Swarm Manager?" />
@endif
@if ($is_swarm_manager)
<x-forms.checkbox disabled instantSave type="checkbox" id="is_swarm_worker"
helper="For more information, please read the documentation <a class='text-white' href='https://coolify.io/docs/swarm' target='_blank'>here</a>."
label="Is it a Swarm Worker?<span class='font-bold text-warning'>(alpha)</span>" />
label="Is it a Swarm Worker?" />
@else
<x-forms.checkbox instantSave type="checkbox" id="is_swarm_worker"
<x-forms.checkbox type="checkbox" instantSave id="is_swarm_worker"
helper="For more information, please read the documentation <a class='text-white' href='https://coolify.io/docs/swarm' target='_blank'>here</a>."
label="Is it a Swarm Worker?<span class='font-bold text-warning'>(alpha)</span>" />
label="Is it a Swarm Worker?" />
@endif
</div> --}}
@if ($is_swarm_worker)
<div class="py-4">
<x-forms.select label="Select a Swarm Cluster" id="selected_swarm_cluster" required>
@foreach ($swarm_managers as $server)
@if ($loop->first)
<option selected value="{{ $server->id }}">{{ $server->name }}</option>
@else
<option value="{{ $server->id }}">{{ $server->name }}</option>
@endif
@endforeach
</x-forms.select>
</div>
@endif
</div>
<x-forms.button type="submit">
Save New Server
</x-forms.button>