From 4913a6162bd01c95bf3be684260676bb96a2ad79 Mon Sep 17 00:00:00 2001 From: Liang Jiaqing Date: Fri, 11 Sep 2026 09:13:55 +0800 Subject: [PATCH] hub: switch LLM channel (op llm / GET llms, POST llm) via agent.list_llms/next_llm only --- frontends/hub.html | 31 +++++++++++++++++++++++++------ frontends/hub.py | 29 +++++++++++++++++++++-------- 2 files changed, 46 insertions(+), 14 deletions(-) diff --git a/frontends/hub.html b/frontends/hub.html index c197c7cb..51323d5e 100644 --- a/frontends/hub.html +++ b/frontends/hub.html @@ -46,7 +46,8 @@ body{margin:0;height:100vh;display:flex;background:var(--bg);color:var(--fg); #tip{min-height:16px;margin-top:5px;font-size:12px;color:var(--dim)} #tip.err{color:#c0392b} #main>.hd{font-size:18px;margin-bottom:18px;padding-bottom:12px; - border-bottom:1px solid var(--line)} + border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px} +#main>.hd .ttl{flex:1} #main>.hd .llm{font-size:12px;max-width:180px} .msg{margin:0 0 14px} .msg.user{background:var(--user);border-radius:12px;padding:10px 14px; white-space:pre-wrap;max-width:70%;margin-left:auto} @@ -116,7 +117,7 @@ async function loadPeers(){ d.className = 'peer' + (p.name === cur ? ' on' : ''); d.dataset.name = p.name; d.innerHTML = `
${esc(p.title || p.name)}
-
${esc(p.name)} · ${p.n_msgs} 条
`; +
${esc(p.name)} · ${p.n_msgs} 条${p.llm ? ' · ' + esc(p.llm) : ''}
`; d.onclick = () => open_(p.name); el.appendChild(d); } @@ -156,8 +157,9 @@ async function sync(first){ if (!first && (olds.length > total || (olds.length && t0 && olds[0]._input !== t0.input))) return open_(name); const atEnd = m.scrollHeight - m.scrollTop - m.clientHeight < 80; - if (first || !m.querySelector('.hd')) m.innerHTML = '
'; - m.querySelector('.hd').textContent = r.title || name; + if (first || !m.querySelector('.hd')) m.innerHTML = '
'; + m.querySelector('.hd .ttl').textContent = r.title || name; + llmSel(m.querySelector('.hd .llm'), name, r.llm); for (const t of tasks){ const el = m.querySelector(`.task[data-i="${t.i}"]`); @@ -228,6 +230,23 @@ function segEl(name, i, s){ return det; } +// LLM channel switch: the