diff options
| author | Agando <roduccomm@gmail.com> | 2026-11-09 15:36:23 +0100 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-11-09 15:36:23 +0100 |
| commit | a065a4c30be748b0c8fc6dd0b5ee1dc4d3de4b1c (patch) | |
| tree | 8a84adabfccee9994937cd71888170ab205b9361 /.bkp-fix-20261023_143429/errors.php | |
| parent | a46ebee30cfbbac86abb45068411bc28e1c65503 (diff) | |
The daily collector and the feedback pipeline had left 57 modified files uncommitted (skills,
modules-index, CHANGELOG, feedback decisions, debug counters). The public mirror publishes git
HEAD, so without this the published repo stayed behind the tree - and it blocked the publisher
outright once uncommitted subtrees started failing loudly.
Diffstat (limited to '.bkp-fix-20261023_143429/errors.php')
| -rw-r--r-- | .bkp-fix-20261023_143429/errors.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/.bkp-fix-20261023_143429/errors.php b/.bkp-fix-20261023_143429/errors.php new file mode 100644 index 0000000..1ed9a2f --- /dev/null +++ b/.bkp-fix-20261023_143429/errors.php @@ -0,0 +1,43 @@ +<?php +require_once __DIR__ . '/config.php'; + +$errors = load_json(ERRORS_FILE); + +// Filters +$type = $_GET['type'] ?? null; +$severity = $_GET['severity'] ?? null; +$module = $_GET['module'] ?? null; +$category = $_GET['category'] ?? null; +$search = $_GET['search'] ?? null; +$from = $_GET['from'] ?? null; +$to = $_GET['to'] ?? null; +$session = $_GET['session'] ?? null; +$page = max(1, (int)($_GET['page'] ?? 1)); +$perPage = min(100, max(1, (int)($_GET['per_page'] ?? 50))); + +$filtered = array_filter($errors, function($e) use ($type, $severity, $module, $category, $search, $from, $to, $session) { + if ($type && ($e['type'] ?? '') !== $type) return false; + if ($severity && ($e['severity'] ?? '') !== $severity) return false; + if ($module && ($e['module'] ?? '') !== $module) return false; + if ($category && ($e['category'] ?? '') !== $category) return false; + if ($session && ($e['session_id'] ?? '') !== $session) return false; + if ($search && stripos($e['message'] ?? '', $search) === false) return false; + if ($from && ($e['ingested_at'] ?? '') < $from) return false; + if ($to && ($e['ingested_at'] ?? '') > $to) return false; + return true; +}); + +$filtered = array_values($filtered); +$total = count($filtered); +$totalPages = max(1, ceil($total / $perPage)); +$offset = ($page - 1) * $perPage; +$pageErrors = array_slice($filtered, $offset, $perPage); + +json_response([ + 'success' => true, + 'total' => $total, + 'page' => $page, + 'per_page' => $perPage, + 'total_pages' => $totalPages, + 'errors' => $pageErrors, +]); |