{% extends "admin-base.html" %} {% from "ui.html" import when, action, copyable with context %} {% macro state_label(state) -%} {% if state == "ok" %}{{ _("OK") }}{% elif state == "warn" %}{{ _("To check") }}{% else %}{{ _("Problem") }}{% endif %} {%- endmacro %} {% block section %}

{{ _("State of the instance") }}

{{ state_label(report.state) }}
{% for check in report.checks %}
{{ _(check.title) }}{{ _(check.message.template, **check.message.params) }}{% if check.at %} {{ when(check.at) }}{% endif %} {% if check.note %}{{ _(check.note.template, **check.note.params) }}{% endif %} {% if check.run %}{{ _(check.run.template, **check.run.params) }}{% if check.run_at %} {{ when(check.run_at) }}{% endif %}{% endif %} {% if check.tokens %}
    {% for token in check.tokens %}
  • {{ token.space.address }} {% if token.expired %}· {{ _("expired on {date}", date=token.expires|day) }}{% else %}· {% if token.days <= 0 %}{{ _("expires today, {date}", date=token.expires|day) }}{% elif token.days == 1 %}{{ _("expires on {date} (tomorrow)", date=token.expires|day) }}{% else %}{{ _(pl(token.days, "expires on {date} (in {n} day)", "expires on {date} (in {n} days)"), n=token.days, date=token.expires|day) }}{% endif %}{% endif %}
  • {% endfor %}
{% endif %} {% if check.command %}{{ copyable("health-command-" ~ loop.index, check.command) }}{% endif %} {% if check.guide %}{% if check.guide == "git" %}{{ _("How to renew a Git access token") }}{% else %}{{ _("How to set up the backups") }}{% endif %}{% endif %}
{{ state_label(check.state) }}
{% endfor %}
{% if can_back_up %}
{% if backup_pending %}

{{ _("A backup is waiting or running.") }}

{% else %}{{ action("/admin/health/backup", _("Back up now")) }}

{{ _("Archive verified, then off-site copy if set up: made by the worker, in a moment.") }}

{% endif %}
{% endif %}

{{ _("Prometheus metrics: on, at /metrics.") if metrics_on else _("Prometheus metrics: off (METRICS_TOKEN).") }}

{{ _("Spaces") }} {{ report.spaces|length }}

{% if report.spaces %}
{% for row in report.spaces %} {% set space = row.space %} {% endfor %}
{{ _("Space") }}{{ _("Git sync") }}{{ _("Last tidy-up") }}{{ _("Inbox") }}
{{ space.address }} {% if not space.repo_url %}{{ _("No repository") }} {% elif space.sync_status == "conflict" %}{{ _("Conflict") }} {% elif space.sync_status == "error" %}{{ _("Failed") }} {% elif space.synced_at %}{{ when(space.synced_at) }} {% else %}{{ _("Not synchronized yet") }}{% endif %} {% if row.last_tidy is none %}{{ _("None yet") }} {% else %}{% if row.last_tidy.status == "failed" %}{{ _("Failed") }} {% endif %}{{ when(row.last_tidy.finished_at) }}{% endif %} {{ row.waiting if row.waiting is not none else "—" }}
{% else %}

{{ _("No space yet.") }}

{% endif %}

{{ _("System alerts") }} {{ report.alerts|length }}

{{ _("The last 30 days, at most 50. Organization administrators get them by email.") }}

{% if report.alerts %}
{% for alert in report.alerts %}
{{ _(alert.title) }} {{ when(alert.at) }}{% if alert.space %} · {{ alert.space.address }}{% elif alert.organization %} · {{ alert.organization.name }}{% endif %} {% if alert.error %}{{ alert.error }}{% endif %} {% if alert.date %}{{ _("Expiry date: {value}", value=alert.date) }}{% endif %}
{% endfor %}
{% else %}

{{ _("No alert.") }}

{% endif %}
{% endblock %}