From 68fe886fb0f41bcde51bfd43b466d2eaf173434a Mon Sep 17 00:00:00 2001
From: Andras Bacsai
Date: Thu, 18 Jan 2024 12:14:11 +0100
Subject: [PATCH] Add restart functionality to proxy deployment
---
app/Livewire/Server/Proxy/Deploy.php | 8 ++++++++
.../livewire/server/proxy/deploy.blade.php | 20 +++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/app/Livewire/Server/Proxy/Deploy.php b/app/Livewire/Server/Proxy/Deploy.php
index 0dd314cd6..8349325d0 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 d016c1c8e..0bc0ca1ba 100644
--- a/resources/views/livewire/server/proxy/deploy.blade.php
+++ b/resources/views/livewire/server/proxy/deploy.blade.php
@@ -7,6 +7,15 @@
+
+
+ This proxy will be stopped and started. It is not reversible.
All resources will be unavailable
+ during the restart.
+
Please think
+ again.
+
+
+
@if ($server->isFunctional() && data_get($server, 'proxy.type') !== 'NONE')
@if (data_get($server, 'proxy.status') === 'running')
@@ -18,6 +27,17 @@
@endif
+
+
+ Restart Proxy
+