1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-23 01:22:30 +01:00

Merge branch 'develop' of https://github.com/Pterodactyl/Panel into develop

This commit is contained in:
Dane Everitt 2017-09-22 00:30:11 -05:00
commit 68cc71ecfe
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
14 changed files with 72 additions and 53 deletions

View File

@ -30,6 +30,11 @@ use Illuminate\Contracts\Config\Repository as ConfigRepository;
class InfoCommand extends Command
{
/**
* @var string
*/
protected $description = 'Displays the application, database, and email configurations along with the panel version.';
/**
* @var \Illuminate\Contracts\Config\Repository
*/

View File

@ -35,6 +35,11 @@ class DeleteLocationCommand extends Command
*/
protected $deletionService;
/**
* @var string
*/
protected $description = 'Deletes a location from the Panel.';
/**
* @var \Illuminate\Support\Collection
*/

View File

@ -34,6 +34,11 @@ class MakeUserCommand extends Command
*/
protected $creationService;
/**
* @var string
*/
protected $description = 'Creates a user on the system via the CLI.';
/**
* @var string
*/

View File

@ -226,6 +226,13 @@ class ServersController extends Controller
*/
public function create()
{
$nodes = $this->nodeRepository->all();
if (count($nodes) < 1) {
$this->alert->warning(trans('admin/server.alerts.node_required'))->flash();
return redirect()->route('admin.nodes');
}
$services = $this->serviceRepository->getWithOptions();
Javascript::put([

View File

@ -81,6 +81,8 @@ class Server extends Model implements CleansAttributes, ValidableContract
'disk' => 'required',
'service_id' => 'required',
'option_id' => 'required',
'node_id' => 'required',
'allocation_id' => 'required',
'pack_id' => 'sometimes',
'auto_deploy' => 'sometimes',
'custom_id' => 'sometimes',

View File

@ -27,9 +27,6 @@ $(document).ready(function() {
$('#pPackId').select2({
placeholder: 'Select a Service Pack',
});
$('#pLocationId').select2({
placeholder: 'Select a Location',
}).change();
$('#pNodeId').select2({
placeholder: 'Select a Node',
});
@ -100,29 +97,9 @@ $(document).on('click', function (event) {
lastActiveBox.addClass('box-primary');
});
var currentLocation = null;
var curentNode = null;
var NodeData = [];
$('#pLocationId').on('change', function (event) {
showLoader();
currentLocation = $(this).val();
currentNode = null;
$.ajax({
method: 'POST',
url: Router.route('admin.servers.new.nodes'),
headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') },
data: { location: currentLocation },
}).done(function (data) {
NodeData = data;
$('#pNodeId').html('').select2({data: data}).change();
}).fail(function (jqXHR) {
cosole.error(jqXHR);
currentLocation = null;
}).always(hideLoader);
});
$('#pNodeId').on('change', function (event) {
currentNode = $(this).val();
$.each(NodeData, function (i, v) {

View File

@ -41,5 +41,6 @@ return [
'server_reinstalled' => 'This server has been queued for a reinstallation beginning now.',
'details_updated' => 'Server details have been successfully updated.',
'docker_image_updated' => 'Successfully changed the default Docker image to use for this server. A reboot is required to apply this change.',
'node_required' => 'You must have at least one node configured before you can add a server to this panel.',
],
];

View File

@ -3,7 +3,7 @@
return [
'not_authorized' => 'You are not authorized to perform this action.',
'auth_error' => 'There was an error while attempting to login.',
'authentication_required' => 'Authentication is required in order to continue.',
'authentication_required' => 'Authentication is required to continue.',
'remember_me' => 'Remember Me',
'sign_in' => 'Sign In',
'forgot_password' => 'I\'ve forgotten my password!',

View File

@ -78,21 +78,20 @@
</div>
<div class="box-body row">
<div class="form-group col-sm-4">
<label for="pLocationId">Location</label>
<select name="location_id" id="pLocationId" class="form-control">
<label for="pNodeId">Node</label>
<select name="node_id" id="pNodeId" class="form-control">
@foreach($locations as $location)
<option value="{{ $location->id }}"
@if($location->id === old('location_id'))
selected
@endif
>{{ $location->long }} ({{ $location->short }})</option>
<optgroup label="{{ $location->long }} ({{ $location->short }})">
@foreach($location->nodes as $node)
<option value="{{ $node->id }}"
@if($location->id === old('location_id')) selected @endif
>{{ $node->name }}</option>
@endforeach
</optgroup>
@endforeach
</select>
<p class="small text-muted no-margin">The location in which this server will be deployed.</p>
</div>
<div class="form-group col-sm-4">
<label for="pNodeId">Node</label>
<select name="node_id" id="pNodeId" class="form-control"></select>
<p class="small text-muted no-margin">The node which this server will be deployed to.</p>
</div>
<div class="form-group col-sm-4">
@ -100,7 +99,7 @@
<select name="allocation_id" id="pAllocation" class="form-control"></select>
<p class="small text-muted no-margin">The main allocation that will be assigned to this server.</p>
</div>
<div class="form-group col-sm-12">
<div class="form-group col-sm-4">
<label for="pAllocationAdditional">Additional Allocation(s)</label>
<select name="allocation_additional[]" id="pAllocationAdditional" class="form-control" multiple></select>
<p class="small text-muted no-margin">Additional allocations to assign to this server on creation.</p>

View File

@ -82,8 +82,8 @@
<label for="root_admin" class="control-label">Administrator</label>
<div>
<select name="root_admin" class="form-control">
<option value="0">{{ trans('strings.no') }}</option>
<option value="1">{{ trans('strings.yes') }}</option>
<option value="0">@lang('strings.no')</option>
<option value="1">@lang('strings.yes')</option>
</select>
<p class="text-muted"><small>Setting this to 'Yes' gives a user full administrative access.</small></p>
</div>

View File

@ -99,8 +99,8 @@
<label for="root_admin" class="control-label">Administrator</label>
<div>
<select name="root_admin" class="form-control">
<option value="0">{{ trans('strings.no') }}</option>
<option value="1" {{ $user->root_admin ? 'selected="selected"' : '' }}>{{ trans('strings.yes') }}</option>
<option value="0">@lang('strings.no')</option>
<option value="1" {{ $user->root_admin ? 'selected="selected"' : '' }}>@lang('strings.yes')</option>
</select>
<p class="text-muted"><small>Setting this to 'Yes' gives a user full administrative access.</small></p>
</div>

View File

@ -79,7 +79,7 @@
<li><a href="{{ route('index') }}" data-toggle="tooltip" data-placement="bottom" title="Exit Admin Control"><i class="fa fa-server"></i></a></li>
</li>
<li>
<li><a href="{{ route('auth.logout') }}" id="logoutButton" data-toggle="tooltip" data-placement="bottom" title="Logout"><i class="fa fa-power-off"></i></a></li>
<li><a href="{{ route('auth.logout') }}" id="logoutButton" data-toggle="tooltip" data-placement="bottom" title="Logout"><i class="fa fa-sign-out"></i></a></li>
</li>
</ul>
</div>
@ -196,9 +196,18 @@
<script>
$('#logoutButton').on('click', function (event) {
event.preventDefault();
if (confirm('Are you sure you want to logout?')) {
window.location = $(this).attr('href');
}
var that = this;
swal({
title: 'Do you want to log out?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#d9534f',
cancelButtonColor: '#d33',
confirmButtonText: 'Log out'
}, function () {
window.location = $(that).attr('href');
});
});
</script>
@endif

View File

@ -75,15 +75,15 @@
</a>
</li>
{{--<li>--}}
{{--<a href="#" data-action="control-sidebar" data-toggle="tooltip" data-placement="bottom" title="{{ @trans('strings.servers') }}"><i class="fa fa-server"></i></a>--}}
{{--<a href="#" data-action="control-sidebar" data-toggle="tooltip" data-placement="bottom" title="@lang('strings.servers')"><i class="fa fa-server"></i></a>--}}
{{--</li>--}}
@if(Auth::user()->root_admin)
<li>
<li><a href="{{ route('admin.index') }}" data-toggle="tooltip" data-placement="bottom" title="{{ @trans('strings.admin_cp') }}"><i class="fa fa-gears"></i></a></li>
<li><a href="{{ route('admin.index') }}" data-toggle="tooltip" data-placement="bottom" title="@lang('strings.admin_cp')"><i class="fa fa-gears"></i></a></li>
</li>
@endif
<li>
<li><a href="{{ route('auth.logout') }}" id="logoutButton" data-toggle="tooltip" data-placement="bottom" title="{{ @trans('strings.logout') }}"><i class="fa fa-power-off"></i></a></li>
<li><a href="{{ route('auth.logout') }}" id="logoutButton" data-toggle="tooltip" data-placement="bottom" title="@lang('strings.logout')"><i class="fa fa-sign-out"></i></a></li>
</li>
</ul>
</div>
@ -289,9 +289,18 @@
<script>
$('#logoutButton').on('click', function (event) {
event.preventDefault();
if (confirm('Are you sure you want to logout?')) {
window.location = $(this).attr('href');
}
var that = this;
swal({
title: 'Do you want to log out?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#d9534f',
cancelButtonColor: '#d33',
confirmButtonText: 'Log out'
}, function () {
window.location = $(that).attr('href');
});
});
</script>
@endif

View File

@ -40,7 +40,7 @@
<div class="box-header with-border">
<h3 class="box-title">{{ $file }}</h3>
<div class="pull-right box-tools">
<a href="/server/{{ $server->uuidShort }}/files#{{ rawurlencode($directory) }}" class="pull-right"><button class="btn btn-default btn-sm">{{ trans('server.files.edit.return') }}</button></a>
<a href="/server/{{ $server->uuidShort }}/files#{{ rawurlencode($directory) }}" class="pull-right"><button class="btn btn-default btn-sm">@lang('server.files.edit.return')</button></a>
</div>
</div>
<input type="hidden" name="file" value="{{ $file }}" />
@ -49,7 +49,7 @@
<div class="box-body" style="height:500px;" id="editor"></div>
<div class="box-footer with-border">
<button class="btn btn-sm btn-primary" id="save_file"><i class="fa fa-fw fa-save"></i> &nbsp;@lang('server.files.edit.save')</button>
<a href="/server/{{ $server->uuidShort }}/files#{{ rawurlencode($directory) }}" class="pull-right"><button class="btn btn-default btn-sm">{{ trans('server.files.edit.return') }}</button></a>
<a href="/server/{{ $server->uuidShort }}/files#{{ rawurlencode($directory) }}" class="pull-right"><button class="btn btn-default btn-sm">@lang('server.files.edit.return')</button></a>
</div>
</div>
</div>