@songsid/agend 2.0.11-beta.24 → 2.0.11-beta.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/view.html +15 -5
- package/package.json +1 -1
package/dist/ui/view.html
CHANGED
|
@@ -36,7 +36,9 @@
|
|
|
36
36
|
|
|
37
37
|
/* Card */
|
|
38
38
|
#card { background: var(--panel); border-top: 1px solid var(--border); padding: 14px 18px; display: flex; gap: 16px; align-items: flex-start; }
|
|
39
|
-
#
|
|
39
|
+
#avatarBox { width: 56px; height: 56px; flex: 0 0 56px; }
|
|
40
|
+
.avatar-img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: block; }
|
|
41
|
+
.avatar-ph { width: 56px; height: 56px; border-radius: 50%; background: #30363d; color: var(--dim); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600; text-transform: uppercase; user-select: none; }
|
|
40
42
|
#cardBody { flex: 1; min-width: 0; }
|
|
41
43
|
#cardBody .row1 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
|
|
42
44
|
#cardBody .dname { font-size: 16px; font-weight: 600; }
|
|
@@ -63,7 +65,7 @@
|
|
|
63
65
|
<div id="main">
|
|
64
66
|
<div id="term"><pre id="pre"></pre></div>
|
|
65
67
|
<div id="card">
|
|
66
|
-
<
|
|
68
|
+
<div id="avatarBox"></div>
|
|
67
69
|
<div id="cardBody">
|
|
68
70
|
<div class="row1"><span class="dname" id="dname">—</span><span class="role" id="role"></span></div>
|
|
69
71
|
<div class="meta" id="meta"></div>
|
|
@@ -344,9 +346,17 @@
|
|
|
344
346
|
const ctxPart = it.context_pct ? ` · ctx ${Math.round(it.context_pct)}%` : "";
|
|
345
347
|
q("meta").textContent = `${it.instance_name} · ${it.backend}${it.model ? " · " + it.model : ""}${ctxPart} · ${it.status}`;
|
|
346
348
|
q("desc").textContent = it.description || "";
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
349
|
+
// Only issue an <img> request when an avatar actually exists — otherwise a
|
|
350
|
+
// 404 shows a broken-image icon. No avatar → CSS placeholder (initial).
|
|
351
|
+
const box = q("avatarBox");
|
|
352
|
+
if (it.has_avatar) {
|
|
353
|
+
const base = api(`/api/avatar/${encodeURIComponent(it.instance_name)}`);
|
|
354
|
+
const src = base + (base.includes("?") ? "&" : "?") + "t=" + Date.now(); // cache-bust, correct query separator
|
|
355
|
+
box.innerHTML = `<img class="avatar-img" alt="" src="${src}">`;
|
|
356
|
+
} else {
|
|
357
|
+
const initial = (it.display_name || it.instance_name || "?").trim().charAt(0) || "?";
|
|
358
|
+
box.innerHTML = `<div class="avatar-ph">${esc(initial)}</div>`;
|
|
359
|
+
}
|
|
350
360
|
}
|
|
351
361
|
|
|
352
362
|
async function loadRoster() {
|