mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 04:56:52 +00:00
Make wasStartButtonClicked an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
4d8e959608
commit
484ff79943
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(),
|
||||
'is_instance_restore_attempt' => $configurationManager->isInstanceRestoreAttempt(),
|
||||
'borg_backup_mode' => $configurationManager->GetBackupMode(),
|
||||
'was_start_button_clicked' => $configurationManager->wasStartButtonClicked(),
|
||||
'was_start_button_clicked' => $configurationManager->wasStartButtonClicked,
|
||||
'has_update_available' => $dockerActionManager->isAnyUpdateAvailable(),
|
||||
'last_backup_time' => $configurationManager->GetLastBackupTime(),
|
||||
'backup_times' => $configurationManager->GetBackupTimes(),
|
||||
|
|
|
|||
|
|
@ -190,11 +190,11 @@ readonly class DockerController {
|
|||
$config = $this->configurationManager->GetConfig();
|
||||
// set AIO_URL
|
||||
$config['AIO_URL'] = $host . ':' . (string)$port . $path;
|
||||
// set wasStartButtonClicked
|
||||
$config['wasStartButtonClicked'] = 1;
|
||||
// set install_latest_major
|
||||
$config['install_latest_major'] = $installLatestMajor;
|
||||
$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
|
||||
// Needed for local testing
|
||||
|
|
@ -274,7 +274,7 @@ readonly class DockerController {
|
|||
public function StartDomaincheckContainer() : void
|
||||
{
|
||||
# Don't start if domain is already set
|
||||
if ($this->configurationManager->GetDomain() !== '' || $this->configurationManager->wasStartButtonClicked()) {
|
||||
if ($this->configurationManager->GetDomain() !== '' || $this->configurationManager->wasStartButtonClicked) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ class ConfigurationManager
|
|||
set { $this->set('password', $value); }
|
||||
}
|
||||
|
||||
public bool $wasStartButtonClicked {
|
||||
get => $this->get('wasStartButtonClicked', false);
|
||||
set { $this->set('wasStartButtonClicked', $value); }
|
||||
}
|
||||
|
||||
public function GetConfig() : array
|
||||
{
|
||||
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
|
||||
|
|
@ -150,14 +155,6 @@ class ConfigurationManager
|
|||
return $backupTimes;
|
||||
}
|
||||
|
||||
public function wasStartButtonClicked() : bool {
|
||||
if (isset($this->GetConfig()['wasStartButtonClicked'])) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function isx64Platform() : bool {
|
||||
if (php_uname('m') === 'x86_64') {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -621,7 +621,7 @@ readonly class DockerActionManager {
|
|||
|
||||
public function isAnyUpdateAvailable(): bool {
|
||||
// return early if instance is not installed
|
||||
if (!$this->configurationManager->wasStartButtonClicked()) {
|
||||
if (!$this->configurationManager->wasStartButtonClicked) {
|
||||
return false;
|
||||
}
|
||||
$id = 'nextcloud-aio-apache';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue