Merge branch 'develop' of https://github.com/Pterodactyl/Panel into develop
This commit is contained in:
commit
68cc71ecfe
|
@ -30,6 +30,11 @@ use Illuminate\Contracts\Config\Repository as ConfigRepository;
|
||||||
|
|
||||||
class InfoCommand extends Command
|
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
|
* @var \Illuminate\Contracts\Config\Repository
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,6 +35,11 @@ class DeleteLocationCommand extends Command
|
||||||
*/
|
*/
|
||||||
protected $deletionService;
|
protected $deletionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Deletes a location from the Panel.';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Illuminate\Support\Collection
|
* @var \Illuminate\Support\Collection
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -34,6 +34,11 @@ class MakeUserCommand extends Command
|
||||||
*/
|
*/
|
||||||
protected $creationService;
|
protected $creationService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Creates a user on the system via the CLI.';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -226,6 +226,13 @@ class ServersController extends Controller
|
||||||
*/
|
*/
|
||||||
public function create()
|
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();
|
$services = $this->serviceRepository->getWithOptions();
|
||||||
|
|
||||||
Javascript::put([
|
Javascript::put([
|
||||||
|
|
|
@ -81,6 +81,8 @@ class Server extends Model implements CleansAttributes, ValidableContract
|
||||||
'disk' => 'required',
|
'disk' => 'required',
|
||||||
'service_id' => 'required',
|
'service_id' => 'required',
|
||||||
'option_id' => 'required',
|
'option_id' => 'required',
|
||||||
|
'node_id' => 'required',
|
||||||
|
'allocation_id' => 'required',
|
||||||
'pack_id' => 'sometimes',
|
'pack_id' => 'sometimes',
|
||||||
'auto_deploy' => 'sometimes',
|
'auto_deploy' => 'sometimes',
|
||||||
'custom_id' => 'sometimes',
|
'custom_id' => 'sometimes',
|
||||||
|
|
|
@ -27,9 +27,6 @@ $(document).ready(function() {
|
||||||
$('#pPackId').select2({
|
$('#pPackId').select2({
|
||||||
placeholder: 'Select a Service Pack',
|
placeholder: 'Select a Service Pack',
|
||||||
});
|
});
|
||||||
$('#pLocationId').select2({
|
|
||||||
placeholder: 'Select a Location',
|
|
||||||
}).change();
|
|
||||||
$('#pNodeId').select2({
|
$('#pNodeId').select2({
|
||||||
placeholder: 'Select a Node',
|
placeholder: 'Select a Node',
|
||||||
});
|
});
|
||||||
|
@ -100,29 +97,9 @@ $(document).on('click', function (event) {
|
||||||
lastActiveBox.addClass('box-primary');
|
lastActiveBox.addClass('box-primary');
|
||||||
});
|
});
|
||||||
|
|
||||||
var currentLocation = null;
|
|
||||||
var curentNode = null;
|
var curentNode = null;
|
||||||
var NodeData = [];
|
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) {
|
$('#pNodeId').on('change', function (event) {
|
||||||
currentNode = $(this).val();
|
currentNode = $(this).val();
|
||||||
$.each(NodeData, function (i, v) {
|
$.each(NodeData, function (i, v) {
|
||||||
|
|
|
@ -41,5 +41,6 @@ return [
|
||||||
'server_reinstalled' => 'This server has been queued for a reinstallation beginning now.',
|
'server_reinstalled' => 'This server has been queued for a reinstallation beginning now.',
|
||||||
'details_updated' => 'Server details have been successfully updated.',
|
'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.',
|
'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.',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
return [
|
return [
|
||||||
'not_authorized' => 'You are not authorized to perform this action.',
|
'not_authorized' => 'You are not authorized to perform this action.',
|
||||||
'auth_error' => 'There was an error while attempting to login.',
|
'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',
|
'remember_me' => 'Remember Me',
|
||||||
'sign_in' => 'Sign In',
|
'sign_in' => 'Sign In',
|
||||||
'forgot_password' => 'I\'ve forgotten my password!',
|
'forgot_password' => 'I\'ve forgotten my password!',
|
||||||
|
|
|
@ -78,21 +78,20 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body row">
|
<div class="box-body row">
|
||||||
<div class="form-group col-sm-4">
|
<div class="form-group col-sm-4">
|
||||||
<label for="pLocationId">Location</label>
|
<label for="pNodeId">Node</label>
|
||||||
<select name="location_id" id="pLocationId" class="form-control">
|
<select name="node_id" id="pNodeId" class="form-control">
|
||||||
@foreach($locations as $location)
|
@foreach($locations as $location)
|
||||||
<option value="{{ $location->id }}"
|
<optgroup label="{{ $location->long }} ({{ $location->short }})">
|
||||||
@if($location->id === old('location_id'))
|
@foreach($location->nodes as $node)
|
||||||
selected
|
|
||||||
@endif
|
<option value="{{ $node->id }}"
|
||||||
>{{ $location->long }} ({{ $location->short }})</option>
|
@if($location->id === old('location_id')) selected @endif
|
||||||
|
>{{ $node->name }}</option>
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
</optgroup>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</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>
|
<p class="small text-muted no-margin">The node which this server will be deployed to.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-sm-4">
|
<div class="form-group col-sm-4">
|
||||||
|
@ -100,7 +99,7 @@
|
||||||
<select name="allocation_id" id="pAllocation" class="form-control"></select>
|
<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>
|
<p class="small text-muted no-margin">The main allocation that will be assigned to this server.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-sm-12">
|
<div class="form-group col-sm-4">
|
||||||
<label for="pAllocationAdditional">Additional Allocation(s)</label>
|
<label for="pAllocationAdditional">Additional Allocation(s)</label>
|
||||||
<select name="allocation_additional[]" id="pAllocationAdditional" class="form-control" multiple></select>
|
<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>
|
<p class="small text-muted no-margin">Additional allocations to assign to this server on creation.</p>
|
||||||
|
|
|
@ -82,8 +82,8 @@
|
||||||
<label for="root_admin" class="control-label">Administrator</label>
|
<label for="root_admin" class="control-label">Administrator</label>
|
||||||
<div>
|
<div>
|
||||||
<select name="root_admin" class="form-control">
|
<select name="root_admin" class="form-control">
|
||||||
<option value="0">{{ trans('strings.no') }}</option>
|
<option value="0">@lang('strings.no')</option>
|
||||||
<option value="1">{{ trans('strings.yes') }}</option>
|
<option value="1">@lang('strings.yes')</option>
|
||||||
</select>
|
</select>
|
||||||
<p class="text-muted"><small>Setting this to 'Yes' gives a user full administrative access.</small></p>
|
<p class="text-muted"><small>Setting this to 'Yes' gives a user full administrative access.</small></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -99,8 +99,8 @@
|
||||||
<label for="root_admin" class="control-label">Administrator</label>
|
<label for="root_admin" class="control-label">Administrator</label>
|
||||||
<div>
|
<div>
|
||||||
<select name="root_admin" class="form-control">
|
<select name="root_admin" class="form-control">
|
||||||
<option value="0">{{ trans('strings.no') }}</option>
|
<option value="0">@lang('strings.no')</option>
|
||||||
<option value="1" {{ $user->root_admin ? 'selected="selected"' : '' }}>{{ trans('strings.yes') }}</option>
|
<option value="1" {{ $user->root_admin ? 'selected="selected"' : '' }}>@lang('strings.yes')</option>
|
||||||
</select>
|
</select>
|
||||||
<p class="text-muted"><small>Setting this to 'Yes' gives a user full administrative access.</small></p>
|
<p class="text-muted"><small>Setting this to 'Yes' gives a user full administrative access.</small></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -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><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>
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -196,9 +196,18 @@
|
||||||
<script>
|
<script>
|
||||||
$('#logoutButton').on('click', function (event) {
|
$('#logoutButton').on('click', function (event) {
|
||||||
event.preventDefault();
|
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>
|
</script>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
@ -75,15 +75,15 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{{--<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>--}}
|
{{--</li>--}}
|
||||||
@if(Auth::user()->root_admin)
|
@if(Auth::user()->root_admin)
|
||||||
<li>
|
<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>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
<li>
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -289,9 +289,18 @@
|
||||||
<script>
|
<script>
|
||||||
$('#logoutButton').on('click', function (event) {
|
$('#logoutButton').on('click', function (event) {
|
||||||
event.preventDefault();
|
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>
|
</script>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">{{ $file }}</h3>
|
<h3 class="box-title">{{ $file }}</h3>
|
||||||
<div class="pull-right box-tools">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="file" value="{{ $file }}" />
|
<input type="hidden" name="file" value="{{ $file }}" />
|
||||||
|
@ -49,7 +49,7 @@
|
||||||
<div class="box-body" style="height:500px;" id="editor"></div>
|
<div class="box-body" style="height:500px;" id="editor"></div>
|
||||||
<div class="box-footer with-border">
|
<div class="box-footer with-border">
|
||||||
<button class="btn btn-sm btn-primary" id="save_file"><i class="fa fa-fw fa-save"></i> @lang('server.files.edit.save')</button>
|
<button class="btn btn-sm btn-primary" id="save_file"><i class="fa fa-fw fa-save"></i> @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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue