scripts/job: show single job details

This commit is contained in:
Thomas Gelf 2016-05-25 15:13:34 +02:00
parent 17345a3df8
commit 95afce9d5a

View File

@ -0,0 +1,50 @@
<div class="controls">
<?= $this->tabs ?>
<h1><?= $this->escape($this->title) ?></h1>
<span class="action-links">
<?= $this->actionLinks ?>
</span>
</div>
<div class="content">
<?php if ($job->disabled === 'y'): ?>
<p class="error"><?= sprintf(
$this->translate(
'This job would run every %ds. It has been disabled and will therefore not be executed as scheduled'
),
$job->run_interval
) ?>
</p>
<?php else: ?>
<p>
<?php //$class = $job->job(); echo $class::getDescription() ?>
<?php if ($job->isPending()): ?>
<?= sprintf($this->translate('This job runs every %ds and is currently pending'), $job->run_interval) ?>
<?php else: ?>
<?= sprintf($this->translate('This job runs every %ds.'), $job->run_interval) ?>
<?php endif ?>
</p>
<?php endif ?>
<?php if ($job->ts_last_attempt): ?>
<?php if ($job->last_attempt_succeeded): ?>
<p><?= sprintf(
$this->translate('The last attempt succeeded at %s'),
$job->ts_last_attempt
) ?></p>
<?php else: ?>
<p class="error"><?= sprintf(
$this->translate('The last attempt failed at %s: %s'),
$job->ts_last_attempt,
$this->escape($job->ts_last_error)
) ?></p>
<?php endif ?>
<?php else: ?>
<?= $this->translate('This job has not been executed yet') ?>
<?php endif ?>
<pre>
<?= $this->escape(
print_r($this->job->getProperties(), 1)
) ?>
</pre>
</div>