From 5763a9cfc43889edabd2ed4c11be8bc7185b348f Mon Sep 17 00:00:00 2001 From: Jens Luedicke Date: Sun, 13 Jul 2025 13:52:13 +0200 Subject: [PATCH] Fix System Health. --- routes/system_admin.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/routes/system_admin.py b/routes/system_admin.py index 68e9803..08dec80 100644 --- a/routes/system_admin.py +++ b/routes/system_admin.py @@ -456,12 +456,17 @@ def system_admin_health(): func.date(SystemEvent.timestamp) == today ).count() - # Calculate 24-hour error count + # Calculate 24-hour error and warning counts yesterday = now - timedelta(days=1) error_count_24h = SystemEvent.query.filter( SystemEvent.timestamp >= yesterday, SystemEvent.severity == 'error' ).count() + + warning_count_24h = SystemEvent.query.filter( + SystemEvent.timestamp >= yesterday, + SystemEvent.severity == 'warning' + ).count() # Log the health check SystemEvent.log_event( @@ -484,7 +489,8 @@ def system_admin_health(): db_error=db_error, uptime_duration=uptime_duration, today_events=today_events, - error_count_24h=error_count_24h) + error_count_24h=error_count_24h, + warning_count_24h=warning_count_24h) @system_admin_bp.route('/branding', methods=['GET', 'POST'])