DockerController: refactor StartBackupContainerCheckRepair show the starting state

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

View File

@@ -153,13 +153,19 @@ readonly class DockerController {
public function StartBackupContainerCheckRepair(Request $request, Response $response, array $args) : Response {
$this->configurationManager->backupMode = 'check-repair';
// Get streaming response start and closure
$nonbufResp = $this->startStreamingResponse($response);
$addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);
$id = 'nextcloud-aio-borgbackup';
$this->PerformRecursiveContainerStart($id);
$this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody);
// Restore to backup check which is needed to make the UI logic work correctly
$this->configurationManager->backupMode = 'check';
return $response->withStatus(201)->withHeader('Location', '.');
// End streaming response
$this->finalizeStreamingResponse($nonbufResp);
return $nonbufResp;
}
public function StartBackupContainerTest(Request $request, Response $response, array $args) : Response {

View File

@@ -150,7 +150,7 @@
<details>
<summary>Reveal repair option</summary>
<p>Below is the option to repair the integrity of your backup. <strong>Please note:</strong> Please only use this after you have read the documentation above! (It will run the command 'borg check --repair' for you.)</p>
<form method="POST" action="api/docker/backup-check-repair" class="xhr">
<form method="POST" action="api/docker/backup-check-repair" target="overlay-log">
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
<input type="submit" value="Check and repair backup integrity" onclick="return confirm('Check and repair backup integrity? Are you sure that you want to check and repair the backup integrity? This should only be done after reading the mentioned documentation.')"/>
@@ -407,7 +407,7 @@
<details>
<summary>Reveal repair option</summary>
<p>Below is the option to repair the integrity of your backup. <strong>Please note:</strong> Please only use this after you have read the documentation above! (It will run the command 'borg check --repair' for you.)</p>
<form method="POST" action="api/docker/backup-check-repair" class="xhr">
<form method="POST" action="api/docker/backup-check-repair" target="overlay-log">
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
<input type="submit" value="Check and repair backup integrity" onclick="return confirm('Check and repair backup integrity? Are you sure that you want to check and repair the backup integrity? This should only be done after reading the mentioned documentation.')"/>