mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-16 18:04:34 -05:00
29 lines
970 B
PHP
29 lines
970 B
PHP
<?php
|
|
/** @phpstan-var \Twig\Environment $Twig */
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Gazelle;
|
|
|
|
$statsUser = new Stats\Users();
|
|
$flow = $statsUser->flow();
|
|
|
|
echo $Twig->render('stats/user.twig', [
|
|
'distribution' => [
|
|
'browser' => $statsUser->browserDistribution($Viewer->permitted('users_mod')),
|
|
'class' => $statsUser->userclassDistribution($Viewer->permitted('users_mod')),
|
|
'platform' => $statsUser->platformDistribution($Viewer->permitted('users_mod')),
|
|
],
|
|
'flow' => [
|
|
'month' => array_keys($flow),
|
|
'add' => array_values(array_map(fn($m) => $m['new'], $flow)),
|
|
'del' => array_values(array_map(fn($m) => -$m['disabled'], $flow)),
|
|
'net' => array_values(array_map(fn($m) => $m['new'] - $m['disabled'], $flow)),
|
|
],
|
|
'geodist' => [
|
|
'iso' => ISO3166_2(),
|
|
'list' => $statsUser->geodistributionChart($Viewer),
|
|
'topology' => worldTopology(),
|
|
],
|
|
]);
|