mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-22 09:02:28 +01:00
server: track reinstall failures differently from initial install failures (#4531)
This commit is contained in:
parent
039ad4abf0
commit
a4f6870518
@ -48,8 +48,18 @@ class ServerInstallController extends Controller
|
||||
public function store(InstallationDataRequest $request, string $uuid): JsonResponse
|
||||
{
|
||||
$server = $this->repository->getByUuid($uuid);
|
||||
$status = null;
|
||||
|
||||
$status = $request->boolean('successful') ? null : Server::STATUS_INSTALL_FAILED;
|
||||
// Make sure the type of failure is accurate
|
||||
if (!$request->boolean('successful')) {
|
||||
$status = Server::STATUS_INSTALL_FAILED;
|
||||
|
||||
if ($request->boolean('reinstall')) {
|
||||
$status = Server::STATUS_REINSTALL_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
// Keep the server suspended if it's already suspended
|
||||
if ($server->status === Server::STATUS_SUSPENDED) {
|
||||
$status = Server::STATUS_SUSPENDED;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ class InstallationDataRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'successful' => 'present|boolean',
|
||||
'reinstall' => 'sometimes|boolean',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -115,6 +115,7 @@ class Server extends Model
|
||||
|
||||
public const STATUS_INSTALLING = 'installing';
|
||||
public const STATUS_INSTALL_FAILED = 'install_failed';
|
||||
public const STATUS_REINSTALL_FAILED = 'reinstall_failed';
|
||||
public const STATUS_SUSPENDED = 'suspended';
|
||||
public const STATUS_RESTORING_BACKUP = 'restoring_backup';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user