{% extends "base.html" %} {% set active_page = "dashboard" %} {% block title %}FaultRay - Dashboard{% endblock %} {% block page_title %}Dashboard{% endblock %} {% block page_subtitle %}Infrastructure health overview{% endblock %} {% block top_actions %} {% if has_data %} Run Analysis {% endif %} {% endblock %} {% block content %}
{% set res_score = dashboard.resilience_score if dashboard else (summary.resilience_score if summary else 0) %} {% if res_score >= 80 %} {% set res_color = "var(--green)" %} {% set res_label = "Healthy" %} {% elif res_score >= 60 %} {% set res_color = "var(--yellow)" %} {% set res_label = "At Risk" %} {% else %} {% set res_color = "var(--red)" %} {% set res_label = "Critical" %} {% endif %}
{{ res_score }} {{ res_label }}
Resilience Score
{{ dashboard.sparkline if dashboard and dashboard.sparkline else "_ _ _ _" }}
{% set sla_val = dashboard.sla_estimate if dashboard else (summary.availability_nines if summary and summary.availability_nines is defined else "99.9") %} {% set sla_str = sla_val | string %} {% if sla_str >= "99.99" %} {% set sla_color = "var(--green)" %} {% elif sla_str >= "99.9" %} {% set sla_color = "var(--blue, #58a6ff)" %} {% else %} {% set sla_color = "var(--yellow)" %} {% endif %}
{{ sla_str }}%
SLA Estimate
Estimated availability
{% set spof = dashboard.spof_count if dashboard else 0 %} {% if spof == 0 %} {% set spof_color = "var(--green)" %} {% set spof_severity = "None detected" %} {% elif spof <= 2 %} {% set spof_color = "var(--yellow)" %} {% set spof_severity = "Moderate risk" %} {% else %} {% set spof_color = "var(--red)" %} {% set spof_severity = "High risk" %} {% endif %}
{{ spof }}
SPOF Count
{{ spof_severity }}
{% set maturity = dashboard.sre_maturity_level if dashboard else 2 %}
L{{ maturity }}
SRE Maturity
{% if maturity >= 5 %}Exemplary {% elif maturity >= 4 %}Advanced {% elif maturity >= 3 %}Defined {% elif maturity >= 2 %}Managed {% else %}Initial{% endif %}

Risk Distribution

Heat Map →
{% set rd = dashboard.risk_distribution if dashboard else {"critical": 0, "high": 0, "medium": 0, "low": 0} %} {% set rd_total = rd.critical + rd.high + rd.medium + rd.low %}
{% if rd_total > 0 %} {% if rd.critical > 0 %}
{{ rd.critical }}
{% endif %} {% if rd.high > 0 %}
{{ rd.high }}
{% endif %} {% if rd.medium > 0 %}
{{ rd.medium }}
{% endif %} {% if rd.low > 0 %}
{{ rd.low }}
{% endif %} {% else %}
No data
{% endif %}
Critical ({{ rd.critical }}) High ({{ rd.high }}) Medium ({{ rd.medium }}) Low ({{ rd.low }})
{% set cb = dashboard.component_breakdown if dashboard else (summary.component_types if summary else {}) %} {% set cb_total = cb.values() | list | sum if cb else 0 %} {% set donut_colors = ["#58a6ff", "#3fb950", "#f0883e", "#bc8cff", "#d29922", "#f85149", "#79c0ff", "#56d364"] %} {% if cb_total > 0 %}
{% set ns = namespace(offset=0) %}
{{ cb_total }}
{% for type_name, count in cb.items() %}
{{ type_name | replace("_", " ") | title }} ({{ count }})
{% endfor %}
{% endif %}

Key Metrics

