Move actions into context menu, add support for deleting a backup
This commit is contained in:
parent
2eb6ab4d63
commit
9ba6aaebde
10 changed files with 344 additions and 66 deletions
|
@ -39,22 +39,19 @@ class DaemonBackupRepository extends DaemonRepository
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a stream of a backup's contents from the Wings instance so that we
|
||||
* do not need to send the user directly to the Daemon.
|
||||
* Deletes a backup from the daemon.
|
||||
*
|
||||
* @param string $backup
|
||||
* @param \Pterodactyl\Models\Backup $backup
|
||||
* @return \Psr\Http\Message\ResponseInterface
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException
|
||||
*/
|
||||
public function getBackup(string $backup): ResponseInterface
|
||||
public function delete(Backup $backup): ResponseInterface
|
||||
{
|
||||
Assert::isInstanceOf($this->server, Server::class);
|
||||
|
||||
try {
|
||||
return $this->getHttpClient()->get(
|
||||
sprintf('/api/servers/%s/backup/%s', $this->server->uuid, $backup),
|
||||
['stream' => true]
|
||||
return $this->getHttpClient()->delete(
|
||||
sprintf('/api/servers/%s/backup/%s', $this->server->uuid, $backup->uuid)
|
||||
);
|
||||
} catch (TransferException $exception) {
|
||||
throw new DaemonConnectionException($exception);
|
||||
|
|
Reference in a new issue