mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-16 18:04:34 -05:00
30 lines
841 B
PHP
30 lines
841 B
PHP
<?php
|
|
/** @phpstan-var \Gazelle\User $Viewer */
|
|
/** @phpstan-var \Twig\Environment $Twig */
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Gazelle;
|
|
|
|
if (!$Viewer->permitted('admin_periodic_task_view')) {
|
|
Error403::error();
|
|
}
|
|
|
|
$stats = (new TaskScheduler())->runtimeStats();
|
|
echo $Twig->render('admin/scheduler/stats.twig', [
|
|
'hourly' => [
|
|
'duration' => json_encode($stats['hourly'][0]['data']),
|
|
'processed' => json_encode($stats['hourly'][1]['data']),
|
|
],
|
|
'daily' => [
|
|
'duration' => json_encode($stats['daily'][0]['data']),
|
|
'processed' => json_encode($stats['daily'][1]['data']),
|
|
],
|
|
'tasks' => [
|
|
'duration' => json_encode($stats['tasks'][0]['data']),
|
|
'processed' => json_encode($stats['tasks'][1]['data']),
|
|
],
|
|
'totals' => $stats['totals'],
|
|
'viewer' => $Viewer,
|
|
]);
|