mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-26 02:52:30 +01:00
Fix UI error changing a server's service, closes #1019
This commit is contained in:
parent
36837df0a6
commit
c9e874d3ae
@ -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.
|
||||
|
@ -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'));
|
||||
@ -202,8 +204,8 @@
|
||||
</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>
|
||||
|
Loading…
Reference in New Issue
Block a user