{% extends "base.html" %} {% block title %}{{ replica.name }} — pngx-controller{% endblock %} {% block content %}

{{ replica.name }}

{% if replica.suspended_at %} {% endif %} {% if replica.enabled and not replica.suspended_at %} {% endif %}
URL
{{ replica.url }}
Status
{% if replica.suspended_at %} suspended
{{ replica.consecutive_failures }} consecutive failures
{% elif replica.last_sync_ts %} synced {% else %} pending {% endif %}
Last sync
{% if replica.last_sync_ts %} {{ replica.last_sync_ts.strftime('%Y-%m-%d %H:%M:%S') }} UTC
{{ lag }}
{% else %} never {% endif %}
Interval
{% if replica.sync_interval_seconds %}{{ replica.sync_interval_seconds }}s{% else %}global{% endif %}

Sync Run History (last 20)

{% if recent_runs %}
{% for run in recent_runs %} {% endfor %}
#StartedDurationSyncedFailedTriggered by
{{ run.id }} {{ run.started_at.strftime('%Y-%m-%d %H:%M:%S') if run.started_at else '—' }} {% if run.started_at and run.finished_at %} {% set dur = (run.finished_at - run.started_at).total_seconds()|int %} {% if dur < 60 %}{{ dur }}s {% else %}{{ dur // 60 }}m {{ dur % 60 }}s{% endif %} {% elif run.started_at %} running {% else %}—{% endif %} {{ run.docs_synced }} {% if run.docs_failed %} {{ run.docs_failed }} {% else %}0{% endif %} {{ run.triggered_by }} {% if run.timed_out %}timed out{% endif %}
{% else %}

No sync runs yet.

{% endif %}

Sync Map (last 50)

{% if sync_map_page %}
{% for entry in sync_map_page %} {% endfor %}
Master IDReplica IDStatusLast syncedRetriesError
{{ entry.master_doc_id }} {{ entry.replica_doc_id or '—' }} {{ entry.status }} {{ entry.last_synced.strftime('%Y-%m-%d %H:%M') if entry.last_synced else '—' }} {{ entry.retry_count }} {{ entry.error_msg or '' }}
{% else %}

No sync map entries yet.

{% endif %}
Danger Zone

Full resync wipes the sync map for this replica and re-syncs everything from scratch.

Promote {{ replica.name }} to Master

{{ replica.url }}

Checking pre-flight conditions…

{% endblock %}