From 6910f9c5c7e4cdde6cc22e1e61a1f9b6e5bac4f5 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 May 2023 21:14:45 +0200 Subject: [PATCH] fix --- app/Http/Livewire/Server/Form.php | 1 + app/Http/Livewire/Server/Proxy.php | 5 + resources/views/errors/404.blade.php | 8 +- .../views/livewire/server/proxy.blade.php | 100 +++++++++--------- resources/views/server/show.blade.php | 6 +- 5 files changed, 64 insertions(+), 56 deletions(-) diff --git a/app/Http/Livewire/Server/Form.php b/app/Http/Livewire/Server/Form.php index ed2fc38b4..f131c159a 100644 --- a/app/Http/Livewire/Server/Form.php +++ b/app/Http/Livewire/Server/Form.php @@ -43,6 +43,7 @@ public function validateServer() if (!$this->server->settings->is_validated) { $this->server->settings->is_validated = true; $this->server->settings->save(); + $this->emit('serverValidated'); } } $this->dockerVersion = instantRemoteProcess(['docker version|head -2|grep -i version'], $this->server, false); diff --git a/app/Http/Livewire/Server/Proxy.php b/app/Http/Livewire/Server/Proxy.php index 1991b75e9..2cfae33dc 100644 --- a/app/Http/Livewire/Server/Proxy.php +++ b/app/Http/Livewire/Server/Proxy.php @@ -11,11 +11,16 @@ class Proxy extends Component { + protected $listeners = ['serverValidated']; public Server $server; public ProxyTypes $selectedProxy = ProxyTypes::TRAEFIK_V2; public $proxy_settings = null; + public function serverValidated() + { + $this->server->settings->refresh(); + } public function installProxy() { $this->saveConfiguration($this->server); diff --git a/resources/views/errors/404.blade.php b/resources/views/errors/404.blade.php index c5c95717d..b9782463c 100644 --- a/resources/views/errors/404.blade.php +++ b/resources/views/errors/404.blade.php @@ -1,3 +1,5 @@ -
- You are lost. Go home -
+ +
+
Go home
+
+
diff --git a/resources/views/livewire/server/proxy.blade.php b/resources/views/livewire/server/proxy.blade.php index ca3b1629a..3487b57e4 100644 --- a/resources/views/livewire/server/proxy.blade.php +++ b/resources/views/livewire/server/proxy.blade.php @@ -1,52 +1,56 @@
- - @if ($this->server->extra_attributes->proxy_status !== 'running') - - Set Proxy - @endif - @if ($this->server->extra_attributes->proxy_type) -
- @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) -
Configuration out of sync.
- @endif - @if ($this->server->extra_attributes->proxy_status !== 'running') - - Install - - @endif - Stop - - Show Configuration - -
- -
- -
-
+ + +
+ @endif + @else +

Server is not validated. Validate first.

@endif + diff --git a/resources/views/server/show.blade.php b/resources/views/server/show.blade.php index 761e61747..83c56598d 100644 --- a/resources/views/server/show.blade.php +++ b/resources/views/server/show.blade.php @@ -26,9 +26,5 @@
{{ $server->extra_attributes->proxy_status }}
@endif - @if ($server->settings->is_validated) - - @else -

Server is not validated. Validate first.

- @endif +