Fix styling
This commit is contained in:
parent
b17be37aee
commit
f10f3456d7
@ -31,9 +31,9 @@ class General extends Component
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
"echo-private:user.{$userId},DatabaseStatusChanged" => 'database_stopped',
|
"echo-private:user.{$userId},DatabaseStatusChanged" => 'database_stopped',
|
||||||
"refresh",
|
'refresh',
|
||||||
"save_init_script",
|
'save_init_script',
|
||||||
"delete_init_script",
|
'delete_init_script',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,14 +78,16 @@ class General extends Component
|
|||||||
}
|
}
|
||||||
$this->server = data_get($this->database, 'destination.server');
|
$this->server = data_get($this->database, 'destination.server');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function database_stopped()
|
public function database_stopped()
|
||||||
{
|
{
|
||||||
$this->dispatch('success', 'Database proxy stopped. Database is no longer publicly accessible.');
|
$this->dispatch('success', 'Database proxy stopped. Database is no longer publicly accessible.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function instantSaveAdvanced()
|
public function instantSaveAdvanced()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (!$this->server->isLogDrainEnabled()) {
|
if (! $this->server->isLogDrainEnabled()) {
|
||||||
$this->database->is_log_drain_enabled = false;
|
$this->database->is_log_drain_enabled = false;
|
||||||
$this->dispatch('error', 'Log drain is not enabled on the server. Please enable it first.');
|
$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()
|
public function instantSave()
|
||||||
{
|
{
|
||||||
try {
|
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->dispatch('error', 'Public port is required.');
|
||||||
$this->database->is_public = false;
|
$this->database->is_public = false;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($this->database->is_public) {
|
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->dispatch('error', 'Database must be started to be publicly accessible.');
|
||||||
$this->database->is_public = false;
|
$this->database->is_public = false;
|
||||||
|
|
||||||
@ -125,7 +127,7 @@ class General extends Component
|
|||||||
}
|
}
|
||||||
$this->database->save();
|
$this->database->save();
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$this->database->is_public = !$this->database->is_public;
|
$this->database->is_public = ! $this->database->is_public;
|
||||||
|
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
}
|
}
|
||||||
@ -170,7 +172,7 @@ class General extends Component
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!isset($this->database->init_scripts)) {
|
if (! isset($this->database->init_scripts)) {
|
||||||
$this->database->init_scripts = [];
|
$this->database->init_scripts = [];
|
||||||
}
|
}
|
||||||
$this->database->init_scripts = array_merge($this->database->init_scripts, [
|
$this->database->init_scripts = array_merge($this->database->init_scripts, [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user