Removed loggin and reverted changes to webpack
This commit is contained in:
parent
0017ab5397
commit
4770af453b
2 changed files with 2 additions and 8 deletions
|
@ -136,14 +136,10 @@ class NetworkAllocationController extends ClientApiController
|
||||||
*/
|
*/
|
||||||
public function addNew(NewAllocationRequest $request, Server $server): array
|
public function addNew(NewAllocationRequest $request, Server $server): array
|
||||||
{
|
{
|
||||||
Log::info('addNew()');
|
|
||||||
$topRange = config('pterodactyl.allocation.stop',0);
|
$topRange = config('pterodactyl.allocation.stop',0);
|
||||||
$bottomRange = config('pterodactyl.allocation.start',0);
|
$bottomRange = config('pterodactyl.allocation.start',0);
|
||||||
Log::error($bottomRange);
|
|
||||||
Log::error($topRange);
|
|
||||||
|
|
||||||
if($server->allocation_limit <= $server->allocations->count()) {
|
if($server->allocation_limit <= $server->allocations->count()) {
|
||||||
Log::error('You have created the maximum number of allocations!');
|
|
||||||
throw new DisplayException(
|
throw new DisplayException(
|
||||||
'You have created the maximum number of allocations!'
|
'You have created the maximum number of allocations!'
|
||||||
);
|
);
|
||||||
|
@ -153,17 +149,15 @@ class NetworkAllocationController extends ClientApiController
|
||||||
|
|
||||||
if(!$allocation) {
|
if(!$allocation) {
|
||||||
if($server->node->allocations()->where('ip',$server->allocation->ip)->where([['port', '>=', $bottomRange ], ['port', '<=', $topRange],])->count() >= $topRange-$bottomRange+1 || !config('allocation.enabled', false)) {
|
if($server->node->allocations()->where('ip',$server->allocation->ip)->where([['port', '>=', $bottomRange ], ['port', '<=', $topRange],])->count() >= $topRange-$bottomRange+1 || !config('allocation.enabled', false)) {
|
||||||
Log::error('No allocations available!');
|
|
||||||
throw new DisplayException(
|
throw new DisplayException(
|
||||||
'No more allocations available!'
|
'No more allocations available!'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Log::info('Creating new allocation...');
|
|
||||||
$allPorts = $server->node->allocations()->select(['port'])->where('ip',$server->allocation->ip)->get()->pluck('port')->toArray();
|
$allPorts = $server->node->allocations()->select(['port'])->where('ip',$server->allocation->ip)->get()->pluck('port')->toArray();
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$port = rand($bottomRange, $topRange);
|
$port = rand($bottomRange, $topRange);
|
||||||
Log::info('Picking port....');
|
|
||||||
} while(array_search($port, $allPorts));
|
} while(array_search($port, $allPorts));
|
||||||
|
|
||||||
$this->assignmentService->handle($server->node,[
|
$this->assignmentService->handle($server->node,[
|
||||||
|
|
|
@ -112,7 +112,7 @@ module.exports = {
|
||||||
contentBase: path.join(__dirname, '/public'),
|
contentBase: path.join(__dirname, '/public'),
|
||||||
publicPath: (process.env.PUBLIC_PATH || '') + '/assets/',
|
publicPath: (process.env.PUBLIC_PATH || '') + '/assets/',
|
||||||
allowedHosts: [
|
allowedHosts: [
|
||||||
'pterodactyl.test',
|
'.pterodactyl.test',
|
||||||
],
|
],
|
||||||
headers: {
|
headers: {
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*',
|
||||||
|
|
Loading…
Reference in a new issue