fix: view.cfm empty elements_json check + modal instead of new tab (v1.0.72)
This commit is contained in:
@@ -61,7 +61,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="topbar">
|
<div class="topbar">
|
||||||
<img src="/nubes-logo.svg" alt="Nubes">
|
<img src="/nubes-logo.svg" alt="Nubes">
|
||||||
<span class="title">Сверка договоров — LLM <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.71 — Lucee</span></span>
|
<span class="title">Сверка договоров — LLM <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.72 — Lucee</span></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -178,7 +178,7 @@ function renderTable() {
|
|||||||
'<td class="num-cell" style="font-size:12px;color:var(--muted);">' + formatSize(f.size) + '</td>' +
|
'<td class="num-cell" style="font-size:12px;color:var(--muted);">' + formatSize(f.size) + '</td>' +
|
||||||
'<td class="status-cell">' + (f.status || '') + '</td>' +
|
'<td class="status-cell">' + (f.status || '') + '</td>' +
|
||||||
'<td style="text-align:center;">' + radio + '</td>' +
|
'<td style="text-align:center;">' + radio + '</td>' +
|
||||||
'<td><button class="info-btn' + (f.doc_id ? ' visible' : '') + '" onclick="window.open(\'/view.cfm?doc_id=' + (f.doc_id||'') + '\', \'_blank\')" title="Просмотр"><i data-lucide="eye" style="width:16px;height:16px;"></i></button></td>' +
|
'<td><button class="info-btn' + (f.doc_id ? ' visible' : '') + '" onclick="showView(\'' + (f.doc_id||'') + '\')" title="Просмотр"><i data-lucide="eye" style="width:16px;height:16px;"></i></button></td>' +
|
||||||
'<td><button class="info-btn' + (f.doc_id ? ' visible' : '') + '" id="info_' + i + '" onclick="showInfo(' + i + ')" title="Инфо"><i data-lucide="info" style="width:16px;height:16px;"></i></button></td>' +
|
'<td><button class="info-btn' + (f.doc_id ? ' visible' : '') + '" id="info_' + i + '" onclick="showInfo(' + i + ')" title="Инфо"><i data-lucide="info" style="width:16px;height:16px;"></i></button></td>' +
|
||||||
'<td><button class="remove-btn" onclick="removeFile(' + i + ')" title="Удалить"><i data-lucide="trash-2" style="width:16px;height:16px;"></i></button></td>' +
|
'<td><button class="remove-btn" onclick="removeFile(' + i + ')" title="Удалить"><i data-lucide="trash-2" style="width:16px;height:16px;"></i></button></td>' +
|
||||||
'</tr>';
|
'</tr>';
|
||||||
@@ -522,8 +522,23 @@ function closeModal(e) {
|
|||||||
if (e && e.target !== document.getElementById('modalOverlay')) return;
|
if (e && e.target !== document.getElementById('modalOverlay')) return;
|
||||||
document.getElementById('modalOverlay').classList.remove('open');
|
document.getElementById('modalOverlay').classList.remove('open');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function showView(docId) {
|
||||||
|
document.getElementById('modalTitle').textContent = 'Просмотр документа';
|
||||||
|
document.getElementById('modalBody').innerHTML = '<span style="color:var(--muted);">Загрузка...</span>';
|
||||||
|
document.getElementById('modalOverlay').classList.add('open');
|
||||||
|
try {
|
||||||
|
var resp = await fetch('/view.cfm?doc_id=' + docId);
|
||||||
|
var text = await resp.text();
|
||||||
|
document.getElementById('modalBody').innerHTML = '<pre style="background:var(--brand-grey-light);padding:12px;border-radius:6px;font-size:12px;max-height:60vh;overflow-y:auto;white-space:pre-wrap;margin:0;">' + text.replace(/</g,'<').replace(/>/g,'>') + '</pre>';
|
||||||
|
} catch(e) {
|
||||||
|
document.getElementById('modalBody').innerHTML = '<span style="color:var(--destructive);">Ошибка загрузки</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
window.showInfo = showInfo;
|
window.showInfo = showInfo;
|
||||||
window.closeModal = closeModal;
|
window.closeModal = closeModal;
|
||||||
|
window.showView = showView;
|
||||||
|
|
||||||
// ── Промпт ───────────────────────────────────────────────────
|
// ── Промпт ───────────────────────────────────────────────────
|
||||||
var promptEditor = document.getElementById('promptEditor');
|
var promptEditor = document.getElementById('promptEditor');
|
||||||
|
|||||||
@@ -16,6 +16,10 @@
|
|||||||
<cfoutput>not found</cfoutput><cfabort>
|
<cfoutput>not found</cfoutput><cfabort>
|
||||||
</cfif>
|
</cfif>
|
||||||
|
|
||||||
|
<cfif NOT len(doc.elements_json)>
|
||||||
|
<cfoutput>(ещё не распарсен — нажмите Парсинг)</cfoutput><cfabort>
|
||||||
|
</cfif>
|
||||||
|
|
||||||
<cfset elements = deserializeJSON(doc.elements_json)>
|
<cfset elements = deserializeJSON(doc.elements_json)>
|
||||||
<cfset count = 0>
|
<cfset count = 0>
|
||||||
<cfset outLines = []>
|
<cfset outLines = []>
|
||||||
|
|||||||
Reference in New Issue
Block a user