{% extends 'paxalia/base.html' %} {% load static i18n %} {% block title %}{% trans "Availability" %} – Paxalia Dashboard{% endblock %} {% block page_title %}{% trans "Availability" %}{% endblock %} {% block page_subtitle %}{% trans "Monitor the health, response time, and confirmed incident state of your critical endpoints" %}{% endblock %} {% block extra_css %} {% endblock %} {% block filter_bar %}{% include 'paxalia/includes/filter_bar.html' %}{% endblock %} {% block dashboard_content %}
{% trans "Service health" %}

{% trans "At a glance" %}

{% trans "Current monitor state is separated from historical availability so UNKNOWN observations never inflate uptime." %}

{% trans "Observation window" %} {{ start_date|date:"M d, Y" }} — {{ end_date|date:"M d, Y" }}
{% trans "Operational" %} {{ availability_summary.up }} {% trans "monitors currently UP" %}
{% trans "Down" %} {{ availability_summary.down }} {% trans "monitors currently DOWN" %}
{% trans "Unknown" %} {{ availability_summary.unknown }} {% trans "not enough confirmed evidence" %}
{% trans "Open incidents" %} {{ availability_summary.open_incidents }} {% trans "transition-based incidents" %}
{% if can_manage_availability %}
{% trans "Monitor configuration" %}

{% trans "Add a monitor" %}

{% trans "Start with the endpoint and expected result, then tune scheduling and validation only when needed." %}

{% trans "Protected by SSRF, redirect, response-size, and request-body bounds." %}
{% csrf_token %}
{% trans "Identity & target" %}
{% trans "Expected response" %}
{% trans "Schedule & incident sensitivity" %}
{% trans "Advanced validation" %}
{% trans "Redirect handling" %} {% trans "Redirect destinations are revalidated against the same safety policy." %}
{% else %}
{% trans "View only" %}

{% trans "Availability monitoring" %}

{% trans "You can inspect monitor health and incidents. Creating and changing monitors requires the Availability management permission." %}

{% endif %}
{% trans "Monitors" %}

{% trans "Configured services" %}

{% trans "Current state, historical availability, response timing, and controls for each monitor." %}

{{ monitors|length }} {% trans "monitors" %}
{% if monitors %}
{% for row in monitors %} {% endfor %}
{% trans "Monitor" %} {% trans "Target" %} {% trans "State" %} {% trans "Availability" %} {% trans "Response" %} {% trans "Last checked" %} {% trans "Controls" %}
{{ row.monitor.name }} {{ row.monitor.get_kind_display }} · {{ row.monitor.method }} {% if not row.monitor.is_active %}{% trans "Paused" %}{% endif %}
{{ row.monitor.url }} {% trans "Expected" %} {{ row.monitor.expected_status_code }}
{% if row.current_status == 'up' %}{% trans "UP" %} {% elif row.current_status == 'down' %}{% trans "DOWN" %} {% else %}{% trans "UNKNOWN" %}{% endif %}
{% if row.uptime_pct is not None %}{{ row.uptime_pct }}%{% else %}—{% endif %} {% trans "selected window" %}
{% if row.latest_check and row.latest_check.response_time_ms %}{{ row.latest_check.response_time_ms }} ms{% else %}—{% endif %} {% if row.response_stats.count %}avg {{ row.response_stats.average_ms }} · p95 {{ row.response_stats.p95_ms }}{% else %}{% trans "No timing sample" %}{% endif %}
{% if row.latest_check %}{{ row.latest_check.checked_at|date:"M d, H:i:s" }}{% else %}—{% endif %} {% if row.latest_check %}{{ row.latest_check.status|upper }}{% else %}{% trans "No observations" %}{% endif %}
{% if can_manage_availability %}
{% trans "Edit" %}
{% csrf_token %}
{% trans "Monitor settings" %}
{% trans "Redirect handling" %}{% trans "Redirect targets remain subject to SSRF validation." %}
{% csrf_token %}
{% csrf_token %}
{% else %}{% trans "View only" %}{% endif %}
{% else %}
{% trans "No monitors configured yet" %} {% if can_manage_availability %}{% trans "Use Add a monitor above to begin collecting availability evidence." %}{% else %}{% trans "A dashboard administrator with Availability management permission must configure the first monitor." %}{% endif %}
{% endif %}
{% trans "Incident history" %}

{% trans "Recent incidents" %}

{% trans "Incident boundaries are based on confirmed observations; unseen outage time is never inferred." %}

{% if recent_incidents %}{{ recent_incidents|length }}{% else %}0{% endif %} {% trans "records" %}
{% if recent_incidents %}
{% for incident in recent_incidents %} {% endfor %}
{% trans "Monitor" %} {% trans "State" %} {% trans "Failure" %} {% trans "Recovery" %} {% trans "Observed duration" %} {% trans "Cause" %} {% trans "Actions" %}
{{ incident.monitor.name }} {% if incident.state == 'recovered' %}{% trans "RECOVERED" %}{% elif incident.state == 'acknowledged' %}{% trans "ACKNOWLEDGED" %}{% else %}{% trans "OPEN" %}{% endif %}
{{ incident.first_confirmed_failure_at|date:"M d, H:i:s"|default:"—" }}{% trans "first confirmed failure" %}
{{ incident.first_confirmed_recovery_at|date:"M d, H:i:s"|default:"—" }}{% if incident.is_ongoing %}{% trans "Still ongoing" %}{% else %}{% trans "recovered" %}{% endif %}
{{ incident.duration_seconds|floatformat:0 }}s {{ incident.cause|default:"—" }}
{% if can_view_logs %}{% trans "View logs" %}{% endif %}{% if can_manage_availability and incident.is_ongoing %}
{% csrf_token %}
{% endif %}
{% else %}
{% trans "No incidents recorded" %} {% trans "Confirmed incident transitions will appear here once monitors begin reporting." %}
{% endif %}
{% endblock %} {% block page_scripts %} {% endblock %}