More code updates

This commit is contained in:
Dane Everitt 2017-10-07 17:21:41 -05:00
parent cc297eea09
commit 17642bffe7
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
32 changed files with 209 additions and 2863 deletions

View file

@ -132,9 +132,7 @@
</div>
</div>
<div class="box-footer no-border no-pad-top no-pad-bottom">
<div class="alert alert-info">
<p class="small no-margin">If you do not want to assign swap space to a server simply put <code>0</code> for the value, or <code>-1</code> to allow unlimited swap space. If you want to disable memory limiting on a server simply enter <code>0</code> into the memory field. We suggest leaving OOM Killer enabled unless you know what you are doing, disabling it could cause your server to hang unexpectedly.<p>
</div>
<p class="text-muted small">If you do not want to assign swap space to a server simply put <code>0</code> for the value, or <code>-1</code> to allow unlimited swap space. If you want to disable memory limiting on a server simply enter <code>0</code> into the memory field. We suggest leaving OOM Killer enabled unless you know what you are doing, disabling it could cause your server to hang unexpectedly.<p>
</div>
<div class="box-body row">
<div class="form-group col-sm-4">
@ -160,9 +158,7 @@
</div>
</div>
<div class="box-footer no-border no-pad-top no-pad-bottom">
<div class="alert alert-info">
<p class="small no-margin">If you do not want to limit CPU usage set the value to <code>0</code>. To determine a value, take the number <em>physical</em> cores and multiply it by 100. For example, on a quad core system <code>(4 * 100 = 400)</code> there is <code>400%</code> available. To limit a server to using half of a single core, you would set the value to <code>50</code>. To allow a server to use up to two physical cores, set the value to <code>200</code>. BlockIO should be a value between <code>10</code> and <code>1000</code>. Please see <a href="https://docs.docker.com/engine/reference/run/#/block-io-bandwidth-blkio-constraint" target="_blank">this documentation</a> for more information about it.<p>
</div>
<p class="text-muted small">If you do not want to limit CPU usage set the value to <code>0</code>. To determine a value, take the number <em>physical</em> cores and multiply it by 100. For example, on a quad core system <code>(4 * 100 = 400)</code> there is <code>400%</code> available. To limit a server to using half of a single core, you would set the value to <code>50</code>. To allow a server to use up to two physical cores, set the value to <code>200</code>. BlockIO should be a value between <code>10</code> and <code>1000</code>. Please see <a href="https://docs.docker.com/engine/reference/run/#/block-io-bandwidth-blkio-constraint" target="_blank">this documentation</a> for more information about it.<p>
</div>
</div>
</div>
@ -171,38 +167,38 @@
<div class="col-md-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Service Configuration</h3>
<h3 class="box-title">Nest Configuration</h3>
</div>
<div class="box-body row">
<div class="form-group col-xs-12">
<label for="pServiceId">Service</label>
<select name="service_id" id="pServiceId" class="form-control">
@foreach($services as $service)
<option value="{{ $service->id }}"
@if($service->id === old('service_id'))
<label for="pNestId">Nest</label>
<select name="nest_id" id="pNestId" class="form-control">
@foreach($nests as $nest)
<option value="{{ $nest->id }}"
@if($nest->id === old('nest_id'))
selected="selected"
@endif
>{{ $service->name }}</option>
>{{ $nest->name }}</option>
@endforeach
</select>
<p class="small text-muted no-margin">Select the type of service that this server will be running.</p>
<p class="small text-muted no-margin">Select the Nest that this server will be grouped under.</p>
</div>
<div class="form-group col-xs-12">
<label for="pOptionId">Option</label>
<select name="option_id" id="pOptionId" class="form-control"></select>
<p class="small text-muted no-margin">Select the type of sub-service that this server will be running.</p>
<label for="pEggId">Egg</label>
<select name="egg_id" id="pEggId" class="form-control"></select>
<p class="small text-muted no-margin">Select the Egg that will define how this server should operate.</p>
</div>
<div class="form-group col-xs-12">
<label for="pPackId">Service Pack</label>
<label for="pPackId">Data Pack</label>
<select name="pack_id" id="pPackId" class="form-control"></select>
<p class="small text-muted no-margin">Select a service pack to be automatically installed on this server when first created.</p>
<p class="small text-muted no-margin">Select a data pack to be automatically installed on this server when first created.</p>
</div>
<div class="form-group col-xs-12">
<div class="checkbox checkbox-primary no-margin-bottom">
<input id="pSkipScripting" name="skip_scripting" type="checkbox" value="1" />
<label for="pSkipScripting" class="strong">Skip Service Option Install Script</label>
<label for="pSkipScripting" class="strong">Skip Egg Install Script</label>
</div>
<p class="small text-muted no-margin">If the selected <code>Option</code> has an install script attached to it, the script will run during install after the pack is installed. If you would like to skip this step, check this box.</p>
<p class="small text-muted no-margin">If the selected Egg has an install script attached to it, the script will run during install after the pack is installed. If you would like to skip this step, check this box.</p>
</div>
</div>
</div>
@ -214,9 +210,9 @@
</div>
<div class="box-body row">
<div class="form-group col-xs-12">
<label for="pDefaultContainer">Process Container</label>
<label for="pDefaultContainer">Docker Image</label>
<input id="pDefaultContainer" name="docker_image" value="{{ old('docker_image') }}" class="form-control" />
<p class="small text-muted no-margin">This is the default Docker container that will be used to run this server.</p>
<p class="small text-muted no-margin">This is the default Docker image that will be used to run this server.</p>
</div>
</div>
</div>

