hänsel und gretel update

This commit is contained in:
2026-01-02 21:45:47 +01:00
parent c173bc0b78
commit 1314a72904

View File

@@ -51,21 +51,7 @@
</div>
</section>
<!-- Content Modal -->
<dialog id="contentModal">
<article style="min-width: 70vw; min-height: 50vh;">
<header>
<button aria-label="Close" rel="prev" onclick="closeModal()"></button>
<p>
<strong>📄 Source Content</strong>
<span id="modalTitle" style="margin-left: 1rem; opacity: 0.7;"></span>
</p>
</header>
<div id="modalBody" style="white-space: pre-wrap; font-family: monospace; max-height: 60vh; overflow-y: auto;">
Loading...
</div>
</article>
</dialog>
<!-- Modal Removed -->
<script>
async function loadCollections() {
@@ -174,7 +160,6 @@
<header>
<strong style="color: ${scoreColor}">${(r.score * 100).toFixed(1)}% Match</strong> &nbsp;
<span class="badge secondary">${source}</span>
${postId ? `<button class="outline contrast" style="float: right; padding: 2px 10px; font-size: 0.8em;" onclick="viewContent(${postId}, '${source}')">👀 Modal</button>` : ''}
${rawLink ? `<button class="outline secondary" style="float: right; padding: 2px 10px; font-size: 0.8em; margin-right: 0.5rem;" onclick="window.open('${rawLink}', '_blank')">📄 Raw</button>` : ''}
${giteaLink ? `<button class="outline secondary" style="float: right; padding: 2px 10px; font-size: 0.8em; margin-right: 0.5rem;" onclick="window.open('${giteaLink}', '_blank')">🐙 Gitea</button>` : ''}
</header>
@@ -194,36 +179,7 @@
}
}
async function viewContent(postId, title) {
if (!postId) {
alert("No Post ID available.");
return;
}
const modal = document.getElementById('contentModal');
const modalTitle = document.getElementById('modalTitle');
const modalBody = document.getElementById('modalBody');
modalTitle.innerText = title;
modalBody.innerText = "Loading...";
modal.showModal();
try {
const res = await fetch(`/admin/vectors/content/${postId}`);
if (!res.ok) throw new Error("Content not found (might be deleted or orphaned)");
const data = await res.json();
modalBody.innerText = data.content || "No content text.";
} catch (e) {
modalBody.innerHTML = `<span style="color: red;">Error: ${e.message}</span>
<br><small>This confirms the vector is 'Orphaned' (exists in brain, but body is gone).</small>`;
}
}
function closeModal() {
document.getElementById('contentModal').close();
}
// Auto-load collections
loadCollections();