No reboot for containers

This commit is contained in:
Jeroen De Meerleer 2021-05-27 20:24:20 +02:00
parent 0282edbdfd
commit 84241e3d41
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
3 changed files with 32 additions and 6 deletions

View File

@ -32,10 +32,7 @@ function initCronType()
$('.crontype-inputs:not(.d-none) input').prop('disabled', false);
$('.crontype-inputs.d-none input').prop('disabled', true);
if(type != 'http') {
$('.croncategory-group').addClass('btn-group');
$('.croncategory-group').removeClass('d-none');
} else {
if(type == 'http') {
$('.croncategory-group:not(.crontype-group) button').each(function() {
$(this).html($(this).data('default-text'))
})
@ -47,6 +44,31 @@ function initCronType()
$('.croncategory-inputs:not(.d-none) input').prop('disabled', false);
$('.croncategory-inputs.d-none input').prop('disabled', true);
}
if(type == 'reboot') {
if($('#btn-group-discriminator').length == 0) {
$('body').append('<div id="btn-group-discriminator" class="d-none">');
}
$('.croncategory-group.containertype-group button').each(function() {
$(this).html($(this).data('default-text'))
})
$('.croncategory-group').addClass('btn-group');
$('.croncategory-group').removeClass('d-none');
$('#btn-group-discriminator').append($('.containertype-group'));
$('.croncategory-selector .containertype-group').remove();
$('.croncategory-group.containertype-group').addClass('d-none');
$('.croncategory-inputs.containertype-inputs').addClass('d-none');
$('.croncategory-inputs:not(.d-none) input').prop('disabled', false);
$('.croncategory-inputs.d-none input').prop('disabled', true);
}
if(type == 'command') {
if($('#btn-group-discriminator .containertype-group').length > 0) {
$('.croncategory-selector').append($('#btn-group-discriminator .containertype-group'));
}
$('.croncategory-group').addClass('btn-group');
$('.croncategory-group').removeClass('d-none');
}
})
}
function initContainerType()

View File

@ -45,7 +45,7 @@
</div>
<h3>Job details</h3>
<div class="mb-3 btn-group">
<div class="mb-3 btn-group croncategory-selector">
<div class="dropdown croncategory-group crontype-group">
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="crontypeButton" data-default-text="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Job type

View File

@ -45,7 +45,7 @@
</div>
<h3>Job details</h3>
<div class="mb-3 btn-group">
<div class="mb-3 btn-group croncategory-selector">
<div class="dropdown croncategory-group crontype-group{% if data.crontype != 'http' %} btn-group{% endif %}">
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="crontypeButton" data-default-text="Job type" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% if data.crontype == 'command' %}
@ -77,6 +77,10 @@
</div>
</div>
{% if data.crontype == 'reboot' %}
</div>
<div id="btn-group-discriminator" class="d-none">
{% endif %}
<div class="dropdown croncategory-group containertype-group{% if data.crontype != 'http' %} btn-group{% else %} d-none{% endif %}">
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="containertypeButton" data-default-text="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% if data.containertype == 'none' %}