mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-16 10:40:21 +00:00
Make wasStartButtonClicked an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
c4c04ebcf4
commit
3b26cd7b22
4 changed files with 10 additions and 13 deletions
|
|
@ -105,7 +105,7 @@ $app->get('/containers', function (Request $request, Response $response, array $
|
||||||
'backup_exit_code' => $dockerActionManager->GetBackupcontainerExitCode(),
|
'backup_exit_code' => $dockerActionManager->GetBackupcontainerExitCode(),
|
||||||
'is_instance_restore_attempt' => $configurationManager->isInstanceRestoreAttempt(),
|
'is_instance_restore_attempt' => $configurationManager->isInstanceRestoreAttempt(),
|
||||||
'borg_backup_mode' => $configurationManager->GetBackupMode(),
|
'borg_backup_mode' => $configurationManager->GetBackupMode(),
|
||||||
'was_start_button_clicked' => $configurationManager->wasStartButtonClicked(),
|
'was_start_button_clicked' => $configurationManager->wasStartButtonClicked,
|
||||||
'has_update_available' => $dockerActionManager->isAnyUpdateAvailable(),
|
'has_update_available' => $dockerActionManager->isAnyUpdateAvailable(),
|
||||||
'last_backup_time' => $configurationManager->GetLastBackupTime(),
|
'last_backup_time' => $configurationManager->GetLastBackupTime(),
|
||||||
'backup_times' => $configurationManager->GetBackupTimes(),
|
'backup_times' => $configurationManager->GetBackupTimes(),
|
||||||
|
|
|
||||||
|
|
@ -190,11 +190,11 @@ readonly class DockerController {
|
||||||
$config = $this->configurationManager->GetConfig();
|
$config = $this->configurationManager->GetConfig();
|
||||||
// set AIO_URL
|
// set AIO_URL
|
||||||
$config['AIO_URL'] = $host . ':' . (string)$port . $path;
|
$config['AIO_URL'] = $host . ':' . (string)$port . $path;
|
||||||
// set wasStartButtonClicked
|
|
||||||
$config['wasStartButtonClicked'] = 1;
|
|
||||||
// set install_latest_major
|
// set install_latest_major
|
||||||
$config['install_latest_major'] = $installLatestMajor;
|
$config['install_latest_major'] = $installLatestMajor;
|
||||||
$this->configurationManager->WriteConfig($config);
|
$this->configurationManager->WriteConfig($config);
|
||||||
|
// set wasStartButtonClicked
|
||||||
|
$this->configurationManager->wasStartButtonClicked = true;
|
||||||
|
|
||||||
// Do not pull container images in case 'bypass_container_update' is set via url params
|
// Do not pull container images in case 'bypass_container_update' is set via url params
|
||||||
// Needed for local testing
|
// Needed for local testing
|
||||||
|
|
@ -274,7 +274,7 @@ readonly class DockerController {
|
||||||
public function StartDomaincheckContainer() : void
|
public function StartDomaincheckContainer() : void
|
||||||
{
|
{
|
||||||
# Don't start if domain is already set
|
# Don't start if domain is already set
|
||||||
if ($this->configurationManager->GetDomain() !== '' || $this->configurationManager->wasStartButtonClicked()) {
|
if ($this->configurationManager->GetDomain() !== '' || $this->configurationManager->wasStartButtonClicked) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,11 @@ class ConfigurationManager
|
||||||
set { $this->set('password', $value); }
|
set { $this->set('password', $value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool $wasStartButtonClicked {
|
||||||
|
get => $this->get('wasStartButtonClicked', false);
|
||||||
|
set { $this->set('wasStartButtonClicked', $value); }
|
||||||
|
}
|
||||||
|
|
||||||
public function GetConfig() : array
|
public function GetConfig() : array
|
||||||
{
|
{
|
||||||
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
|
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
|
||||||
|
|
@ -150,14 +155,6 @@ class ConfigurationManager
|
||||||
return $backupTimes;
|
return $backupTimes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function wasStartButtonClicked() : bool {
|
|
||||||
if (isset($this->GetConfig()['wasStartButtonClicked'])) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function isx64Platform() : bool {
|
private function isx64Platform() : bool {
|
||||||
if (php_uname('m') === 'x86_64') {
|
if (php_uname('m') === 'x86_64') {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -621,7 +621,7 @@ readonly class DockerActionManager {
|
||||||
|
|
||||||
public function isAnyUpdateAvailable(): bool {
|
public function isAnyUpdateAvailable(): bool {
|
||||||
// return early if instance is not installed
|
// return early if instance is not installed
|
||||||
if (!$this->configurationManager->wasStartButtonClicked()) {
|
if (!$this->configurationManager->wasStartButtonClicked) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$id = 'nextcloud-aio-apache';
|
$id = 'nextcloud-aio-apache';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue