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.querySelectorAll('.crontype-inputs:not(.d-none)').forEach(elem => elem.classList.add('d-none'));
document.querySelector('.crontype-' + type).classList.remove('d-none'); document.querySelector('.crontype-' + type).classList.remove('d-none');
document.querySelector('.crontype-inputs:not(.d-none) input').disabled = false; document.querySelectorAll('.crontype-inputs:not(.d-none) input').forEach(elem => elem.disabled = false);
document.querySelector('.crontype-inputs.d-none input').disabled = true; document.querySelectorAll('.crontype-inputs.d-none input').forEach(elem => elem.disabled = true);
if (type == 'http') { if (type == 'http') {
document.querySelectorAll('.croncategory-group:not(.crontype-group) button').forEach(elem => elem.innerText = elem.dataset.defaultText) 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-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.querySelectorAll('.croncategory-inputs:not(.crontype-inputs)').forEach(elem => elem.classList.add('d-none'));
document.querySelector('.croncategory-inputs:not(.d-none) input').disabled = false; document.querySelectorAll('.croncategory-inputs:not(.d-none) input').forEach(elem => elem.disabled = false);
document.querySelector('.croncategory-inputs.d-none input').disabled = true; document.querySelectorAll('.croncategory-inputs.d-none input').forEach(elem => elem.disabled = true);
} }
if (type == 'reboot') { if (type == 'reboot') {
if (document.querySelector('#btn-group-discriminator') === null) { if (document.querySelector('#btn-group-discriminator') === null) {

View File

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