From 25815988d983859567c0efe550bf931ef5375b82 Mon Sep 17 00:00:00 2001 From: Joao Patricio Date: Fri, 12 May 2023 19:42:39 +0100 Subject: [PATCH] wip --- .../Proxy/CheckProxySettingsInSync.php | 24 +++++++++++++++++++ app/Http/Livewire/Server/Proxy.php | 6 ++--- .../livewire/server/_proxy/options.blade.php | 2 +- 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 app/Actions/Proxy/CheckProxySettingsInSync.php diff --git a/app/Actions/Proxy/CheckProxySettingsInSync.php b/app/Actions/Proxy/CheckProxySettingsInSync.php new file mode 100644 index 000000000..98225d414 --- /dev/null +++ b/app/Actions/Proxy/CheckProxySettingsInSync.php @@ -0,0 +1,24 @@ +extra_attributes->proxy) { + ProxyTypes::TRAEFIK_V2->value => 'proxy', + }; + + return instantRemoteProcess([ + 'if [ -d "projects/'.$folder_name.'" ]; then echo "true"; else echo "false"; fi', + ], $server); + } +} diff --git a/app/Http/Livewire/Server/Proxy.php b/app/Http/Livewire/Server/Proxy.php index a44bb9e6d..40fe2e4cc 100644 --- a/app/Http/Livewire/Server/Proxy.php +++ b/app/Http/Livewire/Server/Proxy.php @@ -2,6 +2,7 @@ namespace App\Http\Livewire\Server; +use App\Actions\Proxy\CheckProxySettingsInSync; use App\Actions\Proxy\InstallProxy; use App\Enums\ActivityTypes; use App\Models\Server; @@ -32,10 +33,9 @@ class Proxy extends Component public function checkProxySettingsInSync() { - - + $status = resolve(CheckProxySettingsInSync::class)($this->server); $this->is_check_proxy_complete = true; - $this->is_proxy_settings_in_sync = true; + $this->is_proxy_settings_in_sync = $status === 'true'; } public function render() diff --git a/resources/views/livewire/server/_proxy/options.blade.php b/resources/views/livewire/server/_proxy/options.blade.php index e6610bc27..5e6657c5f 100644 --- a/resources/views/livewire/server/_proxy/options.blade.php +++ b/resources/views/livewire/server/_proxy/options.blade.php @@ -2,7 +2,7 @@