{% set qs = dashboard.quick_stats if dashboard else {} %}
{{ summary.total_components if summary else 0 }}
Components
{{ summary.total_dependencies if summary else 0 }}
Dependencies
{{ qs.failover_pct if qs and qs.failover_pct is defined else "0" }}%
Failover
{{ qs.circuit_breaker_pct if qs and qs.circuit_breaker_pct is defined else "0" }}%
CB Coverage
{{ qs.autoscaling_pct if qs and qs.autoscaling_pct is defined else "0" }}%
Autoscale
{{ qs.monitoring_pct if qs and qs.monitoring_pct is defined else "0" }}%
Monitored

Recent Activity

{% set activities = dashboard.recent_activity if dashboard and dashboard.recent_activity else [] %} {% if activities %} {% for act in activities %}
{% if act.type == "sim" %} {% elif act.type == "alert" %} {% elif act.type == "score" %} {% else %} {% endif %}
{{ act.message }}
{{ act.time if act.time else "just now" }}
{% endfor %} {% else %} {% if report %}
Simulation completed: {{ report.total_scenarios }} scenarios evaluated
Score: {{ report.resilience_score }}
{% if report.critical_count > 0 %}
{{ report.critical_count }} critical findings detected
Requires attention
{% endif %} {% else %}
No activity yet. Run your first simulation to start.
Getting started
{% endif %} {% endif %}

Compliance Overview

Details →
{% set cs = dashboard.compliance_scores if dashboard else {"dora": 0, "soc2": 0, "hipaa": 0, "iso27001": 0} %}
{% for fw, score in cs.items() %} {% set circumference = 138.2 %} {% if score >= 80 %}{% set meter_color = "#3fb950" %} {% elif score >= 60 %}{% set meter_color = "#d29922" %} {% else %}{% set meter_color = "#f85149" %}{% endif %}
{{ fw | upper }}
{{ score }}%
{% endfor %}

Incident Readiness

{% set qs = dashboard.quick_stats if dashboard else {} %} {% set failover_pct = qs.failover_pct if qs and qs.failover_pct is defined else 0 %} {% set monitoring_pct = qs.monitoring_pct if qs and qs.monitoring_pct is defined else 0 %} {% set readiness = ((failover_pct + monitoring_pct) / 2) | round(0) | int %} {% if readiness >= 70 %}{% set r_color = "var(--green)" %} {% elif readiness >= 40 %}{% set r_color = "var(--yellow)" %} {% else %}{% set r_color = "var(--red)" %}{% endif %}
{{ readiness }}%
{% if failover_pct > 50 %}{% else %}{% endif %} Failover ({{ failover_pct }}%)
{% if monitoring_pct > 50 %}{% else %}{% endif %} Monitoring ({{ monitoring_pct }}%)
{% if report %} Simulated{% else %} Not simulated{% endif %}
{% set cb_pct = qs.circuit_breaker_pct if qs and qs.circuit_breaker_pct is defined else 0 %} {% if cb_pct > 30 %}{% else %}{% endif %} Circuit Breakers ({{ cb_pct }}%)

Top Risks

View All →
{% if report and report.critical | length > 0 %} {% for finding in report.critical[:5] %} {% endfor %}
Scenario Impact Est. Loss Status
{{ finding.scenario_name }} {{ finding.scenario_description[:60] }}{% if finding.scenario_description|length > 60 %}...{% endif %} {{ finding.risk_score }} ${{ "%.0f" | format(finding.risk_score * 15000) }} {% if finding.cascade.effects | length > 3 %} Critical {% else %} Warning {% endif %}
{% else %}

No critical risks detected. Run a simulation to evaluate your infrastructure.

{% endif %}

Component Status

All →
{% if summary and summary.component_types %}
{% if components is defined and components %} {% for comp in components[:20] %}
{{ comp.name[:10] }}
{% endfor %} {% else %} {% for type_name, count in summary.component_types.items() %} {% for i in range(count if count <= 4 else 4) %}
{{ type_name[:8] }}
{% endfor %} {% endfor %} {% endif %}
{% else %}

Load infrastructure to see component status.

{% endif %}
{% endblock %}