v1.0.43: превью текста + первые строки таблиц в модалке
This commit is contained in:
@@ -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.42 — Lucee</span></span>
|
||||
<span class="title">Сверка договоров — LLM <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.43 — Lucee</span></span>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
@@ -424,6 +424,17 @@ function showInfo(i) {
|
||||
html += '<div class="kv"><span class="k">Параграфов</span><span class="v">' + (d.PARAGRAPHS||0) + '</span></div>';
|
||||
html += '<div class="kv"><span class="k">Таблиц</span><span class="v">' + (d.TABLES||0) + '</span></div>';
|
||||
html += '<div class="kv"><span class="k">Строк таблиц</span><span class="v">' + (d.TABLE_ROWS||0) + '</span></div>';
|
||||
if (d.TEXT_PREVIEW) {
|
||||
html += '<div style="margin-top:10px;font-weight:600;font-size:13px;">Превью текста:</div>';
|
||||
html += '<pre>' + d.TEXT_PREVIEW + '</pre>';
|
||||
}
|
||||
if (d.TABLE_HEADERS && d.TABLE_HEADERS.length > 0) {
|
||||
html += '<div style="margin-top:10px;font-weight:600;font-size:13px;">Первые строки таблиц:</div>';
|
||||
d.TABLE_HEADERS.forEach(function(hdr, ti) {
|
||||
html += '<div style="margin-top:4px;font-size:11px;color:var(--muted);">Таблица ' + (ti+1) + ':</div>';
|
||||
html += '<pre>' + (hdr||[]).map(function(c){return c||'(пусто)';}).join(' | ') + '</pre>';
|
||||
});
|
||||
}
|
||||
if (d.ERRORS && d.ERRORS.length > 0) {
|
||||
html += '<div style="margin-top:8px;color:var(--destructive);font-weight:600;">Ошибки:</div>';
|
||||
html += '<pre>' + d.ERRORS.join('\n') + '</pre>';
|
||||
|
||||
+15
-2
@@ -309,16 +309,29 @@
|
||||
<cfset paraCount = 0>
|
||||
<cfset tblCount = 0>
|
||||
<cfset tblRows = 0>
|
||||
<cfset textPreview = "">
|
||||
<cfset tblHeaders = []>
|
||||
<cfloop array="#elements#" index="el">
|
||||
<cfif el.type EQ "paragraph"><cfset paraCount++>
|
||||
<cfelseif el.type EQ "table"><cfset tblCount++><cfset tblRows += arrayLen(el.rows)>
|
||||
<cfif el.type EQ "paragraph">
|
||||
<cfset paraCount++>
|
||||
<cfif len(textPreview) LT 200>
|
||||
<cfset textPreview &= el.text & chr(10)>
|
||||
</cfif>
|
||||
<cfelseif el.type EQ "table">
|
||||
<cfset tblCount++>
|
||||
<cfset tblRows += arrayLen(el.rows)>
|
||||
<cfif arrayLen(el.rows) GT 0>
|
||||
<cfset arrayAppend(tblHeaders, el.rows[1])>
|
||||
</cfif>
|
||||
</cfif>
|
||||
</cfloop>
|
||||
<cfset textPreview = left(textPreview, 200)>
|
||||
|
||||
<cfset result = {ok: true, doc_id: url.doc_id, filename: doc.filename,
|
||||
mime_type: doc.mime_type, status: newStatus,
|
||||
element_count: arrayLen(elements), error_count: arrayLen(errors),
|
||||
paragraphs: paraCount, tables: tblCount, table_rows: tblRows,
|
||||
text_preview: textPreview, table_headers: tblHeaders,
|
||||
errors: errors, files: files}>
|
||||
</cfif>
|
||||
</cfif>
|
||||
|
||||
Reference in New Issue
Block a user