diff --git a/assets/job/index.js b/assets/job/index.js index 3676a7b..f4bdf01 100644 --- a/assets/job/index.js +++ b/assets/job/index.js @@ -35,6 +35,20 @@ function initRunNowButtons() { modal.find('.modal-title').html(data.title); if (data.status == 'deferred') { modal.find('.modal-body').html(data.message); + me.addClass('disabled'); + + let td = me.parents('td'); + td.find('.btn').each(function() { + let btn = $(this); + btn.addClass('btn-outline-success'); + btn.removeClass('btn-outline-primary'); + btn.removeClass('btn-outline-danger'); + }) + + + let tr = me.parents('tr'); + tr.addClass('running'); + tr.removeClass('norun'); } else if (data.status == 'ran') { let content = '
Cronjob ran in ' + data.runtime.toFixed(3) + ' seconds with exit code ' + data.exitcode +'
' content += '' + data.output + '' diff --git a/src/Repository/Job.php b/src/Repository/Job.php index 1565fc8..44df682 100644 --- a/src/Repository/Job.php +++ b/src/Repository/Job.php @@ -145,11 +145,11 @@ class Job extends Repository private function runLocalCommand(string $command): array { - pcntl_signal(SIGCHLD, SIG_DFL); + if(function_exists('pcntl_signal')) pcntl_signal(SIGCHLD, SIG_DFL); $return['exitcode'] = NULL; $return['output'] = NULL; exec($command . ' 2>&1', $return['output'], $return['exitcode']); - pcntl_signal(SIGCHLD, SIG_IGN); + if(function_exists('pcntl_signal'))pcntl_signal(SIGCHLD, SIG_IGN); $return['output'] = implode("\n", $return['output']); return $return; } diff --git a/templates/job/index.html.twig b/templates/job/index.html.twig index 0a5ff25..e003c8c 100644 --- a/templates/job/index.html.twig +++ b/templates/job/index.html.twig @@ -15,16 +15,16 @@ {% for job in jobs %} -