diff --git a/app/templates/base.html b/app/templates/base.html index d98ba74..b0c29de 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -1,55 +1,553 @@ - + {% block title %}pngx-controller{% endblock %} - + + + -
- -
-
- {% block content %}{% endblock %} -
+
+ + + + + + + + pngx-controller + - + + + +
+ +
+ {% block content %}{% endblock %} +
+ + diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index e120153..6d91bb4 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -2,37 +2,41 @@ {% block title %}Dashboard — pngx-controller{% endblock %} {% block content %} -
-

Dashboard

-
+
+
+

Dashboard

+
+
{% if flash %} -
- {{ flash }} -
+
{{ flash }}
{% endif %} -
-
+
{% if progress.running %} - {{ progress.phase }} + {{ progress.phase }} {% if progress.docs_total > 0 %} - — {{ progress.docs_done }} / {{ progress.docs_total }} documents + {{ progress.docs_done }} / {{ progress.docs_total }} documents {% else %} @@ -42,33 +46,31 @@
- {% if last_run %} -
+
- Last sync run: + Last sync run — {% if last_run.finished_at %} - finished {{ last_run.finished_at.strftime('%Y-%m-%d %H:%M:%S') }} UTC - — {{ last_run.docs_synced }} synced, {{ last_run.docs_failed }} failed - {% if last_run.timed_out %}timed out{% endif %} + {{ last_run.finished_at.strftime('%Y-%m-%d %H:%M') }} UTC +  ·  {{ last_run.docs_synced }} synced, {{ last_run.docs_failed }} failed + {% if last_run.timed_out %} timed out{% endif %} {% else %} - running… + running… {% endif %} -

Triggered by: {{ last_run.triggered_by }} — Run #{{ last_run.id }}

+

Triggered by: {{ last_run.triggered_by }} — Run #{{ last_run.id }}

{% endif %} -
- Loading document counts… + Loading document counts…
-

Replicas

+ {% if replica_rows %}
@@ -85,29 +87,31 @@ {% for row in replica_rows %} - - + + - +
{{ row.replica.name }}{{ row.replica.url }}{{ row.replica.name }}{{ row.replica.url }} {{ row.status }} {% if row.replica.suspended_at %}
{{ row.replica.consecutive_failures }} failures {% endif %}
{{ row.lag }}{{ row.lag }} {% if row.last_run %} - ✓ {{ row.last_run.docs_synced }} - {% if row.last_run.docs_failed %} · ✗ {{ row.last_run.docs_failed }}{% endif %} + {{ row.last_run.docs_synced }} + {% if row.last_run.docs_failed %} +   {{ row.last_run.docs_failed }} + {% endif %} {% else %} never {% endif %} - Details + Details {% if row.replica.suspended_at %} -
{% else %} -

No replicas configured. Add one →

+

No replicas configured. Add one →

{% endif %} diff --git a/app/templates/partials/log_table.html b/app/templates/partials/log_table.html index 1657f4c..53d1c0b 100644 --- a/app/templates/partials/log_table.html +++ b/app/templates/partials/log_table.html @@ -13,11 +13,11 @@ {% for log in logs %} - {{ log.created_at.strftime('%Y-%m-%d %H:%M:%S') if log.created_at else '' }} + {{ log.created_at.strftime('%Y-%m-%d %H:%M:%S') if log.created_at else '' }} {{ log.level or 'info' }} - {{ log.replica_id or '' }} - {{ log.doc_id or '' }} - {{ log.message or '' }} + {{ log.replica_id or '' }} + {{ log.doc_id or '' }} + {{ log.message or '' }} {% endfor %} diff --git a/app/templates/replica_detail.html b/app/templates/replica_detail.html index 554d53c..5297ca4 100644 --- a/app/templates/replica_detail.html +++ b/app/templates/replica_detail.html @@ -9,9 +9,9 @@ -
-

{{ replica.name }}

-
+
+

{{ replica.name }}

+
{% if 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 %} -
+
+
+
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)

@@ -81,22 +86,22 @@ {% for run in recent_runs %} - {{ run.id }} - {{ run.started_at.strftime('%Y-%m-%d %H:%M:%S') if run.started_at else '—' }} - + {{ 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… + running {% else %}—{% endif %} - {{ run.docs_synced }} + {{ run.docs_synced }} {% if run.docs_failed %} {{ run.docs_failed }} - {% else %}0{% endif %} + {% else %}0{% endif %} {{ run.triggered_by }} {% if run.timed_out %}timed out{% endif %} @@ -119,12 +124,12 @@ {% for entry in sync_map_page %} - {{ entry.master_doc_id }} - {{ entry.replica_doc_id or '—' }} + {{ 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 '' }} + {{ entry.last_synced.strftime('%Y-%m-%d %H:%M') if entry.last_synced else '—' }} + {{ entry.retry_count }} + {{ entry.error_msg or '' }} {% endfor %} @@ -134,23 +139,25 @@

No sync map entries yet.

{% endif %} -
+
Danger Zone -
+

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

- - - +
+ + + +
@@ -158,19 +165,17 @@
- -

Promote {{ replica.name }} to Master

-

- {{ replica.url }} -

+ +

Promote {{ replica.name }} to Master

+

{{ replica.url }}

-
+
-

Checking pre-flight conditions…

+

Checking pre-flight conditions…

-