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

72 lines
4.0 KiB
PHP
Raw Normal View History

2023-05-16 11:47:39 +02:00
<div x-data="{ stopProxy: false }">
2023-06-16 15:56:25 +02:00
<x-naked-modal show="stopProxy" action="stopProxy" title="Stop Proxy"
message='This proxy will be stopped. It is not reversible. <br>All resources will be unavailable. <br>Please think again.' />
2023-06-15 13:51:31 +02:00
@if ($server->settings->is_reachable)
2023-06-20 20:19:31 +02:00
@if ($server->proxy->type)
2023-05-22 22:30:33 +02:00
<div x-init="$wire.checkProxySettingsInSync">
<div wire:loading wire:target="checkProxySettingsInSync">
<x-loading />
2023-05-16 12:50:00 +02:00
</div>
2023-06-22 21:17:53 +02:00
<div wire:loading.remove>
@if ($proxy_settings)
@if ($selectedProxy->value === 'TRAEFIK_V2')
<form wire:submit.prevent='saveConfiguration'>
<div class="flex items-center gap-2">
<h2>Proxy</h2>
<x-forms.button type="submit">Save</x-forms.button>
@if ($server->proxy->status === 'exited')
<x-forms.button wire:click.prevent="switchProxy">Switch Proxy</x-forms.button>
@endif
<livewire:server.proxy.status :server="$server" />
</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)
<div class="text-red-500 ">Configuration out of sync. Restart to get the new
configs.
</div>
@endif
2023-06-23 14:20:47 +02:00
<x-forms.input placeholder="https://coolify.io" id="redirect_url"
label="Default Redirect 404"
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-06-22 21:17:53 +02:00
<div class="container w-full mx-auto">
<livewire:activity-monitor :header="true" />
2023-06-02 15:15:12 +02:00
</div>
2023-06-22 21:17:53 +02:00
<div class="flex flex-col gap-2">
<x-forms.textarea label="Configuration file: traefik.conf" class="text-xs" noDirty
name="proxy_settings" wire:model.defer="proxy_settings" rows="30" />
<x-forms.button wire:click.prevent="resetProxy">
Reset configuration to default
</x-forms.button>
</div>
</form>
@endif
@else
<div class="">Server is not validated. Validate first.</div>
2023-05-22 22:30:33 +02:00
@endif
2023-06-22 21:17:53 +02:00
</div>
2023-05-15 21:14:45 +02:00
</div>
2023-05-16 11:39:18 +02:00
@else
2023-06-02 15:15:12 +02:00
<div>
2023-06-08 08:18:14 +02:00
<h2>Proxy</h2>
2023-06-16 12:35:40 +02:00
<div class="pt-2 pb-10 ">Select a proxy you would like to use on this server.</div>
2023-06-08 08:39:00 +02:00
<div class="flex gap-2">
<x-forms.button class="w-32 box" wire:click="setProxy('{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}')">
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>
</div>
2023-06-02 15:15:12 +02:00
</div>
2023-05-15 21:14:45 +02:00
@endif
@else
2023-06-16 12:35:40 +02:00
<div class="">Server is not validated. Validate first.</div>
2023-05-03 07:23:45 +02:00
@endif
</div>