View file

@ -91,7 +91,7 @@
<div class="form-group">
<label for="name" class="control-label">Docker Image</label>
<input type="text" name="docker_image" value="{{ $server->image }}" class="form-control" />
<p class="text-muted small">The docker image to use for this server. The default image for this service and option combination is <code>{{ $server->option->docker_image }}</code>.</p>
<p class="text-muted small">The docker image to use for this server. The default image for this service and option combination is <code>{{ $server->egg->docker_image }}</code>.</p>
</div>
</div>
<div class="box-footer">

View file

@ -66,8 +66,8 @@
<tr>
<td>Service</td>
<td>
<a href="{{ route('admin.services.view', $server->option->service->id) }}">{{ $server->option->service->name }}</a> ::
<a href="{{ route('admin.services.option.view', $server->option->id) }}">{{ $server->option->name }}</a>
<a href="{{ route('admin.nests.view', $server->nest_id) }}">{{ $server->nest->name }}</a> ::
<a href="{{ route('admin.nests.egg.view', $server->egg_id) }}">{{ $server->egg->name }}</a>
</td>
</tr>
<tr>

View file

@ -78,34 +78,34 @@
</p>
</div>
<div class="form-group col-xs-12">
<label for="pServiceId">Service</label>
<select name="service_id" id="pServiceId" class="form-control">
@foreach($services as $service)
<option value="{{ $service->id }}"
@if($service->id === $server->service_id)
<label for="pNestId">Nest</label>
<select name="nest_id" id="pNestId" class="form-control">
@foreach($nests as $nest)
<option value="{{ $nest->id }}"
@if($nest->id === $server->nest_id)
selected
@endif
>{{ $service->name }}</option>
>{{ $nest->name }}</option>
@endforeach
</select>
<p class="small text-muted no-margin">Select the type of service that this server will be running.</p>
<p class="small text-muted no-margin">Select the Nest that this server will be grouped into.</p>
</div>
<div class="form-group col-xs-12">
<label for="pOptionId">Option</label>
<select name="option_id" id="pOptionId" class="form-control"></select>
<p class="small text-muted no-margin">Select the type of sub-service that this server will be running.</p>
<label for="pEggId">Egg</label>
<select name="egg_id" id="pEggId" class="form-control"></select>
<p class="small text-muted no-margin">Select the Egg that will provide processing data for this server.</p>
</div>
<div class="form-group col-xs-12">
<label for="pPackId">Service Pack</label>
<label for="pPackId">Data Pack</label>
<select name="pack_id" id="pPackId" class="form-control"></select>
<p class="small text-muted no-margin">Select a service pack to be automatically installed on this server when first created.</p>
<p class="small text-muted no-margin">Select a data pack to be automatically installed on this server when first created.</p>
</div>
<div class="form-group col-xs-12">
<div class="checkbox checkbox-primary no-margin-bottom">
<input id="pSkipScripting" name="skip_scripting" type="checkbox" value="1" @if($server->skip_scripts) checked @endif />
<label for="pSkipScripting" class="strong">Skip Service Option Install Script</label>
<label for="pSkipScripting" class="strong">Skip Egg Install Script</label>
</div>
<p class="small text-muted no-margin">If the selected <code>Option</code> has an install script attached to it, the script will run during install after the pack is installed. If you would like to skip this step, check this box.</p>
<p class="small text-muted no-margin">If the selected Egg has an install script attached to it, the script will run during install after the pack is installed. If you would like to skip this step, check this box.</p>
</div>
</div>
</div>
@ -122,11 +122,11 @@
{!! Theme::js('vendor/lodash/lodash.js') !!}
<script>
$(document).ready(function () {
$('#pServiceId').select2({
placeholder: 'Select a Service',
$('#pNestId').select2({
placeholder: 'Select a Nest',
}).change();
$('#pOptionId').select2({
placeholder: 'Select a Service Option',
$('#pEggId').select2({
placeholder: 'Select a Nest Egg',
});
$('#pPackId').select2({
placeholder: 'Select a Service Pack',
@ -143,20 +143,20 @@
});
</script>
<script>
$('#pServiceId').on('change', function (event) {
$('#pOptionId').html('').select2({
data: $.map(_.get(Pterodactyl.services, $(this).val() + '.options', []), function (item) {
$('#pNestId').on('change', function (event) {
$('#pEggId').html('').select2({
data: $.map(_.get(Pterodactyl.nests, $(this).val() + '.eggs', []), function (item) {
return {
id: item.id,
text: item.name,
};
}),
}).val('{{ $server->option_id }}').change();
}).change();
});
$('#pOptionId').on('change', function (event) {
var parentChain = _.get(Pterodactyl.services, $('#pServiceId').val(), null);
var objectChain = _.get(parentChain, 'options.' + $(this).val(), null);
$('#pEggId').on('change', function (event) {
var parentChain = _.get(Pterodactyl.nests, $('#pNestId').val(), null);
var objectChain = _.get(parentChain, 'eggs.' + $(this).val(), null);
$('#pDefaultContainer').val(_.get(objectChain, 'docker_image', 'not defined!'));
@ -167,7 +167,7 @@
}
$('#pPackId').html('').select2({
data: [{ id: '', text: 'No Service Pack' }].concat(
data: [{ id: '0', text: 'No Service Pack' }].concat(
$.map(_.get(objectChain, 'packs', []), function (item, i) {
return {
id: item.id,