fix: LLM spinner auto-polls status every 2s via htmx until analysis completes

This commit is contained in:
Marker689
2026-05-11 21:12:53 +03:00
parent e994e302fc
commit 56a9485950
2 changed files with 5 additions and 2 deletions

View File

@@ -249,7 +249,7 @@ async def analyze_finding_htmx(
) )
if not retry and finding.report and finding.report.get("status") == "analyzing": if not retry and finding.report and finding.report.get("status") == "analyzing":
return _render("_llm_spinner.html", request=request) return _render("_llm_spinner.html", request=request, finding_id=finding_id)
async with _llm_lock: async with _llm_lock:
if finding_id not in _llm_locks: if finding_id not in _llm_locks:

View File

@@ -1,3 +1,6 @@
<div class="llm-actions"> <div class="llm-actions"
hx-get="/api/v1/findings/{{ finding_id }}/analyze"
hx-trigger="every 2s"
hx-swap="outerHTML">
<small><span class="spinner"></span> {{ t('llm_analyzing', request.state.lang) }}</small> <small><span class="spinner"></span> {{ t('llm_analyzing', request.state.lang) }}</small>
</div> </div>