1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-10-26 21:02:28 +02:00

Attempt again to load egg settings

This commit is contained in:
Dane Everitt 2018-03-08 21:37:30 -06:00
parent 4c26d09145
commit 7b34dab453
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -133,28 +133,8 @@
@parent
{!! Theme::js('vendor/lodash/lodash.js') !!}
<script>
$(window).on('load', function () {
$('#pNestId').change();
});
$(document).ready(function () {
$('#pPackId').select2({placeholder: 'Select a Service Pack'});
$('#pNestId').select2({placeholder: 'Select a Nest'}).on('change', function () {
$('#pEggId').html('').select2({
data: $.map(_.get(Pterodactyl.nests, $(this).val() + '.eggs', []), function (item) {
return {
id: item.id,
text: item.name,
};
}),
});
if (_.isObject(_.get(Pterodactyl.nests, $(this).val() + '.eggs.' + Pterodactyl.server.egg_id))) {
$('#pEggId').val(Pterodactyl.server.egg_id);
}
$('#pEggId').change();
});
$('#pEggId').select2({placeholder: 'Select a Nest Egg'}).on('change', function () {
var selectedEgg = _.isNull($(this).val()) ? $(this).find('option').first().val() : $(this).val();
var parentChain = _.get(Pterodactyl.nests, $("#pNestId").val());
@ -210,6 +190,23 @@
$('#appendVariablesTo').append(dataAppend).find('#egg_variable_' + item.env_variable).val(setValue);
});
});
$('#pNestId').select2({placeholder: 'Select a Nest'}).on('change', function () {
$('#pEggId').html('').select2({
data: $.map(_.get(Pterodactyl.nests, $(this).val() + '.eggs', []), function (item) {
return {
id: item.id,
text: item.name,
};
}),
});
if (_.isObject(_.get(Pterodactyl.nests, $(this).val() + '.eggs.' + Pterodactyl.server.egg_id))) {
$('#pEggId').val(Pterodactyl.server.egg_id);
}
$('#pEggId').change();
}).change();
});
</script>
@endsection