coolify/resources/views/livewire/server/proxy.blade.php

90 lines
4.6 KiB
PHP
Raw Normal View History

2023-07-28 13:31:47 +02:00
<div>
2023-09-12 13:14:01 +02:00
@if ($server->isFunctional())
2023-09-11 22:29:34 +02:00
@if (data_get($server,'proxy.type'))
<x-modal submitWireAction="proxyStatusUpdated" modalId="startProxy">
<x-slot:modalBody>
<livewire:activity-monitor header="Proxy Startup Logs" />
</x-slot:modalBody>
<x-slot:modalSubmit>
<x-forms.button onclick="startProxy.close()" type="submit">
Close
</x-forms.button>
</x-slot:modalSubmit>
</x-modal>
<div x-init="$wire.loadProxyConfiguration">
2023-09-06 15:00:56 +02:00
@if ($selectedProxy === 'TRAEFIK_V2')
2023-07-28 14:44:26 +02:00
<form wire:submit.prevent='submit'>
2023-06-23 14:35:13 +02:00
<div class="flex items-center gap-2">
<h2>Proxy</h2>
<x-forms.button type="submit">Save</x-forms.button>
@if ($server->proxy->status === 'exited')
2023-07-28 14:44:26 +02:00
<x-forms.button wire:click.prevent="change_proxy">Switch Proxy</x-forms.button>
2023-06-23 14:35:13 +02:00
@endif
</div>
<div class="pt-3 pb-4 ">Traefik v2</div>
@if (
$server->proxy->last_applied_settings &&
$server->proxy->last_saved_settings !== $server->proxy->last_applied_settings)
2023-07-28 16:42:28 +02:00
<div class="text-red-500 ">Configuration out of sync. Restart the proxy to apply the new
configurations.
2023-06-23 14:35:13 +02:00
</div>
@endif
<x-forms.input placeholder="https://coolify.io" id="redirect_url" label="Default Redirect 404"
2023-08-11 20:19:42 +02:00
helper="All urls that has no service available will be redirected to this domain.<span class='text-helper'>You can set to your main marketing page or your social media link.</span>" />
2023-09-11 22:29:34 +02:00
<div wire:loading wire:target="loadProxyConfiguration" class="pt-4">
2023-08-11 20:19:42 +02:00
<x-loading text="Loading proxy configuration..." />
2023-06-23 14:35:13 +02:00
</div>
2023-09-11 22:29:34 +02:00
<div wire:loading.remove wire:target="loadProxyConfiguration">
2023-06-23 14:35:13 +02:00
@if ($proxy_settings)
<div class="flex flex-col gap-2 pt-2">
2023-07-13 13:16:24 +02:00
<x-forms.textarea label="Configuration file: traefik.conf" name="proxy_settings"
2023-08-11 20:19:42 +02:00
wire:model.defer="proxy_settings" rows="30" />
2023-07-28 14:44:26 +02:00
<x-forms.button wire:click.prevent="reset_proxy_configuration">
2023-06-22 21:17:53 +02:00
Reset configuration to default
</x-forms.button>
</div>
2023-06-23 14:35:13 +02:00
@endif
</div>
</form>
2023-09-06 15:00:56 +02:00
@elseif($selectedProxy === 'NONE')
<div class="flex items-center gap-2">
<h2>Proxy</h2>
@if ($server->proxy->status === 'exited')
<x-forms.button wire:click.prevent="change_proxy">Switch Proxy</x-forms.button>
@endif
</div>
<div class="pt-3 pb-4">None</div>
@else
<div class="flex items-center gap-2">
<h2>Proxy</h2>
@if ($server->proxy->status === 'exited')
<x-forms.button wire:click.prevent="change_proxy">Switch Proxy</x-forms.button>
@endif
</div>
2023-06-23 14:35:13 +02:00
@endif
2023-08-11 20:19:42 +02:00
@else
<div>
<h2>Proxy</h2>
2023-08-14 14:00:10 +02:00
<div class="subtitle ">Select a proxy you would like to use on this server.</div>
2023-08-11 20:19:42 +02:00
<div class="flex gap-2">
2023-09-06 15:00:56 +02:00
<x-forms.button class="w-32 box" wire:click="select_proxy('NONE')">
Custom (None)
</x-forms.button>
<x-forms.button class="w-32 box" wire:click="select_proxy('TRAEFIK_V2')">
2023-08-11 20:19:42 +02:00
Traefik
v2
</x-forms.button>
<x-forms.button disabled class="w-32 box">
Nginx
</x-forms.button>
<x-forms.button disabled class="w-32 box">
Caddy
</x-forms.button>
2023-06-23 14:35:13 +02:00
</div>
2023-08-11 20:19:42 +02:00
</div>
@endif
@else
<div>Server is not validated. Validate first.</div>
@endif
</div>