{% from '_status.html' import status_dot, status_bar %}
{#
Landing-page body: active runs first (that is what the page is for),
backends underneath. Rendered standalone by /overview/stream, so it must
not depend on anything overview.html sets up beyond the context keys.
#}
{#
Activity heatmap. Indigo rather than GitHub's green: in this app green
already means "completed", and indigo is what running work is drawn in
everywhere else — so shade reads as "how much ran", not "how much passed".
#}
{% set LEVELS = [
'bg-gray-100',
'bg-indigo-200',
'bg-indigo-400',
'bg-indigo-600',
'bg-indigo-800',
] %}
Activity · last {{ activity.window_days }} days
CPU-hours per day
{% for col, label in activity.month_labels %}
{{ label }}
{% endfor %}
{% for label in ['Mon', '', 'Wed', '', 'Fri', '', ''] %}
{{ label }}
{% endfor %}
{% for week in activity.weeks %}
{% for day in week %}
{% if day %}
{% else %}
{# Before the window starts, or later this week. #}
{% endif %}
{% endfor %}
{% for name, backend in backends.items() %}
{% set u = backend_usage.get(name, {}) %}
{% set q = backend.status.cluster_info.user_quota if backend.status.cluster_info else None %}
{% endif %}
{% if backend.status.disk_total_bytes and backend.status.disk_avail_bytes is not none %}
{% set disk_pct = ((backend.status.disk_total_bytes - backend.status.disk_avail_bytes) * 100 / backend.status.disk_total_bytes) | round(0, 'floor') | int %}
Disk
{{ disk_pct }}% used · {{ backend.status.disk_avail_bytes | disk_bytes }} free
{% endif %}
{% if q and (q.fair_share is not none or q.account) %}
{% if q.fair_share is not none %}
fair-share
{{ '%.2f'|format(q.fair_share) }}
{% endif %}
{% if q.account %}
account {{ q.account }}
{% endif %}