Merge branch 'develop' into feature/vue-serverview
This commit is contained in:
commit
5ca13839cf
110 changed files with 7190 additions and 2093 deletions
|
@ -11,6 +11,7 @@ use Pterodactyl\Services\Locations\LocationDeletionService;
|
|||
use Pterodactyl\Contracts\Repository\LocationRepositoryInterface;
|
||||
use Pterodactyl\Transformers\Api\Application\LocationTransformer;
|
||||
use Pterodactyl\Http\Controllers\Api\Application\ApplicationApiController;
|
||||
use Pterodactyl\Http\Requests\Api\Application\Locations\GetLocationRequest;
|
||||
use Pterodactyl\Http\Requests\Api\Application\Locations\GetLocationsRequest;
|
||||
use Pterodactyl\Http\Requests\Api\Application\Locations\DeleteLocationRequest;
|
||||
use Pterodactyl\Http\Requests\Api\Application\Locations\UpdateLocationRequest;
|
||||
|
@ -77,7 +78,7 @@ class LocationController extends ApplicationApiController
|
|||
/**
|
||||
* Return a single location.
|
||||
*
|
||||
* @param \Pterodactyl\Http\Controllers\Api\Application\Locations\GetLocationRequest $request
|
||||
* @param \Pterodactyl\Http\Requests\Api\Application\Locations\GetLocationRequest $request
|
||||
* @return array
|
||||
*/
|
||||
public function view(GetLocationRequest $request): array
|
||||
|
|
|
@ -124,7 +124,7 @@ class NodeController extends ApplicationApiController
|
|||
*/
|
||||
public function update(UpdateNodeRequest $request): array
|
||||
{
|
||||
$node = $this->updateService->returnUpdatedModel()->handle(
|
||||
$node = $this->updateService->handle(
|
||||
$request->getModel(Node::class), $request->validated()
|
||||
);
|
||||
|
||||
|
|
0
app/Http/Controllers/Base/AccountController.php
Normal file
0
app/Http/Controllers/Base/AccountController.php
Normal file
0
app/Http/Controllers/Server/Tasks/ActionController.php
Normal file
0
app/Http/Controllers/Server/Tasks/ActionController.php
Normal file
|
@ -1,18 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* Pterodactyl - Panel
|
||||
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
||||
*
|
||||
* This software is licensed under the terms of the MIT license.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
namespace Pterodactyl\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
|
||||
class LanguageMiddleware
|
||||
{
|
||||
|
@ -21,25 +13,18 @@ class LanguageMiddleware
|
|||
*/
|
||||
private $app;
|
||||
|
||||
/**
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
private $config;
|
||||
|
||||
/**
|
||||
* LanguageMiddleware constructor.
|
||||
*
|
||||
* @param \Illuminate\Foundation\Application $app
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
* @param \Illuminate\Foundation\Application $app
|
||||
*/
|
||||
public function __construct(Application $app, Repository $config)
|
||||
public function __construct(Application $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
* Handle an incoming request and set the user's preferred language.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
|
@ -47,7 +32,7 @@ class LanguageMiddleware
|
|||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$this->app->setLocale($this->config->get('app.locale', 'en'));
|
||||
$this->app->setLocale($request->user()->language ?? config('app.locale', 'en'));
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Http\Controllers\Api\Application\Locations;
|
||||
namespace Pterodactyl\Http\Requests\Api\Application\Locations;
|
||||
|
||||
use Pterodactyl\Models\Location;
|
||||
use Pterodactyl\Http\Requests\Api\Application\Locations\GetLocationsRequest;
|
||||
|
||||
class GetLocationRequest extends GetLocationsRequest
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue