From 38356d7bb311e820ec23bdcc88b14bbd2a48200e Mon Sep 17 00:00:00 2001 From: 9qeklajc <9qeklajc> Date: Sun, 16 Nov 2025 10:46:10 +0100 Subject: [PATCH] add copy button & order entries --- routstr/core/admin.py | 4 ++-- ui/app/logs/log-details-dialog.tsx | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/routstr/core/admin.py b/routstr/core/admin.py index 06a8a7ed..91899aaf 100644 --- a/routstr/core/admin.py +++ b/routstr/core/admin.py @@ -827,8 +827,8 @@ async def view_logs(request: Request, request_id: str) -> str: except Exception as e: logger.error(f"Error reading log file {log_file}: {e}") - # Sort entries by timestamp if available - log_entries.sort(key=lambda x: x.get("asctime", ""), reverse=False) + # Sort entries by timestamp if available (newest first) + log_entries.sort(key=lambda x: x.get("asctime", ""), reverse=True) # Format log entries for display formatted_logs = [] diff --git a/ui/app/logs/log-details-dialog.tsx b/ui/app/logs/log-details-dialog.tsx index 5df1e7dd..852aa4a8 100644 --- a/ui/app/logs/log-details-dialog.tsx +++ b/ui/app/logs/log-details-dialog.tsx @@ -170,7 +170,27 @@ export function LogDetailsDialog({ )}
-

Raw JSON

+
+

Raw JSON

+ +
                   {JSON.stringify(log, null, 2)}