mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-21 10:50:10 +00:00
Merge pull request #7705 from nextcloud/enh/noid/show-stop-and-starting-state
DockerController: refactor `StartBackupContainerBackup` to show the stopping and starting state
This commit is contained in:
@@ -87,19 +87,26 @@ readonly class DockerController {
|
||||
}
|
||||
|
||||
public function StartBackupContainerBackup(Request $request, Response $response, array $args) : Response {
|
||||
// Get streaming response start and closure
|
||||
$nonbufResp = $this->startStreamingResponse($response);
|
||||
$addToStreamingResponseBody = $this->getAddToStreamingResponseBody($nonbufResp);
|
||||
|
||||
$forceStopNextcloud = true;
|
||||
$this->startBackup($forceStopNextcloud);
|
||||
return $response->withStatus(201)->withHeader('Location', '.');
|
||||
$this->startBackup($forceStopNextcloud, $addToStreamingResponseBody);
|
||||
|
||||
// End streaming response
|
||||
$this->finalizeStreamingResponse($nonbufResp);
|
||||
return $nonbufResp;
|
||||
}
|
||||
|
||||
public function startBackup(bool $forceStopNextcloud = false) : void {
|
||||
public function startBackup(bool $forceStopNextcloud = false, ?\Closure $addToStreamingResponseBody = null) : void {
|
||||
$this->configurationManager->backupMode = 'backup';
|
||||
|
||||
$id = self::TOP_CONTAINER;
|
||||
$this->PerformRecursiveContainerStop($id, $forceStopNextcloud);
|
||||
$this->PerformRecursiveContainerStop($id, $forceStopNextcloud, $addToStreamingResponseBody);
|
||||
|
||||
$id = 'nextcloud-aio-borgbackup';
|
||||
$this->PerformRecursiveContainerStart($id);
|
||||
$this->PerformRecursiveContainerStart($id, true, $addToStreamingResponseBody);
|
||||
}
|
||||
|
||||
public function StartBackupContainerCheck(Request $request, Response $response, array $args) : Response {
|
||||
|
||||
@@ -472,7 +472,7 @@
|
||||
{% if isApacheStarting != true %}
|
||||
<h3>Backup creation</h3>
|
||||
<p>Clicking on the button below will create a backup.</p>
|
||||
<form method="POST" action="api/docker/backup" class="xhr">
|
||||
<form method="POST" action="api/docker/backup" 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="Create backup" onclick="return confirm('Create backup? Are you sure that you want to create a backup? This will stop all running containers and create the backup.')" />
|
||||
|
||||
Reference in New Issue
Block a user