Web: link and serve the file

This commit is contained in:
Jan Mrna
2025-11-03 15:40:34 +01:00
parent b2ad6ed885
commit 03057bc4d2
2 changed files with 21 additions and 2 deletions

View File

@@ -12,6 +12,8 @@
.result-header { font-weight: bold; color: #333; margin-bottom: 10px; }
.result-text { background: #f9f9f9; padding: 10px; border-radius: 3px; }
.distance { color: #666; font-size: 0.9em; }
.document-link { color: #007cba; text-decoration: none; }
.document-link:hover { text-decoration: underline; }
.no-results { text-align: center; color: #666; margin: 40px 0; }
.loading { text-align: center; color: #007cba; margin: 20px 0; }
</style>
@@ -56,7 +58,7 @@
resultsDiv.innerHTML = data.results.map((result, i) => `
<div class="result">
<div class="result-header">
Result ${i + 1} - ${result.document}
Result ${i + 1} - <a href="/file/${encodeURIComponent(result.document_path)}" class="document-link" target="_blank">${result.document}</a>
<span class="distance">(Distance: ${result.distance.toFixed(4)})</span>
</div>
<div>Page: ${result.page}, Chunk: ${result.chunk}</div>