NEW FEATURE: Eternal jobs

This commit is contained in:
Jeroen De Meerleer 2021-05-26 13:34:19 +02:00
parent 0be5d57cb3
commit e56a3c108e
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
4 changed files with 26 additions and 3 deletions

View File

@ -8,6 +8,7 @@ $(function() {
initContainerType();
initVarInputs();
initIntervalPattern();
initEternalCheckbox();
bsCustomFileInput.init()
});
@ -103,6 +104,12 @@ function initVarInputs()
})
}
function initEternalCheckbox() {
$('.lastrun-eternal').on('click', function() {
$('#lastrunselector').prop('disabled', $(this).prop('checked'));
$('#lastrunselector').prop('value', '');
})
}
function initIntervalPattern()
{

View File

@ -150,7 +150,7 @@ class Job
public function prepareJob(array $values): array
{
if(empty($values['lastrun'])) {
if(empty($values['lastrun']) || (isset($values['lastrun-eternal']) && $values['lastrun-eternal'] == 'true')) {
$values['lastrun'] = NULL;
} else {
$values['lastrun'] = DateTime::createFromFormat('d/m/Y H:i:s',$values['lastrun'])->getTimestamp();

View File

@ -33,7 +33,15 @@
</div>
<div class="mb-3">
<label for="lastrun">Last run</label>
<input type="text" autocomplete="off" id="lastrunselector" class="form-control datetimepicker-input" data-target="#lastrunselector" data-toggle="datetimepicker" name="lastrun">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text border-right-0">
<input type="checkbox" name="lastrun-eternal" class="lastrun-eternal" placeholder="value" value="true" {% if attribute(data, 'lastrun-eternal') is not empty %} checked{% endif %}>
</div>
<span class="input-group-text border-left-0">Eternal</span>
</div>
<input type="text" autocomplete="off" id="lastrunselector" class="form-control datetimepicker-input" data-target="#lastrunselector" data-toggle="datetimepicker" name="lastrun">
</div>
</div>
<h3>Job details</h3>

View File

@ -33,7 +33,15 @@
</div>
<div class="mb-3">
<label for="lastrun">Last run</label>
<input type="text" autocomplete="off" id="lastrunselector" class="form-control datetimepicker-input" data-target="#lastrunselector" data-toggle="datetimepicker" name="lastrun" value="{{ lastrun | date("d/m/Y H:i:s")}}">
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text border-right-0">
<input type="checkbox" name="lastrun-eternal" class="lastrun-eternal" placeholder="value" value="true"{% if attribute(data, 'lastrun') is empty %} checked{% endif %}>
</div>
<span class="input-group-text border-left-0">Eternal</span>
</div>
<input type="text" autocomplete="off" id="lastrunselector" class="form-control datetimepicker-input" data-target="#lastrunselector" data-toggle="datetimepicker" name="lastrun"{% if attribute(data, 'lastrun') is empty %} disabled{% else %} value="{{ lastrun | date("d/m/Y H:i:s")}}"{% endif %}>
</div>
</div>
<h3>Job details</h3>