{% extends "base.html" %} {% from "_page_header.html" import page_header %} {% from "_components.html" import badge, identifier, pagination, empty_state, kv, operations_journey %} {% block content %} {% call page_header(source.name, kind_labels.get(source.kind.value, source.kind.value) ~ " source feeding " ~ (overview.space_name or "an unknown space") ~ ".") %} {% if can_manage %}
{% if source.syncable and source.status.value == "active" %}
{% endif %} {% if not source.is_builtin_uploads %} {% if can_manage_filesystem or source.kind.value not in ("folder", "git") %} Edit {% endif %} {% if source.status.value == "active" %}
{% elif source.status.value == "paused" %}
{% endif %} {% if source.status.value != "deleted" %}
{% endif %} {% endif %}
{% endif %} {% endcall %} {% if notice %}

{{ notice }}

{% endif %} {{ operations_journey(source_url="/admin/sources/" ~ source.id, source_label=source.name, document_url="/admin/documents?source_id=" ~ source.id, current="source") }}

Overview

Status
{% if source.status.value == "active" %}{{ badge("Active", "ok") }}{% elif source.status.value == "paused" %}{{ badge("Paused", "warn") }}{% else %}{{ badge("Deleted", "neutral") }}{% endif %} {% set sync_badge = sync_badges.get(source.sync_state.value) %} {% if sync_badge %}{{ badge(sync_badge[0], sync_badge[1]) }}{% endif %}
{{ kv("Type", kind_labels.get(source.kind.value, source.kind.value)) }} {{ kv("Knowledge space", overview.space_name or source.space_id) }} {{ kv("Documents (active)", overview.document_count) }} {{ kv("Created", source.created_at.strftime("%Y-%m-%d %H:%M") if source.created_at else None) }} {{ kv("Last sync", source.last_sync_at.strftime("%Y-%m-%d %H:%M") if source.last_sync_at else ("Never" if source.syncable else "Not applicable — fed by uploads")) }} {{ kv("Last successful sync", source.last_successful_sync_at.strftime("%Y-%m-%d %H:%M") if source.last_successful_sync_at else None) }} {{ kv("Sync schedule", ("Every " ~ (source.sync_interval_seconds // 60) ~ " minutes") if source.sync_interval_seconds else ("Manual — runs only when you press Sync now" if source.syncable else "Not applicable — fed by uploads")) }} {% if next_sync_due %}{{ kv("Next sync due", next_sync_due.strftime("%Y-%m-%d %H:%M")) }}{% endif %} {% if source.last_sync_error %}{{ kv("Last sync error", source.last_sync_error, mono=True) }}{% endif %} {% if source.last_revision %}{{ kv("Last revision", source.last_revision, mono=True) }}{% endif %}
Source ID
{{ identifier(source.id, "source-id", short=36) }}
{% if source.kind.value == "upload" %}

Upload sources are fed by their callers (the Control Plane upload form, the upload API, sync clients); there is nothing for the worker to sync.

{% endif %}

Configuration

{% if config_rows %}
{% for label, value in config_rows %}{{ kv(label, value, mono=(label in ("root", "checkout root", "repository", "ref"))) }}{% endfor %}
{% else %}

No configuration.

{% endif %}

Configurations are stored secret-free; credentials never live in the registry.

Sync history

{% if not runs %}

{% if source.syncable %}No sync has run yet.{% else %}Upload sources are not synchronised.{% endif %}

{% else %}
    {% for run in runs %}
  1. {{ run.started_at.strftime("%Y-%m-%d %H:%M") }} {% set run_badge = run_badges.get(run.outcome.value, (run.outcome.value | replace("_", " ") | title, "neutral")) %} {{ badge(run_badge[0], run_badge[1]) }}

    {{ run.discovered }} discovered · {{ run.new }} new · {{ run.changed }} changed · {{ run.unchanged }} unchanged · {{ run.removed }} removed{% if run.failed %} · {{ run.failed }} failed{% endif %}

    {% if run.error_code %}

    {{ run.error_code }}

    {% endif %} {% if run.revision %}

    revision {{ run.revision[:12] }}

    {% endif %}
  2. {% endfor %}
{% endif %}
{% if overview.failed_items %}

Ingest failed

{% for entry in overview.failed_items %} {% endfor %}
Items of {{ source.name }} that failed to ingest
Item Failure Retryable Recovery
{{ entry.external_id }} {{ entry.last_failure_code }} {% if entry.last_failure_retryable %}Yes{% elif entry.last_failure_retryable is none %}Unknown{% else %}No{% endif %} {% if entry.last_failure_job_id in reachable_job_ids %}Open the failed ingest job {% elif entry.last_failure_job_id %}The recorded job is unavailable; modify the source content, then sync again. {% else %}Modify the source content, then sync again.{% endif %}
{% endif %}

Documents

Open in Documents
{% if not documents.items %}

No documents from this source yet.{% if source.syncable and can_manage %} Run a sync to discover and ingest its content.{% endif %}

{% else %}
{% for item in documents.items %} {% endfor %}
Documents of {{ source.name }}
Document Item State Updated
{{ item.document.title }} {{ item.document.external_id }} {% if item.document.source_deleted %}{{ badge("Retired", "neutral") }} {% elif item.searchable %}{{ badge("Searchable", "ok") }} {% elif item.failed %}{{ badge("Failed", "error") }} {% elif item.latest_state %}{{ badge("Processing", "info") }} {% else %}{{ badge("No version", "neutral") }}{% endif %} {{ item.updated_at.strftime("%Y-%m-%d %H:%M") if item.updated_at else "—" }}
{{ pagination(documents.total, documents.limit, documents.offset, "/admin/sources/" ~ source.id, "") }} {% endif %}
{% endblock %}