Persist nest_id, egg_id, pack_id
This commit is contained in:
parent
432e28b6bb
commit
dec6868a55
2 changed files with 34 additions and 16 deletions
|
@ -43,7 +43,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var lastActiveBox = null;
|
let lastActiveBox = null;
|
||||||
$(document).on('click', function (event) {
|
$(document).on('click', function (event) {
|
||||||
if (lastActiveBox !== null) {
|
if (lastActiveBox !== null) {
|
||||||
lastActiveBox.removeClass('box-primary');
|
lastActiveBox.removeClass('box-primary');
|
||||||
|
@ -79,8 +79,8 @@ $('#pNestId').on('change', function (event) {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#pEggId').on('change', function (event) {
|
$('#pEggId').on('change', function (event) {
|
||||||
var parentChain = _.get(Pterodactyl.nests, $('#pNestId').val(), null);
|
let parentChain = _.get(Pterodactyl.nests, $('#pNestId').val(), null);
|
||||||
var objectChain = _.get(parentChain, 'eggs.' + $(this).val(), null);
|
let objectChain = _.get(parentChain, 'eggs.' + $(this).val(), null);
|
||||||
|
|
||||||
$('#pDefaultContainer').val(_.get(objectChain, 'docker_image', 'not defined!'));
|
$('#pDefaultContainer').val(_.get(objectChain, 'docker_image', 'not defined!'));
|
||||||
|
|
||||||
|
@ -103,8 +103,8 @@ $('#pEggId').on('change', function (event) {
|
||||||
|
|
||||||
$('#appendVariablesTo').html('');
|
$('#appendVariablesTo').html('');
|
||||||
$.each(_.get(objectChain, 'variables', []), function (i, item) {
|
$.each(_.get(objectChain, 'variables', []), function (i, item) {
|
||||||
var isRequired = (item.required === 1) ? '<span class="label label-danger">Required</span> ' : '';
|
let isRequired = (item.required === 1) ? '<span class="label label-danger">Required</span> ' : '';
|
||||||
var dataAppend = ' \
|
let dataAppend = ' \
|
||||||
<div class="form-group col-sm-6"> \
|
<div class="form-group col-sm-6"> \
|
||||||
<label for="var_ref_' + item.id + '" class="control-label">' + isRequired + item.name + '</label> \
|
<label for="var_ref_' + item.id + '" class="control-label">' + isRequired + item.name + '</label> \
|
||||||
<input type="text" id="var_ref_' + item.id + '" autocomplete="off" name="environment[' + item.env_variable + ']" class="form-control" value="' + item.default_value + '" /> \
|
<input type="text" id="var_ref_' + item.id + '" autocomplete="off" name="environment[' + item.env_variable + ']" class="form-control" value="' + item.default_value + '" /> \
|
||||||
|
|
|
@ -313,6 +313,19 @@
|
||||||
|
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
<!-- Persist 'Server Owner' select2 -->
|
||||||
|
@if (old('owner_id'))
|
||||||
|
$.ajax({
|
||||||
|
url: '/admin/users/accounts.json?user_id={{ old('owner_id') }}',
|
||||||
|
dataType: 'json',
|
||||||
|
}).then(function (data) {
|
||||||
|
initUserIdSelect([ data ]);
|
||||||
|
});
|
||||||
|
@else
|
||||||
|
initUserIdSelect();
|
||||||
|
@endif
|
||||||
|
<!-- END Persist 'Server Owner' select2 -->
|
||||||
|
|
||||||
<!-- Persist 'Node' select2 -->
|
<!-- Persist 'Node' select2 -->
|
||||||
@if (old('node_id'))
|
@if (old('node_id'))
|
||||||
$('#pNodeId').val('{{ old('node_id') }}').change();
|
$('#pNodeId').val('{{ old('node_id') }}').change();
|
||||||
|
@ -337,18 +350,23 @@
|
||||||
@endif
|
@endif
|
||||||
<!-- END Persist 'Node' select2 -->
|
<!-- END Persist 'Node' select2 -->
|
||||||
|
|
||||||
<!-- Persist 'Server Owner' select2 -->
|
<!-- Persist 'Nest' select2 -->
|
||||||
@if (old('owner_id'))
|
@if (old('nest_id'))
|
||||||
$.ajax({
|
$('#pNestId').val('{{ old('nest_id') }}').change();
|
||||||
url: '/admin/users/accounts.json?user_id={{ old('owner_id') }}',
|
|
||||||
dataType: 'json',
|
<!-- Persist 'Egg' select2 -->
|
||||||
}).then(function (data) {
|
@if (old('egg_id'))
|
||||||
initUserIdSelect([ data ]);
|
$('#pEggId').val('{{ old('egg_id') }}').change();
|
||||||
});
|
|
||||||
@else
|
|
||||||
initUserIdSelect();
|
|
||||||
@endif
|
@endif
|
||||||
<!-- END Persist 'Server Owner' select2 -->
|
<!-- END Persist 'Egg' select2 -->
|
||||||
|
|
||||||
|
<!-- Persist 'Data Pack' select2 -->
|
||||||
|
@if (old('pack_id'))
|
||||||
|
$('#pPackId').val('{{ old('pack_id') }}').change();
|
||||||
|
@endif
|
||||||
|
<!-- END Persist 'Data Pack' select2 -->
|
||||||
|
@endif
|
||||||
|
<!-- END Persist 'Nest' select2 -->
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
Loading…
Reference in a new issue