v1.0.174: classify tab in prompts UI — activePromptId + openPromptModal
This commit is contained in:
+11
-2
@@ -692,15 +692,22 @@ var promptModalOverlay = document.getElementById('promptModalOverlay');
|
|||||||
var promptModalTitle = document.getElementById('promptModalTitle');
|
var promptModalTitle = document.getElementById('promptModalTitle');
|
||||||
var promptName = document.getElementById('promptName');
|
var promptName = document.getElementById('promptName');
|
||||||
var promptNotes = document.getElementById('promptNotes');
|
var promptNotes = document.getElementById('promptNotes');
|
||||||
var activePromptId = {extract: '', diff: ''};
|
// Три роли промптов:
|
||||||
|
// extract — извлечение строк из первого документа (базовый договор)
|
||||||
|
// diff — сравнение допсоглашений (ADD/UPDATE/DELETE)
|
||||||
|
// classify — классификация документа (тип, номер, контрагент, дата)
|
||||||
|
var activePromptId = {extract: '', diff: '', classify: ''};
|
||||||
|
|
||||||
function openPromptModal(role) {
|
function openPromptModal(role) {
|
||||||
promptRole = role;
|
promptRole = role;
|
||||||
promptModalTitle.textContent = 'Промпт: ' + (role === 'extract' ? 'Извлечение' : 'Сравнение');
|
var labels = {extract: 'Извлечение', diff: 'Сравнение', classify: 'Классификация'};
|
||||||
|
promptModalTitle.textContent = 'Промпт: ' + (labels[role] || role);
|
||||||
document.getElementById('promptTabExtract').style.background = role === 'extract' ? 'var(--brand-primary)' : '';
|
document.getElementById('promptTabExtract').style.background = role === 'extract' ? 'var(--brand-primary)' : '';
|
||||||
document.getElementById('promptTabExtract').style.color = role === 'extract' ? '#fff' : '';
|
document.getElementById('promptTabExtract').style.color = role === 'extract' ? '#fff' : '';
|
||||||
document.getElementById('promptTabDiff').style.background = role === 'diff' ? 'var(--brand-primary)' : '';
|
document.getElementById('promptTabDiff').style.background = role === 'diff' ? 'var(--brand-primary)' : '';
|
||||||
document.getElementById('promptTabDiff').style.color = role === 'diff' ? '#fff' : '';
|
document.getElementById('promptTabDiff').style.color = role === 'diff' ? '#fff' : '';
|
||||||
|
document.getElementById('promptTabClassify').style.background = role === 'classify' ? 'var(--brand-primary)' : '';
|
||||||
|
document.getElementById('promptTabClassify').style.color = role === 'classify' ? '#fff' : '';
|
||||||
promptStatus.textContent = '';
|
promptStatus.textContent = '';
|
||||||
promptName.value = '';
|
promptName.value = '';
|
||||||
promptNotes.value = '';
|
promptNotes.value = '';
|
||||||
@@ -802,6 +809,8 @@ document.getElementById('promptSave').addEventListener('click', function() {
|
|||||||
|
|
||||||
document.getElementById('promptTabExtract').addEventListener('click', function() { openPromptModal('extract'); });
|
document.getElementById('promptTabExtract').addEventListener('click', function() { openPromptModal('extract'); });
|
||||||
document.getElementById('promptTabDiff').addEventListener('click', function() { openPromptModal('diff'); });
|
document.getElementById('promptTabDiff').addEventListener('click', function() { openPromptModal('diff'); });
|
||||||
|
document.getElementById('promptTabClassify').addEventListener('click', function() { openPromptModal('classify'); });
|
||||||
document.getElementById('promptBtnExtract').addEventListener('click', function() { openPromptModal('extract'); });
|
document.getElementById('promptBtnExtract').addEventListener('click', function() { openPromptModal('extract'); });
|
||||||
document.getElementById('promptBtnDiff').addEventListener('click', function() { openPromptModal('diff'); });
|
document.getElementById('promptBtnDiff').addEventListener('click', function() { openPromptModal('diff'); });
|
||||||
|
document.getElementById('promptBtnClassify').addEventListener('click', function() { openPromptModal('classify'); });
|
||||||
lucide.createIcons();
|
lucide.createIcons();
|
||||||
|
|||||||
Reference in New Issue
Block a user