NEW FEATURE: Eternal jobs
This commit is contained in:
parent
0be5d57cb3
commit
e56a3c108e
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue