feat : SearchLogParser supporte tar.gz + config log dans onglet Recherches
- logFiles() utilise glob() au lieu d'un range fixe 1-14 - Support .tar.gz via PharData - Champ apache_access_log déplacé du tab Site vers un bloc dédié dans le tab Recherches (action admin_save_searches_config) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+23
-8
@@ -507,14 +507,6 @@ function adminStatusBadge(array $a, int $now): string
|
||||
value="<?= postsPerPage() ?>"
|
||||
min="1" max="100">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="apache-access-log" class="form-label small fw-semibold">Log d'accès Apache</label>
|
||||
<input type="text" id="apache-access-log" name="apache_access_log"
|
||||
class="form-control form-control-sm font-monospace"
|
||||
value="<?= htmlspecialchars(apacheAccessLog()) ?>"
|
||||
maxlength="200" placeholder="ex : lan.acegrp.monsite-access.log">
|
||||
<div class="form-text">Nom du fichier dans <code>/var/log/apache2/</code>, utilisé par l'onglet Recherches.</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="site-license-label" class="form-label small fw-semibold">Licence (libellé)</label>
|
||||
<input type="text" id="site-license-label" name="site_license_label"
|
||||
@@ -1070,6 +1062,29 @@ foreach (COLOR_PALETTE_16 as $_i => $_rgb):
|
||||
<!-- ─────────────────────────── RECHERCHES ─────────────────────────── -->
|
||||
<?php if ($tab === 'searches' && isAdmin()): ?>
|
||||
|
||||
<?php if (isset($_GET['saved'])): ?>
|
||||
<div class="alert alert-success py-2 mb-3">Configuration enregistrée.</div>
|
||||
<?php elseif (($_GET['error'] ?? '') === 'write'): ?>
|
||||
<div class="alert alert-danger py-2 mb-3">Impossible d'enregistrer : le fichier n'est pas accessible en écriture.</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="card mb-4" style="max-width:540px">
|
||||
<div class="card-header bg-transparent py-2 small fw-semibold">Configuration des logs</div>
|
||||
<div class="card-body py-3">
|
||||
<form method="post" action="/?action=admin_save_searches_config">
|
||||
<div class="mb-3">
|
||||
<label for="apache-access-log" class="form-label small fw-semibold">Log d'accès Apache</label>
|
||||
<input type="text" id="apache-access-log" name="apache_access_log"
|
||||
class="form-control form-control-sm font-monospace"
|
||||
value="<?= htmlspecialchars(apacheAccessLog()) ?>"
|
||||
maxlength="200" placeholder="ex : lan.acegrp.monsite-access.log">
|
||||
<div class="form-text">Nom du fichier dans <code>/var/log/apache2/</code>. Supporte <code>.gz</code> et <code>.tar.gz</code>.</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-sm">Enregistrer</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-between mb-3 flex-wrap gap-2">
|
||||
<h5 class="mb-0">Termes recherchés
|
||||
<span class="badge bg-secondary ms-1"><?= count($adminData['search_terms'] ?? []) ?></span>
|
||||
|
||||
Reference in New Issue
Block a user