From b2487108030e8544dd368ef2d35ceac20f2b5723 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Fri, 27 Feb 2026 10:56:49 +0100 Subject: [PATCH] DockerController: refactor `StartBackupContainerCheck` to show the starting state Signed-off-by: Simon L. --- php/src/Controller/DockerController.php | 15 +++++++++++---- php/templates/containers.twig | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/php/src/Controller/DockerController.php b/php/src/Controller/DockerController.php index 51d2a950..14f97317 100644 --- a/php/src/Controller/DockerController.php +++ b/php/src/Controller/DockerController.php @@ -103,8 +103,15 @@ readonly class DockerController { } public function StartBackupContainerCheck(Request $request, Response $response, array $args) : Response { - $this->checkBackup(); - return $response->withStatus(201)->withHeader('Location', '.'); + // Get streaming response start and closure + $nonbufResp = $this->startStreamingResponse($response); + $addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp); + + $this->checkBackup($addToStreamingResponseBody); + + // End streaming response + $this->finalizeStreamingResponse($nonbufResp); + return $nonbufResp; } public function StartBackupContainerList(Request $request, Response $response, array $args) : Response { @@ -112,11 +119,11 @@ readonly class DockerController { return $response->withStatus(201)->withHeader('Location', '.'); } - public function checkBackup() : void { + public function checkBackup(?\Closure $addToStreamingResponseBody = null) : void { $this->configurationManager->backupMode = 'check'; $id = 'nextcloud-aio-borgbackup'; - $this->PerformRecursiveContainerStart($id); + $this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody); } private function listBackup() : void { diff --git a/php/templates/containers.twig b/php/templates/containers.twig index b92e9f10..17561fbb 100644 --- a/php/templates/containers.twig +++ b/php/templates/containers.twig @@ -161,7 +161,7 @@

Last {{ borg_backup_mode }} successful! (Logs)

{% if borg_backup_mode == 'test' %}

Feel free to check the integrity of the backup archive below before starting the restore process in order to make ensure that the restore will work. This can take a long time though depending on the size of the backup archive and is thus not required.

-
+ @@ -484,7 +484,7 @@

Backup check

Click on the button below to perform a backup integrity check. This is an option that verifies that your backup is intact. It shouldn't be needed in most situations.

- +