From d02902904303b9bc7f67d5ebc87c73b43d01da62 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 8 Jun 2023 08:39:00 +0200 Subject: [PATCH] switch proxy --- app/Http/Livewire/Server/Proxy.php | 5 +++ app/Http/Livewire/Server/Proxy/Status.php | 1 - resources/css/app.css | 2 +- .../views/livewire/server/form.blade.php | 4 +-- .../views/livewire/server/proxy.blade.php | 31 ++++++++++++++----- .../livewire/server/proxy/status.blade.php | 2 +- 6 files changed, 32 insertions(+), 13 deletions(-) diff --git a/app/Http/Livewire/Server/Proxy.php b/app/Http/Livewire/Server/Proxy.php index 59eb81635..5b3f5e119 100644 --- a/app/Http/Livewire/Server/Proxy.php +++ b/app/Http/Livewire/Server/Proxy.php @@ -21,6 +21,11 @@ class Proxy extends Component { $this->server->refresh(); } + public function switchProxy() + { + $this->server->extra_attributes->proxy_type = null; + $this->server->save(); + } public function installProxy() { if ( diff --git a/app/Http/Livewire/Server/Proxy/Status.php b/app/Http/Livewire/Server/Proxy/Status.php index 513e90b9b..8a7725f85 100644 --- a/app/Http/Livewire/Server/Proxy/Status.php +++ b/app/Http/Livewire/Server/Proxy/Status.php @@ -12,7 +12,6 @@ class Status extends Component protected $listeners = ['proxyStatusUpdated', 'serverValidated' => 'proxyStatusUpdated']; public function proxyStatusUpdated() { - ray('Status: ' . $this->server->extra_attributes->proxy_status); $this->server->refresh(); } public function proxyStatus() diff --git a/resources/css/app.css b/resources/css/app.css index 4fd6d165c..2809063c9 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -35,7 +35,7 @@ label { } textarea { - @apply textarea placeholder:text-neutral-700 text-white rounded-none; + @apply textarea placeholder:text-neutral-700 text-white rounded-none scrollbar; } select { @apply select select-sm text-sm disabled:bg-coolgray-200 border-none disabled:opacity-50 font-normal placeholder:text-neutral-700 text-white rounded-none; diff --git a/resources/views/livewire/server/form.blade.php b/resources/views/livewire/server/form.blade.php index a505b1938..aa0d24ce8 100644 --- a/resources/views/livewire/server/form.blade.php +++ b/resources/views/livewire/server/form.blade.php @@ -55,8 +55,8 @@ @endif @isset($uptime) -

Server Info

-
+

Server Info

+

Uptime: {{ $uptime }}

@isset($dockerVersion)

Docker Engine {{ $dockerVersion }}

diff --git a/resources/views/livewire/server/proxy.blade.php b/resources/views/livewire/server/proxy.blade.php index 7a87223f1..c64d4a5ed 100644 --- a/resources/views/livewire/server/proxy.blade.php +++ b/resources/views/livewire/server/proxy.blade.php @@ -13,9 +13,9 @@

Proxy

Save - - Reset to default - + @if ($server->extra_attributes->proxy_status === 'exited') + Switch Proxy + @endif
Traefik v2
@@ -25,8 +25,13 @@
Configuration out of sync. Restart to get the new configs.
@endif - +
+ + + Reset configuration to default + +
@endif @endisset @@ -34,9 +39,19 @@ @else

Proxy

- - Traefik v2 - +
Select a proxy you would like to use on this server.
+
+ + Traefik + v2 + + + Nginx + + + Caddy + +
@endif
diff --git a/resources/views/livewire/server/proxy/status.blade.php b/resources/views/livewire/server/proxy/status.blade.php index 92bb28954..dcd943a92 100644 --- a/resources/views/livewire/server/proxy/status.blade.php +++ b/resources/views/livewire/server/proxy/status.blade.php @@ -1,6 +1,6 @@
@if ($server->settings->is_validated) -
+
@if ($server->extra_attributes->proxy_status === 'running')