[Web] add crontasks logs

This commit is contained in:
FreddleSpl0it
2023-07-06 15:53:33 +02:00
parent 4613d00a9d
commit 4426bd3d04
4 changed files with 111 additions and 1 deletions

View File

@@ -896,6 +896,17 @@ if (isset($_GET['query'])) {
}
echo (isset($logs) && !empty($logs)) ? json_encode($logs, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) : '{}';
break;
case "cron":
// 0 is first record, so empty is fine
if (isset($extra)) {
$extra = preg_replace('/[^\d\-]/i', '', $extra);
$logs = get_logs('cron-mailcow', $extra);
}
else {
$logs = get_logs('cron-mailcow');
}
echo (isset($logs) && !empty($logs)) ? json_encode($logs, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) : '{}';
break;
case "postfix":
// 0 is first record, so empty is fine
if (isset($extra)) {