Atualizar web/chat.js

This commit is contained in:
2026-08-19 20:45:23 -03:00
parent e93d8d02b1
commit 872bd6a041
+18
View File
@@ -58,6 +58,24 @@ async function loadHistory() {
<div class="bubble">${m.content}</div>`;
chat.appendChild(div);
});
// Load attachments
const a = await fetch(`/api/attachments/${conversationId}`);
const attachments = await a.json();
attachments.forEach(att => {
const div = document.createElement("div");
div.className = "msg user";
div.innerHTML = `
<div class="avatar">🧑</div>
<div class="bubble">
<strong>Attachment:</strong> ${att.filename}<br>
<a href="/api/download/${att.id}" target="_blank">Download</a>
</div>
`;
chat.appendChild(div);
});
}
async function sendMessage() {