{% 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.
#}
{% if active_runs %}Active runs{% else %}Recent runs{% endif %}
{% 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 %}