DockerController: refactor StartBackupContainerListto show the starting state

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L.
2026-03-09 18:07:46 +01:00
parent 7922d38aa6
commit c45913a6ff
2 changed files with 11 additions and 4 deletions

View File

@@ -115,8 +115,15 @@ readonly class DockerController {
}
public function StartBackupContainerList(Request $request, Response $response, array $args) : Response {
// Get streaming response start and closure
$nonbufResp = $this->startStreamingResponse($response);
$addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);
$this->listBackup();
return $response->withStatus(201)->withHeader('Location', '.');
// End streaming response
$this->finalizeStreamingResponse($nonbufResp);
return $nonbufResp;
}
public function checkBackup(?\Closure $addToStreamingResponseBody = null) : void {
@@ -126,11 +133,11 @@ readonly class DockerController {
$this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody);
}
private function listBackup() : void {
private function listBackup(?\Closure $addToStreamingResponseBody = null) : void {
$this->configurationManager->backupMode = 'list';
$id = 'nextcloud-aio-borgbackup';
$this->PerformRecursiveContainerStart($id);
$this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody);
}
public function StartBackupContainerRestore(Request $request, Response $response, array $args) : Response {