{% extends "base.html" %} {% from "_page_header.html" import page_header %} {% from "_components.html" import badge, identifier, pagination, empty_state, toolbar, operations_journey %} {% block content %} {% call page_header("Sources", "Where knowledge comes from: uploads, mounted folders and Git repositories, each feeding one knowledge space. Connector-backed sources are synchronised by the worker.") %} {% if can_manage and can_manage_filesystem %} Add source {% endif %} {% endcall %} {% if notice %}

{{ notice }}

{% endif %} {% if ignored_filters %}

Unrecognised {{ ignored_filters | join(" and ") }} filter{{ "s" if ignored_filters | length > 1 else "" }} ignored; all other filters remain applied.

{% endif %} {{ operations_journey(current="source") }}
{% call toolbar("/admin/sources", label="Filter sources") %}
{% endcall %} {% if not page.items %}
{% if query or page.offset %} {{ empty_state("No sources match these filters", "No source matches the applied filters on this page. Adjust the filters or return to an earlier page.", "/admin/sources?" ~ query ~ ("&" if query else "") ~ "offset=" ~ ([page.offset - page.limit, 0] | max) ~ "&limit=" ~ page.limit if page.offset else "/admin/sources", "Previous page" if page.offset else "Clear filters", icon="filter_alt_off") }} {% else %} {{ empty_state("No sources configured yet", "Add a folder or Git repository source to begin synchronised ingestion, or upload documents into a knowledge space — uploads appear here as that space's built-in Uploads source.", "/admin/sources/new" if (can_manage and can_manage_filesystem) else None, "Add source", icon="hub") }} {% endif %}
{% else %}
{% for source in page.items %} {% endfor %}
Sources in the current workspace
Name Type Space Status Documents Last sync
{{ source.name }}
{{ identifier(source.id) }}
{{ kind_labels.get(source.kind.value, source.kind.value) }} {{ spaces.get(source.space_id, "—") }} {% 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 %} {{ counts.get(source.id, 0) }} {% if source.last_sync_at %}{{ source.last_sync_at.strftime("%Y-%m-%d %H:%M") }}{% elif source.syncable %}Never{% else %}—{% endif %}
{{ pagination(page.total, page.limit, page.offset, "/admin/sources", query) }} {% endif %}
{% endblock %}