1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-22 09:02:28 +01:00

Fix UI error changing a server's service, closes #1019

This commit is contained in:
Dane Everitt 2018-03-06 21:53:05 -06:00
parent 36837df0a6
commit c9e874d3ae
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 20 additions and 14 deletions

View File

@ -3,6 +3,10 @@ This file is a running track of new features and fixes to each version of the pa
This project follows [Semantic Versioning](http://semver.org) guidelines.
## v0.7.6 (Derelict Dermodactylus)
### Fixed
* Fixes a UI error when attempting to change the default Nest and Egg for an existing server.
## v0.7.5 (Derelict Dermodactylus)
### Fixed
* Fixes application API keys being created as a client API key.

View File

@ -134,13 +134,8 @@
{!! Theme::js('vendor/lodash/lodash.js') !!}
<script>
$(document).ready(function () {
$('#pNestId').select2({placeholder: 'Select a Nest'}).change();
$('#pEggId').select2({placeholder: 'Select a Nest Egg'});
$('#pPackId').select2({placeholder: 'Select a Service Pack'});
});
</script>
<script>
$('#pNestId').on('change', function (event) {
$('#pNestId').select2({placeholder: 'Select a Nest'}).on('change', function () {
$('#pEggId').html('').select2({
data: $.map(_.get(Pterodactyl.nests, $(this).val() + '.eggs', []), function (item) {
return {
@ -148,12 +143,19 @@
text: item.name,
};
}),
}).val(Pterodactyl.server.egg_id).change();
});
});
$('#pEggId').on('change', function (event) {
var parentChain = _.get(Pterodactyl.nests, $('#pNestId').val(), null);
var objectChain = _.get(parentChain, 'eggs.' + $(this).val(), null);
if (_.isObject(_.get(Pterodactyl.nests, $(this).val() + '.eggs.' + Pterodactyl.server.egg_id))) {
$('#pEggId').val(Pterodactyl.server.egg_id);
}
$('#pEggId').change();
}).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());
var objectChain = _.get(parentChain, 'eggs.' + selectedEgg);
$('#setDefaultImage').html(_.get(objectChain, 'docker_image', 'undefined'));
$('#pDockerImage').val(_.get(objectChain, 'docker_image', 'undefined'));
@ -168,7 +170,7 @@
}
$('#pPackId').html('').select2({
data: [{ id: '0', text: 'No Service Pack' }].concat(
data: [{id: '0', text: 'No Service Pack'}].concat(
$.map(_.get(objectChain, 'packs', []), function (item, i) {
return {
id: item.id,
@ -202,9 +204,9 @@
</div> \
</div> \
</div>';
$('#appendVariablesTo').append(dataAppend);
$('#appendVariablesTo').find('#egg_variable_' + item.env_variable).val(setValue);
$('#appendVariablesTo').append(dataAppend).find('#egg_variable_' + item.env_variable).val(setValue);
});
});
});
</script>
@endsection