1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
<?php
/**
* @var Admin_Cronjobs_LogsController $controller
* @var Pagination $pagination
* @var int $total
* @var array $filter
* @var CronjobSchedule[] $schedules
* @var CronjobTask[] $tasks
* @var CronjobLog[] $logs
*/
use Studip\Button, Studip\LinkButton;
?>
<form action="<?= $controller->filter() ?>" method="post" class="cronjob-filters default">
<fieldset>
<legend>
<?= _('Darstellung einschränken') ?>
<? if ($pagination->getTotal() != $total): ?>
<small>
<?= sprintf(_('Passend: %u von %u Logeinträgen'), $pagination->getTotal(), $total) ?>
</small>
<? endif; ?>
</legend>
<label class="col-2">
<?= _('Status') ?>
<select name="filter[status]" id="status" class="submit-upon-select">
<option value=""><?= _('Alle Logeinträge anzeigen') ?></option>
<option value="passed" <? if ($filter['status'] === 'passed') echo 'selected'; ?>>
<?= _('Nur fehlerfreie Logeinträge anzeigen') ?>
</option>
<option value="failed" <? if ($filter['status'] === 'failed') echo 'selected'; ?>>
<?= _('Nur fehlerhafte Logeinträge anzeigen') ?>
</option>
</select>
</label>
<label class="col-2">
<?= _('Cronjob') ?>
<select name="filter[schedule_id]" id="schedule_id" class="submit-upon-select">
<option value=""><?= _('Alle Logeinträge anzeigen') ?></option>
<? foreach ($schedules as $schedule): ?>
<option value="<?= $schedule->schedule_id ?>" <? if ($filter['schedule_id'] === $schedule->schedule_id) echo 'selected'; ?>>
<?= htmlReady($schedule->title) ?>
</option>
<? endforeach; ?>
</select>
</label>
<label class="col-2">
<?= _('Aufgabe') ?>
<select name="filter[task_id]" id="task_id" class="submit-upon-select">
<option value=""><?= _('Alle Aufgaben anzeigen') ?></option>
<? foreach ($tasks as $task): ?>
<option value="<?= $task->task_id ?>" <? if ($filter['task_id'] === $task->task_id) echo 'selected'; ?>>
<?= htmlReady($task->name) ?>
</option>
<? endforeach; ?>
</select>
</label>
</fieldset>
<? if (!empty($filter)): ?>
<footer>
<?= LinkButton::createCancel(
_('Zurücksetzen'),
$controller->url_for('admin/cronjobs/logs/filter'),
['title' => _('Filter zurücksetzen')]
) ?>
</footer>
<? endif ?>
</form>
<form action="<?= $controller->bulk($pagination->getCurrentPage()) ?>" method="post" class="default">
<?= CSRFProtection::tokenTag() ?>
<table class="default cronjobs">
<colgroup>
<col style="width: 20px">
<col style="width: 150px">
<col style="width: 150px">
<col>
<col style="width: 50px">
<col style="width: 50px">
</colgroup>
<thead>
<tr>
<th>
<input type="checkbox" name="all" value="1"
data-proxyfor=":checkbox[name='ids[]']"
data-activates=".cronjobs select[name=action]">
</th>
<th><?= _('Ausgeführt') ?></th>
<th><?= _('Geplant') ?></th>
<th><?= _('Cronjob') ?></th>
<th><?= _('Ok?') ?></th>
<th><?= _('Optionen') ?></th>
</tr>
</thead>
<tbody>
<? if (count($logs) === 0): ?>
<tr class="empty">
<td colspan="6"><?= _('Keine Einträge vorhanden') ?></td>
</tr>
<? endif; ?>
<? foreach ($logs as $log): ?>
<tr id="log-<?= htmlReady($log->id) ?>">
<td style="text-align: center">
<input type="checkbox" name="ids[]" value="<?= htmlReady($log->id) ?>">
</td>
<td><?= strftime('%x %X', $log->executed) ?></td>
<td><?= strftime('%x %X', $log->scheduled) ?></td>
<td><?= htmlReady($log->schedule->title ?: $log->schedule->task->name) ?></td>
<td>
<? if ($log->duration == -1): ?>
<?= Icon::create('question', Icon::ROLE_INACTIVE)->asImg(['title' => _('Läuft noch')]) ?>
<? elseif ($log->exception === null): ?>
<?= Icon::create('accept', Icon::ROLE_STATUS_GREEN)->asImg(['title' => _('Ja')]) ?>
<? else: ?>
<?= Icon::create('decline', Icon::ROLE_STATUS_RED)->asImg(['title' => _('Nein')]) ?>
<? endif; ?>
</td>
<td style="text-align: right">
<a data-dialog href="<?= $controller->display($log, $pagination->getCurrentPage()) ?>">
<?= Icon::create('admin')->asImg(['title' => _('Logeintrag anzeigen')]) ?>
</a>
<a href="<?= $controller->delete($log, $pagination->getCurrentPage()) ?>">
<?= Icon::create('trash')->asImg(['title' => _('Logeintrag löschen')]) ?>
</a>
</td>
</tr>
<? endforeach; ?>
</tbody>
<tfoot>
<tr>
<td colspan="6">
<select name="action" data-activates="button[name=bulk]" aria-label="<?= _('Aktion auswählen') ?>">
<option value="">- <?= _('Aktion auswählen') ?></option>
<option value="delete"><?= _('Löschen') ?></option>
</select>
<?= Button::createAccept(_('Ausführen'), 'bulk') ?>
<section style="float: right">
<?= $pagination->asLinks(function ($page) use ($controller) {
return $controller->index($page);
}) ?>
</section>
</td>
</tr>
</tfoot>
</table>
</form>
|