2017-09-26 02:43:01 +00:00
|
|
|
{{-- Pterodactyl - Panel --}}
|
2017-01-24 22:57:08 +00:00
|
|
|
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
|
2017-01-19 01:45:10 +00:00
|
|
|
|
2017-09-26 02:43:01 +00:00
|
|
|
{{-- This software is licensed under the terms of the MIT license. --}}
|
|
|
|
{{-- https://opensource.org/licenses/MIT --}}
|
2017-01-19 01:45:10 +00:00
|
|
|
@extends('layouts.master')
|
|
|
|
|
|
|
|
@section('title')
|
|
|
|
@lang('server.config.allocation.header')
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content-header')
|
|
|
|
<h1>@lang('server.config.allocation.header')<small>@lang('server.config.allocation.header_sub')</small></h1>
|
|
|
|
<ol class="breadcrumb">
|
|
|
|
<li><a href="{{ route('index') }}">@lang('strings.home')</a></li>
|
|
|
|
<li><a href="{{ route('server.index', $server->uuidShort) }}">{{ $server->name }}</a></li>
|
|
|
|
<li>@lang('navigation.server.configuration')</li>
|
|
|
|
<li class="active">@lang('navigation.server.port_allocations')</li>
|
|
|
|
</ol>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box-header with-border">
|
|
|
|
<h3 class="box-title">@lang('server.config.allocation.available')</h3>
|
|
|
|
</div>
|
|
|
|
<div class="box-body table-responsive no-padding">
|
|
|
|
<table class="table table-hover">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<th>@lang('strings.ip')</th>
|
|
|
|
<th>@lang('strings.alias')</th>
|
|
|
|
<th>@lang('strings.port')</th>
|
|
|
|
<th></th>
|
|
|
|
</tr>
|
2017-10-21 02:32:57 +00:00
|
|
|
@foreach ($allocations as $allocation)
|
2017-01-19 01:45:10 +00:00
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<code>{{ $allocation->ip }}</code>
|
|
|
|
</td>
|
|
|
|
<td class="middle">
|
|
|
|
@if(is_null($allocation->ip_alias))
|
|
|
|
<span class="label label-default">@lang('strings.none')</span>
|
|
|
|
@else
|
|
|
|
<code>{{ $allocation->ip_alias }}</code>
|
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
<td><code>{{ $allocation->port }}</code></td>
|
|
|
|
<td class="col-xs-2 middle">
|
2017-02-02 23:21:36 +00:00
|
|
|
@if($allocation->id === $server->allocation_id)
|
2017-10-21 02:32:57 +00:00
|
|
|
<a class="btn btn-xs btn-success disabled" data-action="set-default" data-allocation="{{ $allocation->hashid }}" role="button">@lang('strings.primary')</a>
|
2017-01-19 01:45:10 +00:00
|
|
|
@else
|
2017-10-21 02:32:57 +00:00
|
|
|
<a class="btn btn-xs btn-default" data-action="set-default" data-allocation="{{ $allocation->hashid }}" role="button">@lang('strings.make_primary')</a>
|
2017-01-19 01:45:10 +00:00
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2017-10-21 02:32:57 +00:00
|
|
|
<div id="toggleActivityOverlay" class="overlay hidden">
|
|
|
|
<i class="fa fa-refresh fa-spin"></i>
|
|
|
|
</div>
|
2017-01-19 01:45:10 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-4">
|
|
|
|
<div class="box">
|
|
|
|
<div class="box-header with-border">
|
|
|
|
<h3 class="box-title">@lang('server.config.allocation.help')</h3>
|
|
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
|
|
<p>@lang('server.config.allocation.help_text')</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-04-08 18:27:42 +00:00
|
|
|
</div>
|
2017-01-19 01:45:10 +00:00
|
|
|
</div>
|
|
|
|
@endsection
|
|
|
|
|
|
|
|
@section('footer-scripts')
|
|
|
|
@parent
|
|
|
|
{!! Theme::js('js/frontend/server.socket.js') !!}
|
|
|
|
<script>
|
2017-10-21 02:32:57 +00:00
|
|
|
$(document).ready(function () {
|
|
|
|
@can('edit-allocation', $server)
|
|
|
|
(function triggerClickHandler() {
|
|
|
|
$('a[data-action="set-default"]:not(.disabled)').click(function (e) {
|
|
|
|
$('#toggleActivityOverlay').removeClass('hidden');
|
|
|
|
e.preventDefault();
|
|
|
|
var self = $(this);
|
|
|
|
$.ajax({
|
|
|
|
type: 'PATCH',
|
|
|
|
url: Router.route('server.settings.allocation', { server: Pterodactyl.server.uuidShort }),
|
|
|
|
headers: {
|
|
|
|
'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content'),
|
|
|
|
},
|
|
|
|
data: {
|
|
|
|
'allocation': $(this).data('allocation')
|
|
|
|
}
|
|
|
|
}).done(function () {
|
|
|
|
self.parents().eq(2).find('a[role="button"]').removeClass('btn-success disabled').addClass('btn-default').html('{{ trans('strings.make_primary') }}');
|
|
|
|
self.removeClass('btn-default').addClass('btn-success disabled').html('{{ trans('strings.primary') }}');
|
|
|
|
}).fail(function(jqXHR) {
|
|
|
|
console.error(jqXHR);
|
2018-05-13 14:24:07 +00:00
|
|
|
var error = 'An error occurred while trying to process this request.';
|
2017-10-21 02:32:57 +00:00
|
|
|
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
|
|
|
|
error = jqXHR.responseJSON.error;
|
|
|
|
}
|
|
|
|
swal({type: 'error', title: 'Whoops!', text: error});
|
|
|
|
}).always(function () {
|
|
|
|
triggerClickHandler();
|
|
|
|
$('#toggleActivityOverlay').addClass('hidden');
|
|
|
|
})
|
2017-01-19 01:45:10 +00:00
|
|
|
});
|
2017-10-21 02:32:57 +00:00
|
|
|
})();
|
|
|
|
@endcan
|
2017-01-19 01:45:10 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endsection
|