feat : onglet Statistiques — pages, livres, répartition AS avec groupes configurables
- AccessLogParser : parse COMBINED, agrège hits /post/ et /book/, cache 10 min - AsnLookup : batch lookup ip-api.com, cache 30j, agrégation et groupes AS - Onglet Statistiques dans l'admin : top pages, top livres, répartition réseau - Filtrage par groupe AS (badges) + formulaire de configuration des groupes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -68,6 +68,13 @@ function apacheAccessLog(): string
|
||||
return (string)($_ENV['APACHE_ACCESS_LOG'] ?? getenv('APACHE_ACCESS_LOG') ?: '*-access.log');
|
||||
}
|
||||
|
||||
/** @return list<array{label:string,patterns:list<string>}> */
|
||||
function asGroups(): array
|
||||
{
|
||||
$raw = siteSettings()['as_groups'] ?? [];
|
||||
return is_array($raw) ? $raw : [];
|
||||
}
|
||||
|
||||
function saveSiteSettings(array $data): bool
|
||||
{
|
||||
$current = siteSettings();
|
||||
@@ -86,6 +93,10 @@ function saveSiteSettings(array $data): bool
|
||||
$current['posts_per_page'] = $val;
|
||||
}
|
||||
}
|
||||
if (array_key_exists('as_groups', $data) && is_array($data['as_groups'])) {
|
||||
$current['as_groups'] = $data['as_groups'];
|
||||
}
|
||||
|
||||
return file_put_contents(
|
||||
siteSettingsPath(),
|
||||
json_encode($current, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)
|
||||
|
||||
Reference in New Issue
Block a user