fixed enable switch

This commit is contained in:
HB9HIL
2024-04-26 14:18:11 +02:00
parent be33c3c059
commit 2e24330cc8
2 changed files with 3 additions and 6 deletions

View File

@@ -22,9 +22,7 @@
<th scope="row">Enabled</th>
<td>
<div class="form-check form-switch">
<input name="edit_cron_enable_switch" class="form-check-input" type="checkbox" role="switch" id="edit_<?php echo $cron->id; ?>" <?php if ($cron->enabled ?? '0') {
echo 'checked';
} ?>>
<input name="edit_cron_enable_switch" class="form-check-input" type="checkbox" role="switch" id="edit_<?php echo $cron->id; ?>" <?php if ($cron->enabled ?? '0') { echo 'checked'; } ?>>
</div>
</td>
</tr>
@@ -64,7 +62,7 @@
<p class="text-center"> - OR -</p>
<p>Enter your own Cron Expression</p>
<input type="text" class="form-control mb-1" style="font-family: Courier New;" name="edit_cron_expression_custom" id="edit_cron_expression_custom" value="<?php echo htmlspecialchars($cron->expression); ?>">
<em id="exp_humanreadable" style="display: none;">TEST</em>
<em id="exp_humanreadable" style="display: none;"></em>
</td>
</tr>
</tbody>

View File

@@ -94,7 +94,7 @@ function editCron() {
var $cron_id = $('#edit_cron_id').val();
var $cron_description = $('#edit_cron_description').val();
var $cron_expression = $('#edit_cron_expression_custom').val();
var $cron_enabled = $('#edit_' + $cron_id).is(':checked') ? '1' : '0';
var $cron_enabled = $('#edit_' + $cron_id).is(':checked') ? 'true' : 'false';
$.ajax({
url: base_url + 'index.php/cron/edit',
@@ -107,7 +107,6 @@ function editCron() {
},
success: function (data) {
reloadCrons();
console.log('edit success');
},
error: function (data) {
},