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

61 lines
3.0 KiB
PHP
Raw Normal View History

2023-05-03 05:23:45 +00:00
<div>
2023-05-15 19:14:45 +00:00
@if ($server->settings->is_validated)
@if ($this->server->extra_attributes->proxy_status !== 'running')
<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>
@endif
@if ($this->server->extra_attributes->proxy_type)
<div wire:poll="proxyStatus">
@if (
$this->server->extra_attributes->last_applied_proxy_settings &&
$this->server->extra_attributes->last_saved_proxy_settings !==
$this->server->extra_attributes->last_applied_proxy_settings)
<div class="text-red-500">Configuration out of sync.</div>
@endif
@if ($this->server->extra_attributes->proxy_status !== 'running')
<x-inputs.button isBold wire:click="installProxy">
Install
</x-inputs.button>
@endif
<x-inputs.button isBold wire:click="stopProxy">Stop</x-inputs.button>
<span x-data="{ showConfiguration: false }">
2023-05-15 20:17:31 +00:00
<x-inputs.button isBold x-on:click.prevent="showConfiguration = !showConfiguration">Show
Configuration
2023-05-15 19:14:45 +00:00
</x-inputs.button>
<div class="pt-4">
<livewire:activity-monitor />
2023-05-15 11:45:37 +00:00
</div>
2023-05-15 19:14:45 +00:00
<template x-if="showConfiguration">
<div x-init="$wire.checkProxySettingsInSync">
<h3>Configuration</h3>
<div wire:loading wire:target="checkProxySettingsInSync">
<x-proxy.loading />
</div>
@isset($this->proxy_settings)
<form wire:submit.prevent='saveConfiguration'>
<x-inputs.button isBold>Save</x-inputs.button>
<x-inputs.button x-on:click="showConfiguration = false" isBold
wire:click.prevent="installProxy">
Apply
</x-inputs.button>
2023-05-15 20:17:31 +00:00
<x-inputs.button isBold wire:click.prevent="resetProxy">
2023-05-15 20:06:08 +00:00
Default
</x-inputs.button>
2023-05-15 19:14:45 +00:00
<textarea wire:model.defer="proxy_settings" class="w-full" rows="30"></textarea>
</form>
@endisset
</div>
</template>
</span>
</div>
@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>