forked from Nookure/NookTheme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/vue-serverview
- Loading branch information
Showing
110 changed files
with
7,019 additions
and
1,922 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
[![Logo Image](https://cdn.pterodactyl.io/logos/Banner%20Logo%[email protected])](https://pterodactyl.io) | ||
|
||
[![Build Status](https://travis-ci.org/pterodactyl/panel.svg?branch=develop)](https://travis-ci.org/pterodactyl/panel) [![StyleCI](https://styleci.io/repos/47508644/shield?branch=develop)](https://styleci.io/repos/47508644) [![codecov](https://codecov.io/gh/pterodactyl/panel/branch/develop/graph/badge.svg)](https://codecov.io/gh/Pterodactyl/Panel) | ||
[![Build status](https://img.shields.io/travis/pterodactyl/panel/develop.svg?style=flat-square)](https://travis-ci.org/pterodactyl/panel) | ||
[![StyleCI](https://styleci.io/repos/47508644/shield?branch=develop)](https://styleci.io/repos/47508644) | ||
[![Codecov](https://img.shields.io/codecov/c/github/pterodactyl/panel/develop.svg?style=flat-square)](https://codecov.io/gh/Pterodactyl/Panel) | ||
[![Discord](https://img.shields.io/discord/122900397965705216.svg?style=flat-square&label=Discord)](https://pterodactyl.io/discord) | ||
|
||
# Pterodactyl Panel | ||
|
||
Pterodactyl is the open-source game server management panel built with PHP7, Nodejs, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to administrators and users. | ||
What more are you waiting for? Make game servers a first class citizen on your platform today. | ||
|
||
![Image](https://cdn.pterodactyl.io/site-assets/mockup-macbook-grey.png) | ||
|
||
## Support & Documentation | ||
Support for using Pterodactyl can be found on our [Documentation Website](https://docs.pterodactyl.io), [Guides Website](https://guides.pterodactyl.io), or via our [Discord Chat](https://discord.gg/QRDZvVm). | ||
Support for using Pterodactyl can be found on our [Documentation Website](https://pterodactyl.io/project/introduction.html), [Guides Website](https://guides.pterodactyl.io), or via our [Discord Chat](https://discord.gg/QRDZvVm). | ||
|
||
### Supported Games | ||
We support a huge variety of games by utilizing Docker containers to isolate each instance, giving you the power to host your games across the world without having to bloat each physical machine with additional dependencies. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,10 @@ | ||
<?php | ||
/** | ||
* Pterodactyl - Panel | ||
* Copyright (c) 2015 - 2017 Dane Everitt <[email protected]>. | ||
* | ||
* 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,33 +13,26 @@ 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 | ||
* @return mixed | ||
*/ | ||
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); | ||
} | ||
|
3 changes: 1 addition & 2 deletions
3
app/Http/Requests/Api/Application/Locations/GetLocationRequest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,18 @@ | ||
<?php | ||
/** | ||
* Pterodactyl - Panel | ||
* Copyright (c) 2015 - 2017 Dane Everitt <[email protected]>. | ||
* | ||
* This software is licensed under the terms of the MIT license. | ||
* https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
namespace Pterodactyl\Services\Nodes; | ||
|
||
use Pterodactyl\Models\Node; | ||
use GuzzleHttp\Exception\ConnectException; | ||
use GuzzleHttp\Exception\RequestException; | ||
use Illuminate\Database\ConnectionInterface; | ||
use Pterodactyl\Traits\Services\ReturnsUpdatedModels; | ||
use Pterodactyl\Contracts\Repository\NodeRepositoryInterface; | ||
use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException; | ||
use Pterodactyl\Exceptions\Service\Node\ConfigurationNotPersistedException; | ||
use Pterodactyl\Contracts\Repository\Daemon\ConfigurationRepositoryInterface; | ||
|
||
class NodeUpdateService | ||
{ | ||
use ReturnsUpdatedModels; | ||
|
||
/** | ||
* @var \Illuminate\Database\ConnectionInterface | ||
*/ | ||
|
@@ -60,7 +50,7 @@ public function __construct( | |
* | ||
* @param \Pterodactyl\Models\Node $node | ||
* @param array $data | ||
* @return \Pterodactyl\Models\Node|mixed | ||
* @return \Pterodactyl\Models\Node | ||
* | ||
* @throws \Pterodactyl\Exceptions\DisplayException | ||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException | ||
|
@@ -74,14 +64,10 @@ public function handle(Node $node, array $data) | |
} | ||
|
||
$this->connection->beginTransaction(); | ||
if ($this->getUpdatedModel()) { | ||
$response = $this->repository->update($node->id, $data); | ||
} else { | ||
$response = $this->repository->withoutFreshModel()->update($node->id, $data); | ||
} | ||
$updatedModel = $this->repository->update($node->id, $data); | ||
|
||
try { | ||
$this->configRepository->setNode($node)->update(); | ||
$this->configRepository->setNode($updatedModel)->update(); | ||
$this->connection->commit(); | ||
} catch (RequestException $exception) { | ||
// Failed to connect to the Daemon. Let's go ahead and save the configuration | ||
|
@@ -95,6 +81,6 @@ public function handle(Node $node, array $data) | |
throw new DaemonConnectionException($exception); | ||
} | ||
|
||
return $response; | ||
return $updatedModel; | ||
} | ||
} |
Oops, something went wrong.