Basic implemention of multiple selectable images for an egg
The admin side of this is quite ugly when creating/editing a server, but I'm not putting effort into that right now with React Admin soon™
This commit is contained in:
parent
3e65a2d055
commit
78c4ac80bc
11 changed files with 123 additions and 31 deletions
|
@ -82,7 +82,13 @@ $('#pEggId').on('change', function (event) {
|
|||
let parentChain = _.get(Pterodactyl.nests, $('#pNestId').val(), null);
|
||||
let objectChain = _.get(parentChain, 'eggs.' + $(this).val(), null);
|
||||
|
||||
$('#pDefaultContainer').val(_.get(objectChain, 'docker_image', 'not defined!'));
|
||||
const images = _.get(objectChain, 'docker_images', [])
|
||||
for (let i = 0; i < images.length; i++) {
|
||||
let opt = document.createElement('option');
|
||||
opt.value = images[i];
|
||||
opt.innerHTML = images[i];
|
||||
$('#pDefaultContainer').append(opt);
|
||||
}
|
||||
|
||||
if (!_.get(objectChain, 'startup', false)) {
|
||||
$('#pStartup').val(_.get(parentChain, 'startup', 'ERROR: Startup Not Defined!'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue