providers: one that only draws images says how many image models it has, not "no models exposed" (#124: 供应商里面img模型读不出来,只有在设置里面可以看到) — an image model isn't one an agent picks, so a provider whose list had only image models read "no models exposed" under Providers although Settings → Image generation drew with them. Its row now reads 2 image models. Checked in a sandbox magpie web with a custom provider whose /v1/models lists gpt-image-1 and flux-1-schnell
This commit is contained in:
@@ -1529,7 +1529,9 @@ function renderProviders() {
|
||||
if (p.sponsored) name.append(el("span", "badge", t("sponsored")));
|
||||
if (p.off) name.append(el("span", "badge off", t("Switched off")));
|
||||
const n = p.models.filter((m) => m.on).length;
|
||||
const models = n ? t(n === 1 ? "{n} model" : "{n} models", { n }) : t("no models exposed");
|
||||
// a provider that only draws images (Settings → Image generation) says so
|
||||
const models = n ? t(n === 1 ? "{n} model" : "{n} models", { n })
|
||||
: p.draws ? t(p.draws === 1 ? "{n} image model" : "{n} image models", { n: p.draws }) : t("no models exposed");
|
||||
who.append(name, el("div", "sub", (p.account ? t("signed in as {user}", { user: p.account.user }) : p.host) + " · " + models));
|
||||
const using = p.agents.filter((a) => a.current);
|
||||
const uses = el("div", "uses");
|
||||
|
||||
@@ -206,6 +206,8 @@ const I18N = {
|
||||
"free: it doesn't use the plan's credits": "免费:不消耗套餐积分",
|
||||
"{n} model": "{n} 个模型",
|
||||
"{n} models": "{n} 个模型",
|
||||
"{n} image model": "{n} 个图像模型",
|
||||
"{n} image models": "{n} 个图像模型",
|
||||
"no models exposed": "未暴露模型",
|
||||
"signed in as {user}": "已登录 {user}",
|
||||
"{name} · {model} — click to change": "{name} · {model} — 点击更改",
|
||||
|
||||
@@ -70,6 +70,7 @@ type providerJSON struct {
|
||||
Affinity string `json:"affinity"` // how long a conversation stays with who answered it
|
||||
Models []modelJSON `json:"models"` // everything the vendor lists, exposed ones flagged
|
||||
Exposed int `json:"exposed"` // how many reach the agents
|
||||
Draws int `json:"draws,omitempty"` // how many of its models draw images (gateway.Drawers)
|
||||
Unlisted bool `json:"unlisted"` // its models serve only through routing groups
|
||||
Off bool `json:"off"` // switched off: kept, but agents get none of its models
|
||||
Contexts map[string]int `json:"contexts,omitempty"` // the windows the user set, "*" for all its models
|
||||
@@ -259,6 +260,7 @@ func providerInfo(p provider.Provider, agents []agentUse) providerJSON {
|
||||
}
|
||||
}
|
||||
out.Exposed = len(exposed)
|
||||
out.Draws = len(gateway.Drawers(p))
|
||||
if t, ok := p.Fetched(); ok {
|
||||
out.Fetched = ago(t)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user