Merge branch 'develop' into feature/react-admin
This commit is contained in:
commit
a87fef37ec
77 changed files with 1082 additions and 839 deletions
|
@ -168,14 +168,6 @@ class ServerRepository extends EloquentRepository implements ServerRepositoryInt
|
|||
return !$this->getBuilder()->where('uuid', '=', $uuid)->orWhere('uuidShort', '=', $short)->exists();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount of servers that are suspended.
|
||||
*/
|
||||
public function getSuspendedServersCount(): int
|
||||
{
|
||||
return $this->getBuilder()->where('suspended', true)->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all of the servers that exist for a given node in a paginated response.
|
||||
*/
|
||||
|
|
|
@ -53,6 +53,31 @@ class DaemonBackupRepository extends DaemonRepository
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a request to Wings to begin restoring a backup for a server.
|
||||
*
|
||||
* @throws \Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException
|
||||
*/
|
||||
public function restore(Backup $backup, string $url = null, bool $truncate = false): ResponseInterface
|
||||
{
|
||||
Assert::isInstanceOf($this->server, Server::class);
|
||||
|
||||
try {
|
||||
return $this->getHttpClient()->post(
|
||||
sprintf('/api/servers/%s/backup/%s/restore', $this->server->uuid, $backup->uuid),
|
||||
[
|
||||
'json' => [
|
||||
'adapter' => $backup->disk,
|
||||
'truncate_directory' => $truncate,
|
||||
'download_url' => $url ?? '',
|
||||
],
|
||||
]
|
||||
);
|
||||
} catch (TransferException $exception) {
|
||||
throw new DaemonConnectionException($exception);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a backup from the daemon.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue