BUGFIX: missing labels

This commit is contained in:
Jeroen De Meerleer 2021-08-02 19:26:30 +02:00
parent 09024ab65d
commit 0aa87504e4
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 11 additions and 5 deletions

View File

@ -32,8 +32,8 @@ function initCronType()
document.querySelectorAll('.crontype-inputs:not(.d-none)').forEach(elem => elem.classList.add('d-none'));
document.querySelector('.crontype-' + type).classList.remove('d-none');
document.querySelector('.crontype-inputs:not(.d-none) input').disabled = false;
document.querySelector('.crontype-inputs.d-none input').disabled = true;
document.querySelectorAll('.crontype-inputs:not(.d-none) input').forEach(elem => elem.disabled = false);
document.querySelectorAll('.crontype-inputs.d-none input').forEach(elem => elem.disabled = true);
if (type == 'http') {
document.querySelectorAll('.croncategory-group:not(.crontype-group) button').forEach(elem => elem.innerText = elem.dataset.defaultText)
@ -42,8 +42,8 @@ function initCronType()
document.querySelectorAll('.croncategory-group:not(.crontype-group)').forEach(elem => elem.classList.add('d-none'));
document.querySelectorAll('.croncategory-inputs:not(.crontype-inputs)').forEach(elem => elem.classList.add('d-none'));
document.querySelector('.croncategory-inputs:not(.d-none) input').disabled = false;
document.querySelector('.croncategory-inputs.d-none input').disabled = true;
document.querySelectorAll('.croncategory-inputs:not(.d-none) input').forEach(elem => elem.disabled = false);
document.querySelectorAll('.croncategory-inputs.d-none input').forEach(elem => elem.disabled = true);
}
if (type == 'reboot') {
if (document.querySelector('#btn-group-discriminator') === null) {

View File

@ -67,6 +67,8 @@
Reboot
{% elseif data.crontype == 'http' %}
Http request
{% else %}
Job type
{% endif %}
</button>
<div class="dropdown-menu" aria-labelledby="crontypeButton">
@ -82,6 +84,8 @@
Local
{% elseif data.hosttype == 'ssh' %}
SSH
{% else %}
Host type
{% endif %}
</button>
<div class="dropdown-menu" aria-labelledby="hosttypeButton">
@ -95,11 +99,13 @@
<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-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="containertypeButton" data-default-text="Container" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% if data.containertype == 'none' or data.containertype == '' %}
None
{% elseif data.containertype == 'docker' %}
Docker
{% else %}
Container
{% endif %}
</button>
<div class="dropdown-menu" aria-labelledby="containertypeButton">