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

65 lines
3.0 KiB
PHP
Raw Normal View History

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-16 18:47:59 +00:00
<div class="flex items-center gap-2 mb-4">
<h3 class="pb-0">Proxy</h3>
2023-05-16 09:39:18 +00:00
<div>{{ $server->extra_attributes->proxy_status }}</div>
</div>
@if ($server->extra_attributes->proxy_type)
2023-05-15 19:14:45 +00:00
<div wire:poll="proxyStatus">
@if (
2023-05-16 09:39:18 +00:00
$server->extra_attributes->last_applied_proxy_settings &&
$server->extra_attributes->last_saved_proxy_settings !== $server->extra_attributes->last_applied_proxy_settings)
2023-05-15 19:14:45 +00:00
<div class="text-red-500">Configuration out of sync.</div>
2023-05-16 10:50:00 +00:00
<x-inputs.button isBold wire:click="installProxy">
Reconfigure
</x-inputs.button>
2023-05-15 19:14:45 +00:00
@endif
2023-05-16 09:39:18 +00:00
@if ($server->extra_attributes->proxy_status !== 'running')
2023-05-15 19:14:45 +00:00
<x-inputs.button isBold wire:click="installProxy">
2023-05-16 09:39:18 +00:00
Start
2023-05-15 19:14:45 +00:00
</x-inputs.button>
2023-05-16 09:39:18 +00:00
@else
2023-05-16 09:47:39 +00:00
<x-inputs.button isWarning x-on:click.prevent="stopProxy = true">Stop
</x-inputs.button>
2023-05-15 19:14:45 +00:00
@endif
2023-05-16 10:50:00 +00:00
<div class="py-4">
<livewire:activity-monitor />
</div>
<div x-init="$wire.checkProxySettingsInSync">
<div wire:loading wire:target="checkProxySettingsInSync">
2023-05-16 15:53:48 +00:00
<x-loading />
2023-05-15 11:45:37 +00:00
</div>
2023-05-16 10:50:00 +00:00
@isset($proxy_settings)
<h3>Configuration</h3>
@if ($selectedProxy->value === 'TRAEFIK_V2')
<form wire:submit.prevent='saveConfiguration'>
2023-05-16 18:47:59 +00:00
<div class="py-2 pb-8">
2023-05-16 10:50:00 +00:00
<x-inputs.button isBold>Save</x-inputs.button>
<x-inputs.button wire:click.prevent="resetProxy">
Reset Configuration
</x-inputs.button>
</div>
2023-05-16 18:47:59 +00:00
<h4>traefik.conf</h4>
<x-inputs.input noDirty type="textarea" wire:model.defer="proxy_settings" rows="30" />
2023-05-16 10:50:00 +00:00
</form>
@endif
@endisset
</div>
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>
<x-inputs.button isBold wire:click="setProxy">Set Proxy</x-inputs.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
2023-05-15 19:14:45 +00:00
2023-05-03 05:23:45 +00:00
</div>