Invert log order to display the most recent entries first in the API response. Enhanced Logs.vue with auto-refresh functionality, allowing users to set refresh intervals and follow the latest logs. Updated loadLogs method to support scrolling behavior based on user preferences.

This commit is contained in:
Omar Sánchez Pizarro
2026-01-19 22:35:53 +01:00
parent a71efd92cd
commit d954d92daf
2 changed files with 113 additions and 30 deletions

View File

@@ -475,8 +475,10 @@ app.get('/api/logs', (req, res) => {
const lines = logs.split('\n').filter(l => l.trim());
const limit = parseInt(req.query.limit) || 100;
const lastLines = lines.slice(-limit);
// Invertir orden para mostrar los más recientes primero
const reversedLines = lastLines.reverse();
res.json({ logs: lastLines });
res.json({ logs: reversedLines });
} catch (error) {
res.status(500).json({ error: error.message });
}