fix(webui): allow image models in priority/AUTO chain editor

The priority page and key-scope pickers skipped kind=image models,
so image sources (e.g. Kwai-Kolors/Kolors) could not be placed in
the AUTO chain or granted per-key. The backend already supports it:
handleImage resolves AUTO through the chain then filters with
imageOnly, while chat requests are protected by chatOnly, so image
slots never receive chat traffic.

Image models now appear in the priority canvas, the add-slot picker
(labelled ' (image)'), and the key scope dialog.
This commit is contained in:
JianFeeeee
2026-08-26 20:36:05 +08:00
parent 747dff5b76
commit 66585549f1

View File

@ -2583,8 +2583,7 @@
const sourceRows = new Map();
j.sources.forEach((s) =>
(s.models || []).forEach((m) => {
if (m.kind === "image") return;
const it = { src: s.name, id: m.id, prio: m.priority || 0 };
const it = { src: s.name, id: m.id, prio: m.priority || 0, kind: m.kind };
byPair.set(m.id + "|" + s.name, it);
if (!byModel.has(m.id)) byModel.set(m.id, it);
if (!sourceRows.has(it.prio)) sourceRows.set(it.prio, []);
@ -3408,11 +3407,11 @@
const pairs = [];
(srcs || []).forEach((s) =>
(s.models || []).forEach((m) => {
if (m.kind === "image") return;
pairs.push({
src: s.name,
id: m.id,
label: m.id + " · " + s.name,
label: m.id + " · " + s.name + (m.kind === "image" ? " (image)" : ""),
kind: m.kind,
key: m.id + "|" + s.name,
});
}),