Agent Zero AI framework
fix: image attachment 404 on message display
keyboardstaffcf8e66529b61
diff --git a/webui/components/chat/attachments/attachmentsStore.js b/webui/components/chat/attachments/attachmentsStore.jsindex 7ac7e59ab..e702c2afb 100644--- a/webui/components/chat/attachments/attachmentsStore.js+++ b/webui/components/chat/attachments/attachmentsStore.js@@ -260,7 +260,7 @@ const model = {// Generate server-side API URL for file (for device sync)getServerImgUrl(filename) {- return `/image_get?path=/a0/usr/uploads/${encodeURIComponent(filename)}`;+ return `/api/image_get?path=/a0/usr/uploads/${encodeURIComponent(filename)}`;},getServerFileUrl(filename) {diff --git a/webui/components/chat/message-queue/message-queue-store.js b/webui/components/chat/message-queue/message-queue-store.jsindex 6857a1089..9c83a50ba 100644--- a/webui/components/chat/message-queue/message-queue-store.js+++ b/webui/components/chat/message-queue/message-queue-store.js@@ -237,7 +237,7 @@ const model = {},getAttachmentUrl(filename) {- return `/image_get?path=/a0/usr/uploads/${encodeURIComponent(filename)}`;+ return `/api/image_get?path=/a0/usr/uploads/${encodeURIComponent(filename)}`;},};diff --git a/webui/js/messages.js b/webui/js/messages.jsindex cfdd3bf1c..b4980410e 100644--- a/webui/js/messages.js+++ b/webui/js/messages.js@@ -1723,7 +1723,7 @@ function drawKvpsIncremental(container, kvps, latex) {if (typeof value === "string" && value.startsWith("img://")) {const imgElement = document.createElement("img");imgElement.classList.add("kvps-img");- imgElement.src = value.replace("img://", "/image_get?path=");+ imgElement.src = value.replace("img://", "/api/image_get?path=");imgElement.alt = "Image Attachment";tdiv.appendChild(imgElement);@@ -1789,7 +1789,7 @@ function convertHTML(str) {}function convertImgFilePaths(str) {- return str.replace(/img:\/\//g, "/image_get?path=");+ return str.replace(/img:\/\//g, "/api/image_get?path=");}function convertFilePaths(str) {