From 25a0489f7f70b44f1cf4857e62f72cf81ac612d9 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 22 Nov 2023 14:21:03 +0100 Subject: [PATCH] Fix log drain issue in advanced and service application --- app/Http/Livewire/Project/Application/Advanced.php | 2 +- app/Http/Livewire/Project/Service/Application.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Livewire/Project/Application/Advanced.php b/app/Http/Livewire/Project/Application/Advanced.php index 552a3873a..656c55717 100644 --- a/app/Http/Livewire/Project/Application/Advanced.php +++ b/app/Http/Livewire/Project/Application/Advanced.php @@ -23,7 +23,7 @@ class Advanced extends Component ]; public function instantSave() { - if ($this->application->settings->is_log_drain_enabled) { + if ($this->application->isLogDrainEnabled()) { if (!$this->application->destination->server->isLogDrainEnabled()) { $this->application->settings->is_log_drain_enabled = false; $this->emit('error', 'Log drain is not enabled on this server.'); diff --git a/app/Http/Livewire/Project/Service/Application.php b/app/Http/Livewire/Project/Service/Application.php index 8a785b9c6..14fd3d5ab 100644 --- a/app/Http/Livewire/Project/Service/Application.php +++ b/app/Http/Livewire/Project/Service/Application.php @@ -28,7 +28,12 @@ class Application extends Component } public function instantSaveAdvanced() { - $this->submit(); + if (!$this->application->service->destination->server->isLogDrainEnabled()) { + $this->application->is_log_drain_enabled = false; + $this->emit('error', 'Log drain is not enabled on the server. Please enable it first.'); + return; + } + $this->application->save(); $this->emit('success', 'You need to restart the service for the changes to take effect.'); } public function delete() @@ -49,11 +54,6 @@ class Application extends Component { try { $this->validate(); - if (!$this->application->service->destination->server->isLogDrainEnabled()) { - $this->application->is_log_drain_enabled = false; - $this->emit('error', 'Log drain is not enabled on the server. Please enable it first.'); - return; - } $this->application->save(); updateCompose($this->application); $this->emit('success', 'Application saved successfully.');