v1.0.46: промпт на сервере — extractor читает из БД, UI сохраняет

This commit is contained in:
2026-06-19 07:49:51 +04:00
parent 9d554dde47
commit f03ba9160a
2 changed files with 41 additions and 2 deletions
+25 -1
View File
@@ -61,7 +61,7 @@
<body>
<div class="topbar">
<img src="/nubes-logo.svg" alt="Nubes">
<span class="title">Сверка договоров — LLM <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.45 — Lucee</span></span>
<span class="title">Сверка договоров — LLM <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.46 — Lucee</span></span>
</div>
<div class="content">
@@ -318,6 +318,16 @@ document.getElementById('llmBtn').addEventListener('click', async function() {
btn.disabled = true;
btn.innerHTML = '<span class="spinner"></span> 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: ''})
});
}
});
</script>
</body>