{% extends "base.html" %} {% block title %}Vue réseau{% endblock %} {% block content %}

Vue réseau

Vue locale
{% macro instance_section(inst_name, inst_url, jobs_data, inst_id=None, inst_status=None, last_seen=None) %}

{{ inst_name }}

{% if inst_id %} {% set sc = {'online':'bg-green-100 text-green-700','error':'bg-red-100 text-red-700','offline':'bg-gray-100 text-gray-500'} %} {{ inst_status or 'unknown' }} {% if last_seen %} {% endif %} {% else %} local {% endif %} {% if inst_url %} {% endif %}
{% if inst_id %} {% endif %}
{% if not jobs_data %}
{% if inst_id %} Aucune donnée — cliquez sur "Sync" pour récupérer l'état de cette instance. {% else %} Aucun job configuré. Créer un job → {% endif %}
{% else %}
{% for row in jobs_data %} {% endfor %}
Job Type Dernière exéc. Statut Taille Actions
{{ row.name }} {{ row.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_human is defined %}{{ row.last_size_human }} {% elif row.size_human is defined %}{{ row.size_human }} {% else %}—{% endif %}
{% if inst_id and row.job_id %}
{% elif not inst_id and row.job_id %}
{% endif %} {% if inst_id and row.job_id %}
{% endif %}
{% endif %}
{% endmacro %} {# ── Instance locale ─────────────────────────────────────────────── #} {{ instance_section(instance_name, instance_url, local_jobs_data) }} {# ── Instances distantes ──────────────────────────────────────────── #} {% if not instances %}

Aucune instance distante enregistrée.

Ajouter une instance →
{% else %} {% for inst in instances %} {{ instance_section(inst.name, inst.url_display, inst.remote_runs, inst_id=inst.id, inst_status=inst.status, last_seen=inst.last_seen) }} {% endfor %} {% endif %} {% endblock %}