Update version numbers and database URLs

This commit is contained in:
Andras Bacsai
2023-11-08 12:26:57 +01:00
parent aba47d58a4
commit 88e407756d
13 changed files with 100 additions and 42 deletions

View File

@@ -15,7 +15,8 @@ class General extends Component
public StandalonePostgresql $database;
public string $new_filename;
public string $new_content;
public string $db_url;
public ?string $db_url = null;
public ?string $db_url_public = null;
protected $listeners = ['refresh', 'save_init_script', 'delete_init_script'];
@@ -49,7 +50,10 @@ class General extends Component
];
public function mount()
{
$this->db_url = $this->database->getDbUrl();
$this->db_url = $this->database->getDbUrl(true);
if ($this->database->is_public) {
$this->db_url_public = $this->database->getDbUrl();
}
}
public function instantSave()
{
@@ -66,12 +70,13 @@ class General extends Component
return;
}
StartDatabaseProxy::run($this->database);
$this->db_url_public = $this->database->getDbUrl();
$this->emit('success', 'Database is now publicly accessible.');
} else {
StopDatabaseProxy::run($this->database);
$this->db_url_public = null;
$this->emit('success', 'Database is no longer publicly accessible.');
}
$this->db_url = $this->database->getDbUrl();
$this->database->save();
} catch (\Throwable $e) {
$this->database->is_public = !$this->database->is_public;