Make selectedRestoreTime an attribute

Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
Pablo Zmdl 2026-01-19 13:05:10 +01:00
parent c608009981
commit 0c20e2b2f9
3 changed files with 7 additions and 12 deletions

View file

@ -124,14 +124,12 @@ readonly class DockerController {
public function StartBackupContainerRestore(Request $request, Response $response, array $args) : Response {
$this->configurationManager->SetBackupMode('restore');
$config = $this->configurationManager->GetConfig();
$config['selected-restore-time'] = $request->getParsedBody()['selected_restore_time'] ?? '';
if (isset($request->getParsedBody()['restore-exclude-previews'])) {
$config['restore-exclude-previews'] = 1;
} else {
$config['restore-exclude-previews'] = '';
}
$this->configurationManager->WriteConfig($config);
$this->configurationManager->selectedRestoreTime = $request->getParsedBody()['selected_restore_time'] ?? '';
$id = self::TOP_CONTAINER;
$forceStopNextcloud = true;

View file

@ -23,6 +23,11 @@ class ConfigurationManager
set { $this->set('password', $value); }
}
public string $selectedRestoreTime {
get => $this->get('selected-restore-time', '');
set { $this->set('selected-restore-time', $value); }
}
public string $AIO_URL {
get => $this->get('AIO_URL', '');
set { $this->set('AIO_URL', $value); }
@ -467,15 +472,6 @@ class ConfigurationManager
$this->WriteConfig($config);
}
public function GetSelectedRestoreTime() : string {
$config = $this->GetConfig();
if(!isset($config['selected-restore-time'])) {
$config['selected-restore-time'] = '';
}
return $config['selected-restore-time'];
}
public function GetRestoreExcludePreviews() : string {
$config = $this->GetConfig();
if(!isset($config['restore-exclude-previews'])) {

View file

@ -565,6 +565,7 @@ readonly class DockerActionManager {
'AIO_URL' => $this->configurationManager->AIO_URL,
'SELECTED_RESTORE_TIME' => $this->configurationManager->GetSelectedRestoreTime(),
'RESTORE_EXCLUDE_PREVIEWS' => $this->configurationManager->GetRestoreExcludePreviews(),
'SELECTED_RESTORE_TIME' => $this->configurationManager->selectedRestoreTime,
'APACHE_PORT' => $this->configurationManager->GetApachePort(),
'APACHE_IP_BINDING' => $this->configurationManager->GetApacheIPBinding(),
'TALK_PORT' => $this->configurationManager->GetTalkPort(),