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

@ -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,