{% extends "base.html" %} {% from '_glossary.html' import cron_friendly %} {% block title %}{{ resource.name }} - Supavision{% endblock %} {% block content %} {# ── Breadcrumb ── #} {# ── Header ── #} {# ── Live Output Terminal ── #} {% if active_run %} {# STATE: RUNNING or PENDING — live SSE stream #}

Live Output

{{ active_run.status }} {% if active_run.started_at %} 0s {% endif %}
{% elif last_run and last_run.status.value == 'failed' and (last_run.output or last_run.error) %} {# STATE: FAILED — frozen output with error #} {% set retry_url = '/resources/' + resource.id + ('/discover' if last_run.run_type.value == 'discovery' else '/health-check') %}

Last Run

Failed {% if last_run.completed_at and last_run.started_at %} {{ ((last_run.completed_at - last_run.started_at).total_seconds() | int) }}s {% endif %}
{% if last_run.recording %}
{% elif last_run.output %}
{{ last_run.output[-3000:] }}
{% endif %} {% if last_run.error %}
{{ last_run.error }}
{% endif %}
{% elif last_run and last_run.status.value == 'completed' and last_run.recording %} {# STATE: COMPLETED — replay terminal #}

Last Run

Completed {% if last_run.completed_at and last_run.started_at %} {{ ((last_run.completed_at - last_run.started_at).total_seconds() | int) }}s {% endif %}
{% endif %} {# IDLE: no live output section rendered #} {# ── Action Card (shown when something needs attention) ── #} {% if severity == 'critical' and latest_eval %}
{{ latest_eval.summary }}
Investigate and resolve the issue, then click Verify Fix to confirm. {% if runs and runs[0].started_at %} Detected {{ runs[0].started_at }}. {% endif %}
{% if runs and runs[0].report_id %} Read Report {% endif %}
{% elif severity == 'warning' and latest_eval %}
{{ latest_eval.summary }}
This may resolve on its own or escalate. Review the report for details.
{% if runs and runs[0].report_id %} Read Report {% endif %}
{% endif %} {# ── Claude CLI warning (SSH resources without engine) ── #} {% if resource.resource_type in ('server', 'database') and not engine_available %}
Infrastructure monitoring unavailable — Claude CLI is not installed. Discovery and health checks require Claude Code CLI. Install it in Settings →
{% endif %} {# ── Setup prompt (new resource, no data yet) ── #} {% if is_new and not context %}
Resource created! Click Diagnose above to explore this {{ resource.resource_type }}. Claude will map services, databases, and configurations (1-3 minutes).
{% endif %} {# ── Overview ── #}
{% if resource.config.path %}
Path {{ resource.config.path }}
{% elif resource.config.ssh_host %}
Host {{ resource.config.ssh_user or 'ubuntu' }}@{{ resource.config.ssh_host }}:{{ resource.config.ssh_port or '22' }}
{% endif %}
Last Check {% if runs %} {{ runs[0].started_at }} {% else %} Never {% endif %}
{% if health_cron %}
Schedule {{ cron_friendly(health_cron) }}{% if next_health_check %} · next: {{ next_health_check }}{% endif %}
{% endif %}
{% if health_grid %}

Each cell is one day. Color shows the worst severity recorded that day.

{% for day in health_grid %}
{% endfor %}
{% endif %}
{# ── Recent Activity ── #} {% if runs %}

Recent Activity Full history →

Health checks and discoveries for this resource.

{% for run in runs[:5] %}
{{ run.started_at }}
{{ run.run_type }} {% if run.severity %} {{ run.severity }} {% else %} {{ run.status }} {% endif %} {% if run.diff_new or run.diff_resolved %} {% if run.diff_new %}+{{ run.diff_new }}{% endif %} {% if run.diff_resolved %}−{{ run.diff_resolved }}{% endif %} {% endif %} {% if run.report_id %} Read report {% endif %}
{% if run.error %}
{{ run.error[:100] }}
{% endif %}
{% endfor %}
{% if has_more_runs %} Older activity → {% endif %}
{% endif %} {# ── Details (collapsed) ── #} {% if context or checklist or alert_history %}
Details {% if context %}
Baseline (v{{ context.version }})
{{ context_html | safe }}
{% endif %} {% if checklist %}
Checklist ({{ checklist.items | length }} items)
{% endif %} {% if alert_history %}
Alert History ({{ alert_history | length }}) {% for a in alert_history %} {% endfor %}
TimeSeveritySummary
{{ a.created_at }} {{ a.severity }} {{ a.summary }}
{% endif %}
{% endif %} {% endblock %}