From f10f3456d7bfc6f6d4a3ed7b0d8cc3eeaa9a4a97 Mon Sep 17 00:00:00 2001 From: andrasbacsai Date: Fri, 14 Jun 2024 12:10:40 +0000 Subject: [PATCH] Fix styling --- .../Project/Database/Postgresql/General.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/Livewire/Project/Database/Postgresql/General.php b/app/Livewire/Project/Database/Postgresql/General.php index a950e5ef9..1c5d39055 100644 --- a/app/Livewire/Project/Database/Postgresql/General.php +++ b/app/Livewire/Project/Database/Postgresql/General.php @@ -31,9 +31,9 @@ class General extends Component return [ "echo-private:user.{$userId},DatabaseStatusChanged" => 'database_stopped', - "refresh", - "save_init_script", - "delete_init_script", + 'refresh', + 'save_init_script', + 'delete_init_script', ]; } @@ -78,14 +78,16 @@ class General extends Component } $this->server = data_get($this->database, 'destination.server'); } + public function database_stopped() { $this->dispatch('success', 'Database proxy stopped. Database is no longer publicly accessible.'); } + public function instantSaveAdvanced() { try { - if (!$this->server->isLogDrainEnabled()) { + if (! $this->server->isLogDrainEnabled()) { $this->database->is_log_drain_enabled = false; $this->dispatch('error', 'Log drain is not enabled on the server. Please enable it first.'); @@ -102,14 +104,14 @@ class General extends Component public function instantSave() { try { - if ($this->database->is_public && !$this->database->public_port) { + if ($this->database->is_public && ! $this->database->public_port) { $this->dispatch('error', 'Public port is required.'); $this->database->is_public = false; return; } if ($this->database->is_public) { - if (!str($this->database->status)->startsWith('running')) { + if (! str($this->database->status)->startsWith('running')) { $this->dispatch('error', 'Database must be started to be publicly accessible.'); $this->database->is_public = false; @@ -125,7 +127,7 @@ class General extends Component } $this->database->save(); } catch (\Throwable $e) { - $this->database->is_public = !$this->database->is_public; + $this->database->is_public = ! $this->database->is_public; return handleError($e, $this); } @@ -170,7 +172,7 @@ class General extends Component return; } - if (!isset($this->database->init_scripts)) { + if (! isset($this->database->init_scripts)) { $this->database->init_scripts = []; } $this->database->init_scripts = array_merge($this->database->init_scripts, [