From 0aa87504e45b12092dfb4130cab09f61869e1510 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Mon, 2 Aug 2021 19:26:30 +0200 Subject: [PATCH] BUGFIX: missing labels --- assets/js/job/add.js | 8 ++++---- templates/job/edit.html.twig | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/assets/js/job/add.js b/assets/js/job/add.js index d1f1aa5..d19a803 100644 --- a/assets/js/job/add.js +++ b/assets/js/job/add.js @@ -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) { diff --git a/templates/job/edit.html.twig b/templates/job/edit.html.twig index 6d6797f..c7f6eb8 100644 --- a/templates/job/edit.html.twig +++ b/templates/job/edit.html.twig @@ -67,6 +67,8 @@ Reboot {% elseif data.crontype == 'http' %} Http request + {% else %} + Job type {% endif %}