{% extends "base.html" %} {% block title %}Dashboard{% endblock %} {% block content %} {# ── Statistiques rapides ─────────────────────────────────────────────────── #} {% set total = jobs | length %} {% set enabled_count = jobs | selectattr('enabled') | list | length %} {% set recent_runs = last_runs.values() | select | list %} {% set success_count = recent_runs | selectattr('status', 'equalto', 'success') | list | length %} {% set error_count = recent_runs | selectattr('status', 'equalto', 'error') | list | length %} {% set running_count = recent_runs | selectattr('status', 'equalto', 'running') | list | length %}

Jobs

{{ total }}

{{ enabled_count }} actifs

Succès

{{ success_count }}

dernière exécution

Erreurs

{{ error_count }}

dernière exécution

En cours

{{ running_count }}

actuellement

{# ── Table des jobs ───────────────────────────────────────────────────────── #}

Jobs de sauvegarde

{% if not jobs %}

Aucun job configuré.

Créer le premier job →
{% else %}
{% for job in jobs %} {% set run = last_runs.get(job.id) %} {% endfor %}
Nom Type Planification Transfert Dernière exéc. Statut Taille Actions
{{ job.name }} {{ job.type }} {% if job.cron_expr %}{{ job.cron_expr }} {% else %}Manuel{% endif %} {% if job.destination %} {{ job.destination.name }} {% else %} Local {% endif %} {% if run and run.started_at %} {{ run.started_at.strftime('%d/%m/%Y %H:%M') }} {% else %} Jamais {% endif %} {% if run %} {% if run.status == 'success' %} ✓ succès {% elif run.status == 'error' %} ✗ erreur {% elif run.status == 'running' %} ⟳ en cours {% endif %} {% else %} {% endif %} {% if run and run.size_bytes %}{{ run.size_human }}{% else %}—{% endif %}
Historique Éditer
{% endif %}
{# ── Serveurs fédérés ─────────────────────────────────────────────── #} {% if instances %}

Serveurs fédérés

{% for inst in instances %} {% set sc = {'online':'bg-green-100 text-green-700','error':'bg-red-100 text-red-700','offline':'bg-gray-100 text-gray-500'} %}
{{ inst.name }} {{ inst.status or 'unknown' }} {% if inst.last_seen %} {% endif %}
{% if not inst.remote_runs %}
Aucune donnée — cliquez sur "Sync" pour récupérer l'état.
{% else %}
{% for row in inst.remote_runs %} {% endfor %}
Nom Type Dernière exéc. Statut Taille Actions
{{ row.job_name }} {{ row.job_type }} {% if row.last_run_at %}{{ row.last_run_at.strftime('%d/%m/%Y %H:%M') }} {% else %}Jamais{% endif %} {% if row.last_status == 'success' %} ✓ succès {% elif row.last_status == 'error' %} ✗ erreur {% elif row.last_status == 'running' %} ⟳ en cours {% else %} {% endif %} {% if row.last_size_bytes %}{{ row.last_size_human }}{% else %}—{% endif %}
{% if row.job_id %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %} {% endblock %} {% block scripts %} {% endblock %}