fix: двухшаговый процесс — загрузка (быстро) → обработка (LLM)

Шаг 1: POST / → сохранить файлы, парсинг → редирект на /?id=X
Шаг 2: POST /process/X → LLM extract + diff → редирект на /?id=X
Нет таймаута — загрузка мгновенная, LLM по отдельной кнопке.
This commit is contained in:
2026-06-15 07:41:13 +04:00
parent 105459ef1a
commit fdd7d89ce5
2 changed files with 111 additions and 61 deletions
+27
View File
@@ -106,6 +106,33 @@
</div>
</div>
<!-- Загруженные допники + кнопка Обработать -->
{% if contract %}
<div class="card">
<div class="card-header">
<i data-lucide="file-check" style="width:18px;height:18px;"></i>
Договор {{ contract.number }} — файлы загружены
</div>
<div class="card-body">
{% for s in supplements %}
<div class="queue-item">
<span class="badge {{ 'badge-ok' if s.status == 'extracted' else 'badge-err' }}">{{ '✅' if s.status == 'extracted' else '⏳' }}</span>
<span class="name">{{ s.filename }}</span>
<span class="size">{{ s.status }}</span>
</div>
{% endfor %}
{% if unprocessed %}
<form method="POST" action="/process/{{ contract.id }}" style="margin-top:12px;">
<button type="submit" class="btn btn-primary" style="width:100%;justify-content:center;">
<i data-lucide="play" style="width:16px;height:16px;"></i> Обработать (LLM)
</button>
</form>
{% endif %}
</div>
</div>
{% endif %}
<!-- Результаты (после обработки) -->
{% if results %}
<div class="card">