From b39a344a7dac32225d6fe939ea81fcc67f4b5750 Mon Sep 17 00:00:00 2001 From: Nikita Kiselev Date: Mon, 24 Nov 2025 00:07:12 +0300 Subject: [PATCH] feat(admin): refactor logs viewer with table display and detailed dialog Backend changes: - Update LogsHandler.php to parse Monolog logs using regex - Add parseLogLines() method to extract structured data from logs - Support ISO 8601 format with microseconds and timezone - Parse JSON context with nested objects and escaped characters support - Add formatDateTime() method for readable date formatting - Add findJsonEnd() method for correct JSON object extraction - Return data in JSON format instead of plain string Frontend changes: - Update logs.js store: change data structure from string to array of objects - Add loading flag for loading indicator - Remove caching check for data freshness - Completely refactor LogsViewer.vue component: * Replace textarea with PrimeVue DataTable with pagination and sorting * Add "Actions" column with view button (eye icon) * Use Badge component for log levels with color indicators * Remove "Context" column from table (unreadable in table view) * Add dialog with detailed log information: - Date and time (formatted and raw) - Level with color indicator - Channel - Message - Context (formatted JSON) - Raw string * Add word wrap for all text fields in dialog * Dialog closes on outside click (dismissableMask) * Configure pagination: 15 records per page by default UX improvements: - Improved log readability with structured display - Easy navigation through large number of records via pagination - Quick access to detailed information through dialog - Color-coded levels for quick visual assessment --- frontend/admin/src/components/LogsViewer.vue | 183 +++++++++++++++++- frontend/admin/src/stores/logs.js | 13 +- .../bastion/Handlers/LogsHandler.php | 143 +++++++++++++- 3 files changed, 328 insertions(+), 11 deletions(-) diff --git a/frontend/admin/src/components/LogsViewer.vue b/frontend/admin/src/components/LogsViewer.vue index b120524..81f3593 100644 --- a/frontend/admin/src/components/LogsViewer.vue +++ b/frontend/admin/src/components/LogsViewer.vue @@ -1,15 +1,190 @@