Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

switch proxy

Andras Bacsaid02902904303
diff --git a/app/Http/Livewire/Server/Proxy.php b/app/Http/Livewire/Server/Proxy.php
index 59eb816356..5b3f5e1193 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 513e90b9b7..8a7725f85f 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 4fd6d165cb..2809063c95 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 a505b1938d..aa0d24ce83 100644
--- a/resources/views/livewire/server/form.blade.php
+++ b/resources/views/livewire/server/form.blade.php
@@ -55,8 +55,8 @@
</div>
@endif
@isset($uptime)
- <h3>Server Info</h3>
- <div class="pt-3 text-sm">
+ <h3 class="py-3">Server Info</h3>
+ <div class="text-sm">
<p>Uptime: {{ $uptime }}</p>
@isset($dockerVersion)
<p>Docker Engine {{ $dockerVersion }}</p>
diff --git a/resources/views/livewire/server/proxy.blade.php b/resources/views/livewire/server/proxy.blade.php
index 7a87223f19..c64d4a5ede 100644
--- a/resources/views/livewire/server/proxy.blade.php
+++ b/resources/views/livewire/server/proxy.blade.php
@@ -13,9 +13,9 @@
<div class="flex items-center gap-2">
<h2>Proxy</h2>
<x-forms.button type="submit">Save</x-forms.button>
- <x-forms.button wire:click.prevent="resetProxy">
- Reset to default
- </x-forms.button>
+ @if ($server->extra_attributes->proxy_status === 'exited')
+ <x-forms.button wire:click.prevent="switchProxy">Switch Proxy</x-forms.button>
+ @endif
<livewire:server.proxy.status :server="$server" />
</div>
<div class="pb-4 text-sm">Traefik v2</div>
@@ -25,8 +25,13 @@
<div class="text-sm text-red-500">Configuration out of sync. Restart to get the new configs.
</div>
@endif
- <x-forms.textarea label="Configuration file: traefik.conf" class="text-xs" noDirty
- name="proxy_settings" wire:model.defer="proxy_settings" rows="30" />
+ <div class="flex flex-col gap-2">
+ <x-forms.textarea label="Configuration file: traefik.conf" class="text-xs" noDirty
+ name="proxy_settings" wire:model.defer="proxy_settings" rows="30" />
+ <x-forms.button wire:click.prevent="resetProxy">
+ Reset configuration to default
+ </x-forms.button>
+ </div>
</form>
@endif
@endisset
@@ -34,9 +39,19 @@
@else
<div>
<h2>Proxy</h2>
-
- <x-forms.button wire:click="setProxy('{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}')">Traefik v2
- </x-forms.button>
+ <div class="pt-2 pb-10 text-sm">Select a proxy you would like to use on this server.</div>
+ <div class="flex gap-2">
+ <x-forms.button class="w-32 box" wire:click="setProxy('{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}')">
+ Traefik
+ v2
+ </x-forms.button>
+ <x-forms.button disabled class="w-32 box">
+ Nginx
+ </x-forms.button>
+ <x-forms.button disabled class="w-32 box">
+ Caddy
+ </x-forms.button>
+ </div>
</div>
@endif
<div class="container w-full pt-4 mx-auto">
diff --git a/resources/views/livewire/server/proxy/status.blade.php b/resources/views/livewire/server/proxy/status.blade.php
index 92bb28954d..dcd943a925 100644
--- a/resources/views/livewire/server/proxy/status.blade.php
+++ b/resources/views/livewire/server/proxy/status.blade.php
@@ -1,6 +1,6 @@
<div>
@if ($server->settings->is_validated)
- <div wire:poll.5000ms="proxyStatus">
+ <div wire:poll.10000ms="proxyStatus">
@if ($server->extra_attributes->proxy_status === 'running')
<x-loading wire:loading.delay.longer />
<div class="flex items-center gap-2" wire:loading.remove.delay.longer>