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>
|
||||
<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.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 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="status-cell">' + (f.status || '') + '</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="remove-btn" onclick="removeFile(' + i + ')" title="Удалить"><i data-lucide="trash-2" style="width:16px;height:16px;"></i></button></td>' +
|
||||
'</tr>';
|
||||
@@ -522,8 +522,23 @@ function closeModal(e) {
|
||||
if (e && e.target !== document.getElementById('modalOverlay')) return;
|
||||
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.closeModal = closeModal;
|
||||
window.showView = showView;
|
||||
|
||||
// ── Промпт ───────────────────────────────────────────────────
|
||||
var promptEditor = document.getElementById('promptEditor');
|
||||
|
||||
Reference in New Issue
Block a user