Add support for compressing items in the file manager
This commit is contained in:
parent
cb9eb918b2
commit
82bc9e617b
8 changed files with 137 additions and 33 deletions
|
@ -167,4 +167,28 @@ class DaemonFileRepository extends DaemonRepository
|
|||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compress the given files or folders in the given root.
|
||||
*
|
||||
* @param string|null $root
|
||||
* @param array $files
|
||||
* @return array
|
||||
*/
|
||||
public function compressFiles(?string $root, array $files): array
|
||||
{
|
||||
Assert::isInstanceOf($this->server, Server::class);
|
||||
|
||||
$response = $this->getHttpClient()->post(
|
||||
sprintf('/api/servers/%s/files/compress', $this->server->uuid),
|
||||
[
|
||||
'json' => [
|
||||
'root' => $root ?? '/',
|
||||
'files' => $files,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
return json_decode($response->getBody(), true);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue