{% extends "panel/base.html" %} {% block title %}Health — JQC Control{% endblock %} {% block page_title %}System Health{% endblock %} {% block extra_css %} {% endblock %} {% block content %} {# ── Summary stat cards ── #}
Total Tenants
{{ stats.total }}
Active
{{ stats.active }}
Suspended
{{ stats.suspended }}
Schema Behind
{{ stats.schema_behind }}
{# ── Subscription breakdown + trial alerts ── #}
Subscription Breakdown
{% for key, count in stats.sub_counts.items() %}
{{ key }} {{ count }}
{% endfor %}
Trial Alerts
{% if stats.trial_expired %}
{{ stats.trial_expired }} trial{{ 's' if stats.trial_expired != 1 }} expired — workspace locked
{% endif %} {% if stats.trial_expiring_soon %}
{{ stats.trial_expiring_soon }} trial{{ 's' if stats.trial_expiring_soon != 1 }} expiring within 3 days
{% endif %} {% if not stats.trial_expired and not stats.trial_expiring_soon %} All trials healthy. {% endif %}
{# ── Tenant table ── #}
All Tenants Schema HEAD: {{ chain_head or '?' }}
{% for r in rows %} {% else %} {% endfor %}
# Slug / Name Status Plan Subscription Trial / Period Stripe Schema Created
{{ r.id }}
{{ r.slug }}
{{ r.name }}
{{ r.status }} {{ r.plan_name }} {{ r.subscription_status or '—' }} {% if r.subscription_status == 'past_due' %} {% endif %} {% if r.subscription_status == 'trial' and r.trial_ends_at %} {% if r.trial_expired %} Expired {% elif r.trial_days_left <= 3 %} {{ r.trial_days_left }}d left {% else %} {{ r.trial_ends_at.strftime('%Y-%m-%d') }} {% endif %} {% elif r.current_period_end %} {{ r.current_period_end.strftime('%Y-%m-%d') }} {% else %} {% endif %} {% if r.has_stripe %} {% else %} {% endif %} {% if r.schema_ok is none %} ? {% elif r.schema_ok %} {% else %} {{ (r.alembic_head or '?')[:10] }}… {% endif %} {{ r.created_at.strftime('%Y-%m-%d') if r.created_at else '—' }} Detail
No tenants.
Refreshes on page load only. Schema status read from control DB cache (run Detail → Upgrade to live-check).
{% endblock %}