Merge branch 'develop' into feature/react-admin

This commit is contained in:
Matthew Penner 2021-03-06 15:37:03 -07:00
commit 7d80b5fee7
3 changed files with 12 additions and 2 deletions

View file

@ -15,6 +15,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
* Fixes server console resize handler to no longer encounter an exception at random that breaks the entire UI. * Fixes server console resize handler to no longer encounter an exception at random that breaks the entire UI.
* Fixes unhandled error caused by entering an invalid IP address or FQDN when creating a new node allocation. * Fixes unhandled error caused by entering an invalid IP address or FQDN when creating a new node allocation.
* Fixes unhandled error when Wings would fetch a server configuration from the Panel that uses an Egg with invalid JSON data for the configuration fields. * Fixes unhandled error when Wings would fetch a server configuration from the Panel that uses an Egg with invalid JSON data for the configuration fields.
* Fixes email not being sent to a user when their server is done installing.
### Added ### Added
* Adds support for automatically copying SFTP connection details when clicking into the text field. * Adds support for automatically copying SFTP connection details when clicking into the text field.

View file

@ -8,18 +8,22 @@ use Pterodactyl\Models\Server;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Http\Controllers\Controller;
use Pterodactyl\Repositories\Eloquent\ServerRepository; use Pterodactyl\Repositories\Eloquent\ServerRepository;
use Pterodactyl\Events\Server\Installed as ServerInstalled;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Pterodactyl\Http\Requests\Api\Remote\InstallationDataRequest; use Pterodactyl\Http\Requests\Api\Remote\InstallationDataRequest;
class ServerInstallController extends Controller class ServerInstallController extends Controller
{ {
private ServerRepository $repository; private ServerRepository $repository;
private EventDispatcher $eventDispatcher;
/** /**
* ServerInstallController constructor. * ServerInstallController constructor.
*/ */
public function __construct(ServerRepository $repository) public function __construct(ServerRepository $repository, EventDispatcher $eventDispatcher)
{ {
$this->repository = $repository; $this->repository = $repository;
$this->eventDispatcher = $eventDispatcher;
} }
/** /**
@ -56,6 +60,11 @@ class ServerInstallController extends Controller
$this->repository->update($server->id, ['status' => $status], true, true); $this->repository->update($server->id, ['status' => $status], true, true);
// If the server successfully installed, fire installed event.
if ($status === null) {
$this->eventDispatcher->dispatch(new ServerInstalled($server));
}
return new Response('', Response::HTTP_NO_CONTENT); return new Response('', Response::HTTP_NO_CONTENT);
} }
} }

View file

@ -35,7 +35,7 @@ export default () => {
{rootAdmin && {rootAdmin &&
<div css={tw`mb-2 flex justify-end items-center`}> <div css={tw`mb-2 flex justify-end items-center`}>
<p css={tw`uppercase text-xs text-neutral-400 mr-2`}> <p css={tw`uppercase text-xs text-neutral-400 mr-2`}>
{showOnlyAdmin ? 'Showing other\'s servers' : 'Showing your servers'} {showOnlyAdmin ? 'Showing others\' servers' : 'Showing your servers'}
</p> </p>
<Switch <Switch
name={'show_all_servers'} name={'show_all_servers'}