diff --git a/extractor.cfm b/extractor.cfm index 8426368..dae559a 100644 --- a/extractor.cfm +++ b/extractor.cfm @@ -52,6 +52,18 @@ + + + diff --git a/index.cfm b/index.cfm index a361c07..9fd14e5 100644 --- a/index.cfm +++ b/index.cfm @@ -61,7 +61,7 @@
Nubes - Сверка договоров — LLM v1.0.45 — Lucee + Сверка договоров — LLM v1.0.46 — Lucee
@@ -318,6 +318,16 @@ document.getElementById('llmBtn').addEventListener('click', async function() { btn.disabled = true; btn.innerHTML = ' LLM-анализ...'; + // Сохранить промпт на сервер + var p = promptEditor.value.trim() || DEFAULT_PROMPT; + if (contractId) { + fetch('/prompt.cfm?contract_id=' + contractId, { + method: 'POST', + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify({prompt: p}) + }); + } + var diffCard = document.getElementById('diffCard'); var diffBody = document.getElementById('diffBody'); var diffStatus = document.getElementById('diffStatus'); @@ -471,12 +481,26 @@ document.getElementById('promptSave').addEventListener('click', function() { localStorage.setItem('llm_prompt', p); document.getElementById('promptStatus').textContent = '✓ сохранено'; setTimeout(function() { document.getElementById('promptStatus').textContent = ''; }, 1500); + if (contractId) { + fetch('/prompt.cfm?contract_id=' + contractId, { + method: 'POST', + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify({prompt: p}) + }); + } }); document.getElementById('promptReset').addEventListener('click', function() { promptEditor.value = DEFAULT_PROMPT; localStorage.removeItem('llm_prompt'); document.getElementById('promptStatus').textContent = '✓ сброшен'; setTimeout(function() { document.getElementById('promptStatus').textContent = ''; }, 1500); + if (contractId) { + fetch('/prompt.cfm?contract_id=' + contractId, { + method: 'POST', + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify({prompt: ''}) + }); + } });