mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-17 05:43:45 +02:00
Add support for compressing items in the file manager
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user