Skip to content

Commit 68cc71e

Browse files
committed
Merge branch 'develop' of https://github.com/Pterodactyl/Panel into develop
2 parents 6e5b0b8 + 0f07d6b commit 68cc71e

File tree

14 files changed

+72
-53
lines changed

14 files changed

+72
-53
lines changed

app/Console/Commands/InfoCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030

3131
class InfoCommand extends Command
3232
{
33+
/**
34+
* @var string
35+
*/
36+
protected $description = 'Displays the application, database, and email configurations along with the panel version.';
37+
3338
/**
3439
* @var \Illuminate\Contracts\Config\Repository
3540
*/

app/Console/Commands/Location/DeleteLocationCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ class DeleteLocationCommand extends Command
3535
*/
3636
protected $deletionService;
3737

38+
/**
39+
* @var string
40+
*/
41+
protected $description = 'Deletes a location from the Panel.';
42+
3843
/**
3944
* @var \Illuminate\Support\Collection
4045
*/

app/Console/Commands/User/MakeUserCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ class MakeUserCommand extends Command
3434
*/
3535
protected $creationService;
3636

37+
/**
38+
* @var string
39+
*/
40+
protected $description = 'Creates a user on the system via the CLI.';
41+
3742
/**
3843
* @var string
3944
*/

app/Http/Controllers/Admin/ServersController.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,13 @@ public function index()
226226
*/
227227
public function create()
228228
{
229+
$nodes = $this->nodeRepository->all();
230+
if (count($nodes) < 1) {
231+
$this->alert->warning(trans('admin/server.alerts.node_required'))->flash();
232+
233+
return redirect()->route('admin.nodes');
234+
}
235+
229236
$services = $this->serviceRepository->getWithOptions();
230237

231238
Javascript::put([

app/Models/Server.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ class Server extends Model implements CleansAttributes, ValidableContract
8181
'disk' => 'required',
8282
'service_id' => 'required',
8383
'option_id' => 'required',
84+
'node_id' => 'required',
85+
'allocation_id' => 'required',
8486
'pack_id' => 'sometimes',
8587
'auto_deploy' => 'sometimes',
8688
'custom_id' => 'sometimes',

public/themes/pterodactyl/js/admin/new-server.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ $(document).ready(function() {
2727
$('#pPackId').select2({
2828
placeholder: 'Select a Service Pack',
2929
});
30-
$('#pLocationId').select2({
31-
placeholder: 'Select a Location',
32-
}).change();
3330
$('#pNodeId').select2({
3431
placeholder: 'Select a Node',
3532
});
@@ -100,29 +97,9 @@ $(document).on('click', function (event) {
10097
lastActiveBox.addClass('box-primary');
10198
});
10299

103-
var currentLocation = null;
104100
var curentNode = null;
105101
var NodeData = [];
106102

107-
$('#pLocationId').on('change', function (event) {
108-
showLoader();
109-
currentLocation = $(this).val();
110-
currentNode = null;
111-
112-
$.ajax({
113-
method: 'POST',
114-
url: Router.route('admin.servers.new.nodes'),
115-
headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') },
116-
data: { location: currentLocation },
117-
}).done(function (data) {
118-
NodeData = data;
119-
$('#pNodeId').html('').select2({data: data}).change();
120-
}).fail(function (jqXHR) {
121-
cosole.error(jqXHR);
122-
currentLocation = null;
123-
}).always(hideLoader);
124-
});
125-
126103
$('#pNodeId').on('change', function (event) {
127104
currentNode = $(this).val();
128105
$.each(NodeData, function (i, v) {

resources/lang/en/admin/server.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@
4141
'server_reinstalled' => 'This server has been queued for a reinstallation beginning now.',
4242
'details_updated' => 'Server details have been successfully updated.',
4343
'docker_image_updated' => 'Successfully changed the default Docker image to use for this server. A reboot is required to apply this change.',
44+
'node_required' => 'You must have at least one node configured before you can add a server to this panel.',
4445
],
4546
];

resources/lang/en/auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
return [
44
'not_authorized' => 'You are not authorized to perform this action.',
55
'auth_error' => 'There was an error while attempting to login.',
6-
'authentication_required' => 'Authentication is required in order to continue.',
6+
'authentication_required' => 'Authentication is required to continue.',
77
'remember_me' => 'Remember Me',
88
'sign_in' => 'Sign In',
99
'forgot_password' => 'I\'ve forgotten my password!',

resources/themes/pterodactyl/admin/servers/new.blade.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,29 +78,28 @@
7878
</div>
7979
<div class="box-body row">
8080
<div class="form-group col-sm-4">
81-
<label for="pLocationId">Location</label>
82-
<select name="location_id" id="pLocationId" class="form-control">
81+
<label for="pNodeId">Node</label>
82+
<select name="node_id" id="pNodeId" class="form-control">
8383
@foreach($locations as $location)
84-
<option value="{{ $location->id }}"
85-
@if($location->id === old('location_id'))
86-
selected
87-
@endif
88-
>{{ $location->long }} ({{ $location->short }})</option>
84+
<optgroup label="{{ $location->long }} ({{ $location->short }})">
85+
@foreach($location->nodes as $node)
86+
87+
<option value="{{ $node->id }}"
88+
@if($location->id === old('location_id')) selected @endif
89+
>{{ $node->name }}</option>
90+
91+
@endforeach
92+
</optgroup>
8993
@endforeach
9094
</select>
91-
<p class="small text-muted no-margin">The location in which this server will be deployed.</p>
92-
</div>
93-
<div class="form-group col-sm-4">
94-
<label for="pNodeId">Node</label>
95-
<select name="node_id" id="pNodeId" class="form-control"></select>
9695
<p class="small text-muted no-margin">The node which this server will be deployed to.</p>
9796
</div>
9897
<div class="form-group col-sm-4">
9998
<label for="pAllocation">Default Allocation</label>
10099
<select name="allocation_id" id="pAllocation" class="form-control"></select>
101100
<p class="small text-muted no-margin">The main allocation that will be assigned to this server.</p>
102101
</div>
103-
<div class="form-group col-sm-12">
102+
<div class="form-group col-sm-4">
104103
<label for="pAllocationAdditional">Additional Allocation(s)</label>
105104
<select name="allocation_additional[]" id="pAllocationAdditional" class="form-control" multiple></select>
106105
<p class="small text-muted no-margin">Additional allocations to assign to this server on creation.</p>

resources/themes/pterodactyl/admin/users/new.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
<label for="root_admin" class="control-label">Administrator</label>
8383
<div>
8484
<select name="root_admin" class="form-control">
85-
<option value="0">{{ trans('strings.no') }}</option>
86-
<option value="1">{{ trans('strings.yes') }}</option>
85+
<option value="0">@lang('strings.no')</option>
86+
<option value="1">@lang('strings.yes')</option>
8787
</select>
8888
<p class="text-muted"><small>Setting this to 'Yes' gives a user full administrative access.</small></p>
8989
</div>

0 commit comments

Comments
 (0)