2023-05-16 09:47:39 +00:00
|
|
|
<div x-data="{ stopProxy: false }">
|
|
|
|
<x-naked-modal show="stopProxy" action="stopProxy"
|
|
|
|
message='Are you sure you would like to stop the proxy? All resources will be unavailable.' />
|
2023-05-15 19:14:45 +00:00
|
|
|
@if ($server->settings->is_validated)
|
2023-05-22 20:30:33 +00:00
|
|
|
<div class="flex items-center gap-2 mb-2">
|
2023-06-02 10:34:45 +00:00
|
|
|
<h2>Proxy</h2>
|
2023-05-22 20:30:33 +00:00
|
|
|
@if ($server->extra_attributes->proxy_type)
|
2023-05-25 12:05:44 +00:00
|
|
|
<x-forms.button isHighlighted wire:click.prevent="installProxy">
|
2023-05-22 20:30:33 +00:00
|
|
|
Start/Reconfigure Proxy
|
2023-05-25 12:05:44 +00:00
|
|
|
</x-forms.button>
|
|
|
|
<x-forms.button x-on:click.prevent="stopProxy = true">Stop
|
|
|
|
</x-forms.button>
|
2023-05-23 07:53:24 +00:00
|
|
|
<div wire:poll.5000ms="proxyStatus">
|
2023-05-22 20:30:33 +00:00
|
|
|
@if (
|
|
|
|
$server->extra_attributes->last_applied_proxy_settings &&
|
|
|
|
$server->extra_attributes->last_saved_proxy_settings !== $server->extra_attributes->last_applied_proxy_settings)
|
|
|
|
<div class="text-red-500">Configuration out of sync.</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
@if ($server->extra_attributes->proxy_status === 'running')
|
|
|
|
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
|
|
|
|
<div class="flex items-center gap-2 text-sm" wire:loading.remove.delay.longer>
|
|
|
|
<span class="flex w-3 h-3 rounded-full bg-success"></span>
|
|
|
|
<span class="text-green-500">Running</span>
|
|
|
|
</div>
|
|
|
|
@else
|
|
|
|
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
|
|
|
|
<div class="flex items-center gap-2 text-sm" wire:loading.remove.delay.longer>
|
|
|
|
<span class="flex w-3 h-3 rounded-full bg-error"></span>
|
|
|
|
<span class="text-error">Stopped</span>
|
|
|
|
</div>
|
|
|
|
@endif
|
2023-05-16 09:39:18 +00:00
|
|
|
</div>
|
|
|
|
|
2023-05-22 20:30:33 +00:00
|
|
|
<livewire:activity-monitor />
|
2023-05-16 09:39:18 +00:00
|
|
|
@if ($server->extra_attributes->proxy_type)
|
2023-05-22 20:30:33 +00:00
|
|
|
<div x-init="$wire.checkProxySettingsInSync">
|
|
|
|
<div wire:loading wire:target="checkProxySettingsInSync">
|
|
|
|
<x-loading />
|
2023-05-16 10:50:00 +00:00
|
|
|
</div>
|
2023-05-22 20:30:33 +00:00
|
|
|
@isset($proxy_settings)
|
|
|
|
@if ($selectedProxy->value === 'TRAEFIK_V2')
|
|
|
|
<form wire:submit.prevent='saveConfiguration'>
|
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
<h3>Configuration</h3>
|
2023-05-25 12:05:44 +00:00
|
|
|
<x-forms.button type="submit">Save</x-forms.button>
|
|
|
|
<x-forms.button wire:click.prevent="resetProxy">
|
2023-05-22 20:30:33 +00:00
|
|
|
Reset Configuration
|
2023-05-25 12:05:44 +00:00
|
|
|
</x-forms.button>
|
2023-05-22 20:30:33 +00:00
|
|
|
</div>
|
|
|
|
<h4>traefik.conf</h4>
|
2023-05-25 12:05:44 +00:00
|
|
|
<x-forms.textarea class="text-xs" noDirty name="proxy_settings"
|
2023-05-22 20:30:33 +00:00
|
|
|
wire:model.defer="proxy_settings" rows="30" />
|
|
|
|
</form>
|
|
|
|
@endif
|
|
|
|
@endisset
|
2023-05-15 19:14:45 +00:00
|
|
|
</div>
|
2023-05-16 09:39:18 +00:00
|
|
|
@else
|
|
|
|
<select wire:model="selectedProxy">
|
|
|
|
<option value="{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}">
|
|
|
|
{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}
|
|
|
|
</option>
|
|
|
|
</select>
|
2023-05-25 12:05:44 +00:00
|
|
|
<x-forms.button wire:click="setProxy">Set Proxy</x-forms.button>
|
2023-05-15 19:14:45 +00:00
|
|
|
@endif
|
|
|
|
@else
|
|
|
|
<p>Server is not validated. Validate first.</p>
|
2023-05-03 05:23:45 +00:00
|
|
|
@endif
|
|
|
|
</div>
|