{% extends "base.html" %}
{% from "components/ui.html" import card, empty, fact, facts, webhook_state %}
{% block title %}Status · {{ APP_NAME }}{% endblock %}
{% block heading %}Status{% endblock %}
{% block subheading %}
What the service knows, without asking any provider. Since the last start.
{% endblock %}
{% block content %}
{% call card("Accounts", meta=service.accounts | length, tight=True) %}
{% if service.accounts %}
{% else %}{{ empty("No account you may list.") }}{% endif %}
{% endcall %}
{% set worker = service.worker %}
{% set state %}{% if worker is none %}switched off{% else %}running{% endif %}{% endset %}
{% call facts("Sync worker", tags=state) %}
{% if worker is none %}
{% call fact("Why") %}MAILBOX_SERVICE_SYNC_INTERVAL is 0. Ids stay current only when mail is read.{% endcall %}
{% else %}
{% call fact("Interval") %}every {{ worker.interval | round | int }} seconds{% endcall %}
{% call fact("Push") %}{% if worker.push %}IDLE where the server offers it, {{ worker.watching | length }} of at most {{ worker.watchers }} watched now{% else %}switched off, polling only{% endif %}{% endcall %}
{% call fact("Last pass") %}{% if worker.last_pass_at %}{{ worker.last_pass_at | when }}{% else %}not finished yet{% endif %}{% endcall %}
{% endif %}
{% endcall %}
{% if can_webhooks %}
{% call card("Your webhooks", meta=service.webhooks | length, tight=True) %}
{% if service.webhooks %}
{% else %}{{ empty("No webhook yet.") }}{% endif %}
{% endcall %}
{% endif %}
{% endblock %}