{% extends "base.html" %} {% block title %}Settings{% endblock %} {% block content %}

Settings

{# Historical Thread Indexing Section #}

history Historical Thread Indexing

Index historical threads from the Addons Marketplace to ensure all messages are synchronized, even from older threads with recent activity.

{# ── Live Status Banner (shown when running) ── #} {% set fetched = last_sync.total_threads_fetched if last_sync and last_sync.total_threads_fetched else 0 %} {% set target = last_sync.session_target if last_sync and last_sync.session_target else 0 %} {% set new_count = last_sync.new_threads_count if last_sync and last_sync.new_threads_count else 0 %} {% set upd_count = last_sync.updated_threads_count if last_sync and last_sync.updated_threads_count else 0 %} {% set pct = ((fetched / target * 100) | int) if target else 0 %}

Sync in progress...

{{ fetched }} of {{ target }} fetched · {{ new_count }} new · {{ upd_count }} updated

{% if target %}{{ pct }}%{% endif %}
{# Progress bar #}
{# ── Stats grid ── #}

Status

{% if last_sync and last_sync.status %} {% if last_sync.status == 'running' %} Running {% elif last_sync.status == 'completed' %} Completed {% elif last_sync.status == 'failed' %} Failed {% elif last_sync.status == 'paused' %} Paused {% else %} {{ last_sync.status }} {% endif %} {% else %} Not Started {% endif %}

{# Timestamp below the status word — distinguishes a stale historical result from a live one #}

{% if last_sync and last_sync.completed_at %} {{ last_sync.completed_at.strftime('%b %d, %H:%M') }} {% elif last_sync and last_sync.started_at and last_sync.status == 'running' %} In progress... {% elif last_sync and last_sync.started_at %} Started {{ last_sync.started_at.strftime('%b %d, %H:%M') }} {% endif %}

Fetched

{{ fetched }} {% if target %} / {{ target }}{% endif %}

New threads

{{ new_count }}

Updated

{{ upd_count }}

Total in DB

{{ last_sync.threads_in_db if last_sync else 0 }}

Total Available

{% if last_sync and last_sync.total_threads_available %} {{ last_sync.total_threads_available }} {% else %} - {% endif %}

{# ── "Fully Synced" banner ── #} {# Shown when DB coverage equals total available threads and the last sync completed #} {% set db_count = last_sync.threads_in_db if last_sync else 0 %} {% set avail_count = last_sync.total_threads_available if last_sync and last_sync.total_threads_available else 0 %} {% set is_fully_synced = (avail_count > 0 and db_count >= avail_count and last_sync and last_sync.status == 'completed') %}
check_circle

All threads are synced — your database is up to date.

{# Error message (hidden by JS when a new sync starts) #}

The last sync stopped with an error:

{{ last_sync.error_message if last_sync and last_sync.error_message else '' }}

{# ── Control buttons ── #}
Advanced Options

100 threads/page

{# Auto-Close Settings Section #}

timer_off Auto-Close Settings

Automatically close stale tickets that have had no activity for a configurable number of days. Unread inbound tickets use double the threshold before being closed.

Enable auto-close
days of inactivity

Tickets with an outbound last message or a read inbound last message are closed after X days. Unread inbound tickets are closed after 2X days.

{# Language Preferences Section #}

translate Language Preferences

Configure which languages are used for translating messages and replies. The preferred language is used as the default translation target.

Used as the default target for message translation.

{# Reply Signature Section #}

signature Reply Signature

This signature is automatically appended to every reply in the ticket editor. You can edit it per-message before sending.

{# Documentation Sources Section #}

travel_explore Documentation Sources

Index external documentation URLs so the AI can reference official docs in its replies. Add a sitemap.xml URL to index an entire documentation site (up to 200 pages).

{# Add Source Form #}
{# Sources Table #} {% if doc_sources %}
{% for src in doc_sources %} {% endfor %}
Label / URL Type Pages Last Scraped Actions

{{ src.label or src.url[:60] }}

{{ src.url[:80] }}{% if src.url|length > 80 %}…{% endif %}

{{ src.doc_system }} {{ src.page_count }} {{ src.last_scraped_at.strftime('%Y-%m-%d %H:%M') if src.last_scraped_at else 'Never' }}
{% else %}

No documentation sources added yet.

{% endif %}
{% endblock %}