{% set current_sort = sort | default('queued_at') %} {% set current_direction = direction | default('desc') %} {# Macro for sortable column header #} {% macro sort_header(label, col_name, align='left') %} {% set is_active = current_sort == col_name %} {% set next_dir = 'asc' if (is_active and current_direction == 'desc') else 'desc' %} {{ label }} {% if is_active %} {{ '▲' if current_direction == 'asc' else '▼' }} {% endif %} {% endmacro %}

Sync History

{% if last_completed_sync %} Last sync: {{ last_completed_sync.completed_at | timeago }} {% else %} No syncs yet {% endif %}

{% if sync_history %}
{{ sort_header('Status', 'status') }} {{ sort_header('Queued', 'queued_at') }} {{ sort_header('Started', 'started_at') }} {{ sort_header('Completed', 'completed_at') }} {{ sort_header('Jobs', 'jobs', align='right') }} {{ sort_header('Manifests', 'manifests', align='right') }} {% for sync in sync_history %} {% endfor %}
Duration
{% set status_label = sync | sync_status_label %} {{ status_label }} {{ sync.queued_at.strftime('%Y-%m-%d %H:%M:%S') if sync.queued_at else '-' }} {{ sync.started_at.strftime('%Y-%m-%d %H:%M:%S') if sync.started_at else '-' }} {{ sync.completed_at.strftime('%Y-%m-%d %H:%M:%S') if sync.completed_at else '-' }} {% if sync.started_at and sync.completed_at %} {{ ((sync.completed_at - sync.started_at).total_seconds()) | round(1) }}s {% elif sync.started_at %} Running... {% else %} - {% endif %} {{ sync.jobs_retrieved_count or 0 }} {{ sync.manifests_updated_count or 0 }}
{# Pagination controls #} {% if total_count|default(0) > 0 %} {% set start_idx = (page - 1) * 10 + 1 %} {% set end_idx = [page * 10, total_count] | min %}

Showing {{ start_idx }} to {{ end_idx }} of {{ total_count }} results

{% if total_pages > 1 %} {% endif %}
{% endif %} {% else %}

No sync history yet. Click "Sync Now" to start your first sync.

{% endif %}