refactor(settings): streamline instance admin checks and initialization of settings in Livewire components
This commit is contained in:
@@ -44,7 +44,7 @@ class Advanced extends Component
|
|||||||
{
|
{
|
||||||
if (! isInstanceAdmin()) {
|
if (! isInstanceAdmin()) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
} else {
|
}
|
||||||
$this->server = Server::findOrFail(0);
|
$this->server = Server::findOrFail(0);
|
||||||
$this->settings = instanceSettings();
|
$this->settings = instanceSettings();
|
||||||
$this->custom_dns_servers = $this->settings->custom_dns_servers;
|
$this->custom_dns_servers = $this->settings->custom_dns_servers;
|
||||||
@@ -56,7 +56,6 @@ class Advanced extends Component
|
|||||||
$this->disable_two_step_confirmation = $this->settings->disable_two_step_confirmation;
|
$this->disable_two_step_confirmation = $this->settings->disable_two_step_confirmation;
|
||||||
$this->is_sponsorship_popup_enabled = $this->settings->is_sponsorship_popup_enabled;
|
$this->is_sponsorship_popup_enabled = $this->settings->is_sponsorship_popup_enabled;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public function submit()
|
public function submit()
|
||||||
{
|
{
|
||||||
|
@@ -44,7 +44,7 @@ class Index extends Component
|
|||||||
{
|
{
|
||||||
if (! isInstanceAdmin()) {
|
if (! isInstanceAdmin()) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
} else {
|
}
|
||||||
$this->settings = instanceSettings();
|
$this->settings = instanceSettings();
|
||||||
$this->server = Server::findOrFail(0);
|
$this->server = Server::findOrFail(0);
|
||||||
$this->fqdn = $this->settings->fqdn;
|
$this->fqdn = $this->settings->fqdn;
|
||||||
@@ -55,7 +55,6 @@ class Index extends Component
|
|||||||
$this->public_ipv6 = $this->settings->public_ipv6;
|
$this->public_ipv6 = $this->settings->public_ipv6;
|
||||||
$this->instance_timezone = $this->settings->instance_timezone;
|
$this->instance_timezone = $this->settings->instance_timezone;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[Computed]
|
#[Computed]
|
||||||
public function timezones(): array
|
public function timezones(): array
|
||||||
|
@@ -46,7 +46,7 @@ class SettingsBackup extends Component
|
|||||||
{
|
{
|
||||||
if (! isInstanceAdmin()) {
|
if (! isInstanceAdmin()) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
} else {
|
}
|
||||||
$settings = instanceSettings();
|
$settings = instanceSettings();
|
||||||
$this->server = Server::findOrFail(0);
|
$this->server = Server::findOrFail(0);
|
||||||
$this->database = StandalonePostgresql::whereName('coolify-db')->first();
|
$this->database = StandalonePostgresql::whereName('coolify-db')->first();
|
||||||
@@ -72,7 +72,6 @@ class SettingsBackup extends Component
|
|||||||
$this->settings = $settings;
|
$this->settings = $settings;
|
||||||
$this->s3s = $s3s;
|
$this->s3s = $s3s;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public function addCoolifyDatabase()
|
public function addCoolifyDatabase()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user