| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- {% extends "base.html" %}
- {% block title %}Historique — {{ job.name }}{% endblock %}
- {% block content %}
- <div class="mb-6 flex items-center gap-4">
- <a href="{{ url_for('index') }}" class="text-gray-400 hover:text-gray-600 text-sm">← Dashboard</a>
- <h1 class="text-xl font-bold text-gray-900">{{ job.name }}</h1>
- <span class="bg-gray-100 text-gray-600 text-xs px-2 py-0.5 rounded font-mono">{{ job.type }}</span>
- <span class="text-gray-400 text-sm font-mono">{{ job.cron_expr }}</span>
- </div>
- <div class="bg-white rounded-xl border border-gray-200 shadow-sm overflow-hidden">
- <div class="px-6 py-4 border-b border-gray-100">
- <h2 class="text-sm font-semibold text-gray-700">
- Historique des exécutions
- <span class="text-gray-400 font-normal">({{ runs | length }} entrées)</span>
- </h2>
- </div>
- {% if not runs %}
- <div class="px-6 py-10 text-center text-gray-400 text-sm">
- Aucune exécution enregistrée pour ce job.
- </div>
- {% else %}
- <div class="overflow-x-auto">
- <table class="w-full text-sm">
- <thead>
- <tr class="text-xs text-gray-500 uppercase tracking-wide bg-gray-50">
- <th class="px-6 py-3 text-left font-medium">Début</th>
- <th class="px-6 py-3 text-left font-medium">Fin</th>
- <th class="px-6 py-3 text-left font-medium">Durée</th>
- <th class="px-6 py-3 text-left font-medium">Statut</th>
- <th class="px-6 py-3 text-left font-medium">Archive</th>
- <th class="px-6 py-3 text-left font-medium">Taille</th>
- <th class="px-6 py-3 text-left font-medium">Log</th>
- </tr>
- </thead>
- <tbody class="divide-y divide-gray-100">
- {% for run in runs %}
- <tr class="hover:bg-gray-50">
- <td class="px-6 py-3 text-xs text-gray-700 whitespace-nowrap">
- {{ run.started_at.strftime('%d/%m/%Y %H:%M:%S') if run.started_at else '—' }}
- </td>
- <td class="px-6 py-3 text-xs text-gray-500 whitespace-nowrap">
- {{ run.finished_at.strftime('%H:%M:%S') if run.finished_at else '—' }}
- </td>
- <td class="px-6 py-3 text-xs text-gray-500">
- {% if run.duration_seconds is not none %}
- {% if run.duration_seconds >= 60 %}
- {{ (run.duration_seconds // 60) }}min {{ run.duration_seconds % 60 }}s
- {% else %}
- {{ run.duration_seconds }}s
- {% endif %}
- {% else %}
- —
- {% endif %}
- </td>
- <td class="px-6 py-3">
- {% if run.status == 'success' %}
- <span class="bg-green-100 text-green-700 text-xs font-medium px-2 py-0.5 rounded-full">✓ succès</span>
- {% elif run.status == 'error' %}
- <span class="bg-red-100 text-red-700 text-xs font-medium px-2 py-0.5 rounded-full">✗ erreur</span>
- {% elif run.status == 'running' %}
- <span class="bg-blue-100 text-blue-700 text-xs font-medium px-2 py-0.5 rounded-full animate-pulse">⟳ en cours</span>
- {% else %}
- <span class="text-gray-400 text-xs">{{ run.status or '—' }}</span>
- {% endif %}
- </td>
- <td class="px-6 py-3 text-xs font-mono text-gray-600">
- {{ run.archive_name or '—' }}
- </td>
- <td class="px-6 py-3 text-xs text-gray-500">
- {{ run.size_human if run.size_bytes else '—' }}
- </td>
- <td class="px-6 py-3">
- {% if run.log_text %}
- <details>
- <summary class="cursor-pointer text-xs text-blue-600 hover:underline">Voir</summary>
- <pre class="mt-2 text-xs bg-gray-900 text-gray-100 p-3 rounded-lg overflow-x-auto max-w-xl whitespace-pre-wrap">{{ run.log_text }}</pre>
- </details>
- {% else %}
- <span class="text-gray-300 text-xs">—</span>
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- {% endif %}
- </div>
- {% endblock %}
|