diff --git a/index.cfm b/index.cfm index f0d9dab..8c8ed1a 100644 --- a/index.cfm +++ b/index.cfm @@ -61,7 +61,7 @@
Nubes - Сверка договоров — LLM v1.0.40 — Lucee + Сверка договоров — LLM v1.0.41 — Lucee
@@ -266,10 +266,11 @@ parseBtn.addEventListener('click', async function() { var d = await resp.json(); if (d.OK && d.STATUS === 'parsed') { f.parsed = true; + f.parseInfo = d; f.status = '✓ ' + d.ELEMENT_COUNT + ' эл.'; - f.element_count = d.ELEMENT_COUNT; } else { - f.status = '✗ ' + (d.ERROR_COUNT > 0 ? 'ошибка' : '') + ''; + f.status = '✗ ' + (d.ERROR_COUNT > 0 ? (d.ERRORS && d.ERRORS[0] || 'ошибка') : 'ошибка') + ''; + f.parseInfo = d; } } catch(e) { f.status = '✗ сеть'; @@ -391,8 +392,18 @@ function showInfo(i) { document.getElementById('modalTitle').textContent = f.name; var html = '
Размер' + formatSize(f.size) + '
'; html += '
Изменён' + formatDate(f.lastModified) + '
'; + if (f.parseInfo) { + var d = f.parseInfo; + html += '
Элементов' + (d.ELEMENT_COUNT||0) + '
'; + html += '
Параграфов' + (d.PARAGRAPHS||0) + '
'; + html += '
Таблиц' + (d.TABLES||0) + '
'; + html += '
Строк таблиц' + (d.TABLE_ROWS||0) + '
'; + if (d.ERRORS && d.ERRORS.length > 0) { + html += '
Ошибки:
'; + html += '
' + d.ERRORS.join('\n') + '
'; + } + } html += '
doc_id' + (f.doc_id || '—') + '
'; - if (f.element_count) html += '
Элементов' + f.element_count + '
'; document.getElementById('modalBody').innerHTML = html; document.getElementById('modalOverlay').classList.add('open'); } diff --git a/parser.cfm b/parser.cfm index cf650c1..fe3c31b 100644 --- a/parser.cfm +++ b/parser.cfm @@ -280,10 +280,21 @@ error_message = WHERE id = + + + + + + + + + + + paragraphs: paraCount, tables: tblCount, table_rows: tblRows, + errors: errors, files: files}>