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.

Add restart functionality to proxy deployment

Andras Bacsai68fe886fb0f4
diff --git a/app/Livewire/Server/Proxy/Deploy.php b/app/Livewire/Server/Proxy/Deploy.php
index 0dd314cd6a..8349325d04 100644
--- a/app/Livewire/Server/Proxy/Deploy.php
+++ b/app/Livewire/Server/Proxy/Deploy.php
@@ -49,6 +49,14 @@ class Deploy extends Component
{
$this->server->refresh();
}
+ public function restart() {
+ try {
+ $this->stop();
+ $this->dispatch('checkProxy');
+ } catch (\Throwable $e) {
+ return handleError($e, $this);
+ }
+ }
public function checkProxy()
{
try {
diff --git a/resources/views/livewire/server/proxy/deploy.blade.php b/resources/views/livewire/server/proxy/deploy.blade.php
index d016c1c8ee..0bc0ca1ba2 100644
--- a/resources/views/livewire/server/proxy/deploy.blade.php
+++ b/resources/views/livewire/server/proxy/deploy.blade.php
@@ -7,6 +7,15 @@
</p>
</x-slot:modalBody>
</x-modal>
+ <x-modal yesOrNo modalId="restartProxy" modalTitle="Restart Proxy" action="restart">
+ <x-slot:modalBody>
+ <p>This proxy will be stopped and started. It is not reversible. <br>All resources will be unavailable
+ during the restart.
+ <br>Please think
+ again.
+ </p>
+ </x-slot:modalBody>
+ </x-modal>
@if ($server->isFunctional() && data_get($server, 'proxy.type') !== 'NONE')
@if (data_get($server, 'proxy.status') === 'running')
<div class="flex gap-4">
@@ -18,6 +27,17 @@
</a>
</button>
@endif
+ <x-forms.button isModal noStyle modalId="restartProxy"
+ class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">
+ <svg class="w-5 h-5 text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
+ stroke-width="2">
+ <path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
+ <path d="M20 4v5h-5" />
+ </g>
+ </svg>
+ Restart Proxy
+ </x-forms.button>
<x-forms.button isModal noStyle modalId="stopProxy"
class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"