{% extends "layout.html" %} {% block content %}
{% if health_status == 'healthy' %} {% elif health_status == 'warning' %} {% else %} {% endif %}
Overall Health
{{ health_status|title }}
{% if health_status == 'healthy' %} All systems running normally {% elif health_status == 'warning' %} Minor issues detected {% else %} Critical issues require attention {% endif %}
{% if db_healthy %} {% else %} {% endif %}
Database
{% if db_healthy %}Connected{% else %}Error{% endif %}
{% if db_healthy %} Database connection active {% else %} {{ db_error }} {% endif %}
Uptime
{{ uptime_duration.days }}d {{ uptime_duration.seconds//3600 }}h
Since first recorded event
{{ error_count_24h }}
Errors (24h)
{{ warning_count_24h }}
Warnings (24h)
{{ today_events }}
Events Today
{{ total_events_week }}
Events This Week
{% if errors %}

Recent Errors

{% for error in errors %}
{{ error.event_type }} {{ error.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}
{{ error.description }}
{% if error.user %} {{ error.user.username }} {% endif %} {% if error.company %} {{ error.company.name }} {% endif %} {% if error.ip_address %} {{ error.ip_address }} {% endif %}
{% endfor %}
{% endif %} {% if warnings %}

Recent Warnings

{% for warning in warnings %}
{{ warning.event_type }} {{ warning.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}
{{ warning.description }}
{% if warning.user %} {{ warning.user.username }} {% endif %} {% if warning.company %} {{ warning.company.name }} {% endif %}
{% endfor %}
{% endif %}

System Event Log Last 7 days

{% for event in recent_events %}
{{ event.event_type }} {{ event.event_category }} {% if event.severity != 'info' %} {{ event.severity|upper }} {% endif %}
{{ event.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}
{{ event.description }}
{% if event.user or event.company or event.ip_address %}
{% if event.user %} {{ event.user.username }} {% endif %} {% if event.company %} {{ event.company.name }} {% endif %} {% if event.ip_address %} {{ event.ip_address }} {% endif %}
{% endif %}
{% endfor %}
{% endblock %}