mirror of
https://github.com/perstarkse/minne.git
synced 2026-05-31 11:50:38 +02:00
fix: references bug
fix
This commit is contained in:
@@ -111,12 +111,23 @@
|
||||
// Load content if needed
|
||||
if (!tooltipContent) {
|
||||
fetch(`/chat/reference/${encodeURIComponent(reference)}`)
|
||||
.then(response => response.text())
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`reference lookup failed with status ${response.status}`);
|
||||
}
|
||||
return response.text();
|
||||
})
|
||||
.then(html => {
|
||||
tooltipContent = html;
|
||||
if (document.getElementById(tooltipId)) {
|
||||
document.getElementById(tooltipId).innerHTML = html;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
tooltipContent = '<div class="text-xs opacity-70">Reference unavailable.</div>';
|
||||
if (document.getElementById(tooltipId)) {
|
||||
document.getElementById(tooltipId).innerHTML = tooltipContent;
|
||||
}
|
||||
});
|
||||
} else if (tooltip) {
|
||||
// Set content if already loaded
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
<div>{{entity.name}}</div>
|
||||
<div>{{entity.description}}</div>
|
||||
<div>{{entity.updated_at|datetimeformat(format="short", tz=user.timezone)}} </div>
|
||||
{% if text_chunk %}
|
||||
<div class="font-semibold">Chunk Reference</div>
|
||||
<div class="text-sm whitespace-pre-wrap">{{text_chunk.chunk}}</div>
|
||||
<div class="text-xs opacity-70">{{text_chunk_updated_at}}</div>
|
||||
{% elif entity %}
|
||||
<div class="font-semibold">{{entity.name}}</div>
|
||||
<div class="text-sm">{{entity.description}}</div>
|
||||
<div class="text-xs opacity-70">{{entity_updated_at}}</div>
|
||||
{% else %}
|
||||
<div class="text-xs opacity-70">Reference unavailable.</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user