fix
This commit is contained in:
parent
43a4b1c9cb
commit
6910f9c5c7
@ -43,6 +43,7 @@ class Form extends Component
|
|||||||
if (!$this->server->settings->is_validated) {
|
if (!$this->server->settings->is_validated) {
|
||||||
$this->server->settings->is_validated = true;
|
$this->server->settings->is_validated = true;
|
||||||
$this->server->settings->save();
|
$this->server->settings->save();
|
||||||
|
$this->emit('serverValidated');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->dockerVersion = instantRemoteProcess(['docker version|head -2|grep -i version'], $this->server, false);
|
$this->dockerVersion = instantRemoteProcess(['docker version|head -2|grep -i version'], $this->server, false);
|
||||||
|
@ -11,11 +11,16 @@ use Livewire\Component;
|
|||||||
|
|
||||||
class Proxy extends Component
|
class Proxy extends Component
|
||||||
{
|
{
|
||||||
|
protected $listeners = ['serverValidated'];
|
||||||
public Server $server;
|
public Server $server;
|
||||||
|
|
||||||
public ProxyTypes $selectedProxy = ProxyTypes::TRAEFIK_V2;
|
public ProxyTypes $selectedProxy = ProxyTypes::TRAEFIK_V2;
|
||||||
public $proxy_settings = null;
|
public $proxy_settings = null;
|
||||||
|
|
||||||
|
public function serverValidated()
|
||||||
|
{
|
||||||
|
$this->server->settings->refresh();
|
||||||
|
}
|
||||||
public function installProxy()
|
public function installProxy()
|
||||||
{
|
{
|
||||||
$this->saveConfiguration($this->server);
|
$this->saveConfiguration($this->server);
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
<div>
|
<x-layout>
|
||||||
You are lost. <a href="{{ route('dashboard') }}">Go home</a>
|
<div class="flex items-center justify-center">
|
||||||
</div>
|
<div><a class="underline" href="{{ route('dashboard') }}">Go home</a></div>
|
||||||
|
</div>
|
||||||
|
</x-layout>
|
||||||
|
@ -1,52 +1,56 @@
|
|||||||
<div>
|
<div>
|
||||||
|
@if ($server->settings->is_validated)
|
||||||
@if ($this->server->extra_attributes->proxy_status !== 'running')
|
@if ($this->server->extra_attributes->proxy_status !== 'running')
|
||||||
<select wire:model="selectedProxy">
|
<select wire:model="selectedProxy">
|
||||||
<option value="{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}">
|
<option value="{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}">
|
||||||
{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}
|
{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<x-inputs.button isBold wire:click="setProxy">Set Proxy</x-inputs.button>
|
<x-inputs.button isBold wire:click="setProxy">Set Proxy</x-inputs.button>
|
||||||
@endif
|
@endif
|
||||||
@if ($this->server->extra_attributes->proxy_type)
|
@if ($this->server->extra_attributes->proxy_type)
|
||||||
<div wire:poll="proxyStatus">
|
<div wire:poll="proxyStatus">
|
||||||
@if (
|
@if (
|
||||||
$this->server->extra_attributes->last_applied_proxy_settings &&
|
$this->server->extra_attributes->last_applied_proxy_settings &&
|
||||||
$this->server->extra_attributes->last_saved_proxy_settings !==
|
$this->server->extra_attributes->last_saved_proxy_settings !==
|
||||||
$this->server->extra_attributes->last_applied_proxy_settings)
|
$this->server->extra_attributes->last_applied_proxy_settings)
|
||||||
<div class="text-red-500">Configuration out of sync.</div>
|
<div class="text-red-500">Configuration out of sync.</div>
|
||||||
@endif
|
@endif
|
||||||
@if ($this->server->extra_attributes->proxy_status !== 'running')
|
@if ($this->server->extra_attributes->proxy_status !== 'running')
|
||||||
<x-inputs.button isBold wire:click="installProxy">
|
<x-inputs.button isBold wire:click="installProxy">
|
||||||
Install
|
Install
|
||||||
</x-inputs.button>
|
</x-inputs.button>
|
||||||
@endif
|
@endif
|
||||||
<x-inputs.button isBold wire:click="stopProxy">Stop</x-inputs.button>
|
<x-inputs.button isBold wire:click="stopProxy">Stop</x-inputs.button>
|
||||||
<span x-data="{ showConfiguration: false }">
|
<span x-data="{ showConfiguration: false }">
|
||||||
<x-inputs.button isBold x-on:click="showConfiguration = !showConfiguration">Show Configuration
|
<x-inputs.button isBold x-on:click="showConfiguration = !showConfiguration">Show Configuration
|
||||||
</x-inputs.button>
|
</x-inputs.button>
|
||||||
<div class="pt-4">
|
<div class="pt-4">
|
||||||
<livewire:activity-monitor />
|
<livewire:activity-monitor />
|
||||||
</div>
|
|
||||||
<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>
|
|
||||||
<textarea wire:model.defer="proxy_settings" class="w-full" rows="30"></textarea>
|
|
||||||
</form>
|
|
||||||
@endisset
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
<template x-if="showConfiguration">
|
||||||
</span>
|
<div x-init="$wire.checkProxySettingsInSync">
|
||||||
</div>
|
<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>
|
||||||
|
<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>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -26,9 +26,5 @@
|
|||||||
<div>{{ $server->extra_attributes->proxy_status }}</div>
|
<div>{{ $server->extra_attributes->proxy_status }}</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@if ($server->settings->is_validated)
|
<livewire:server.proxy :server="$server" />
|
||||||
<livewire:server.proxy :server="$server" />
|
|
||||||
@else
|
|
||||||
<p>Server is not validated. Validate first.</p>
|
|
||||||
@endif
|
|
||||||
</x-layout>
|
</x-layout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user