release: 0.2.0 — custom models, gateway context caps, free daily keys
- Custom models: add a model by id (protocol, reasoning, images, context window, max output) next to the built-in catalog. - Gateway context caps: read per-model context_window from each key's /v1/models and narrow the catalog model to the tightest window (free DeepSeek group: 200K, 32K output) so DSH compacts before the cap. - Free daily keys: show each key's expiry, flag the renewal window and link to https://www.geek2api.com/free-ds; the no-usable-key error points there too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
93a5fe93b4
commit
a8f689e39c
21 files changed
+2161
-427
No files matched your search
+365
-8
@@ -96,6 +96,13 @@ window.__ModuleLoader__.load({
|
||||
groupsMiss: "不可用",
|
||||
groupsPartial: "部分",
|
||||
groupsStale: "分组为上次读取的结果",
|
||||
contextCap: "该分组单次上下文上限 {tokens},会提前自动压缩",
|
||||
keyExpiresAt: "{when} 到期",
|
||||
keyExpired: "已到期",
|
||||
dailyKeyExpiresIn: "免费日卡 · {when} 到期(还剩 {hours} 小时 {minutes} 分)",
|
||||
dailyKeyRenewOpen: "免费日卡 · {when} 到期,现在就能领下一把,两把同时有效不中断",
|
||||
dailyKeyExpired: "免费日卡已到期,领一把新的粘贴到这里",
|
||||
dailyKeyClaim: "去领取 →",
|
||||
modelsTitle: "显示的模型",
|
||||
modelsIntro: "切换模型时只显示已勾选的 Geek2API 模型,默认全选。修改后立即生效;已有会话仍可继续使用原模型。",
|
||||
modelsChecking: "正在读取模型设置…",
|
||||
@@ -104,6 +111,29 @@ window.__ModuleLoader__.load({
|
||||
modelsNone: "全不选",
|
||||
modelsCount: "已选 {count} / {total}",
|
||||
modelsEmpty: "未勾选任何模型,切换列表将隐藏 Geek2API 的模型。",
|
||||
customTitle: "自定义模型({count})",
|
||||
customIntro: "内置列表里没有的模型,可以按模型 ID 自己添加:填 Geek2API 上的模型名,选它走的协议。添加后立即出现在模型选择器里,和内置模型一样使用多 Key 轮换和多入口切换。能不能用取决于 Key 所在分组,以「账户与 Key」里「自定义」一栏的 ✓ / ✕ 为准。",
|
||||
customChip: "自定义",
|
||||
customFamily: "自定义",
|
||||
customAddTitle: "添加模型",
|
||||
customIdPlaceholder: "模型 ID,例如 qwen3-max",
|
||||
customNamePlaceholder: "显示名称(可选)",
|
||||
customProtocol: "协议",
|
||||
customProtocolHint: "Claude 系选 Messages;GPT、Grok 选 Responses;其他大多数模型选 Chat Completions。",
|
||||
protocolCompletions: "Chat Completions",
|
||||
protocolResponses: "Responses",
|
||||
protocolMessages: "Messages",
|
||||
customCapabilities: "能力",
|
||||
customReasoning: "推理",
|
||||
customImage: "可带图",
|
||||
customLimits: "上下文 / 输出",
|
||||
customContextPlaceholder: "上下文窗口,默认 128000",
|
||||
customOutputPlaceholder: "最大输出,默认 32000",
|
||||
customWindow: "上下文 {context} · 输出 {output}",
|
||||
customReasoningHint: "勾选「推理」后提供 off / low / medium / high 档位;不勾选则不发送推理参数。",
|
||||
customAdd: "添加",
|
||||
customRemove: "删除",
|
||||
customFull: "最多添加 {count} 个自定义模型。",
|
||||
hostsTitle: "接口地址",
|
||||
hostsIntro: "所有请求按测速结果选用最快的地址;某个地址连不上会暂时跳过,自动改用下一个。",
|
||||
hostsProbe: "重新测速",
|
||||
@@ -205,6 +235,29 @@ window.__ModuleLoader__.load({
|
||||
modelsNone: "Select none",
|
||||
modelsCount: "{count} / {total} selected",
|
||||
modelsEmpty: "No models selected. Geek2API models are hidden from the picker.",
|
||||
customTitle: "Custom models ({count})",
|
||||
customIntro: "Add a model the built-in list lacks by its id: the model name on Geek2API, and the protocol it is served over. It appears in the model picker at once and uses the same key rotation and endpoint failover as the built-in models. Whether a key can use it depends on the key’s groups; see the ✓ / ✕ under “Custom” in Accounts and keys.",
|
||||
customChip: "Custom",
|
||||
customFamily: "Custom",
|
||||
customAddTitle: "Add a model",
|
||||
customIdPlaceholder: "Model id, e.g. qwen3-max",
|
||||
customNamePlaceholder: "Display name (optional)",
|
||||
customProtocol: "Protocol",
|
||||
customProtocolHint: "Claude models: Messages. GPT and Grok: Responses. Most other models: Chat Completions.",
|
||||
protocolCompletions: "Chat Completions",
|
||||
protocolResponses: "Responses",
|
||||
protocolMessages: "Messages",
|
||||
customCapabilities: "Capabilities",
|
||||
customReasoning: "Reasoning",
|
||||
customImage: "Images",
|
||||
customLimits: "Context / output",
|
||||
customContextPlaceholder: "Context window, default 128000",
|
||||
customOutputPlaceholder: "Max output, default 32000",
|
||||
customWindow: "context {context} · output {output}",
|
||||
customReasoningHint: "With Reasoning, the off / low / medium / high efforts are offered; without it, no reasoning parameter is sent.",
|
||||
customAdd: "Add",
|
||||
customRemove: "Remove",
|
||||
customFull: "At most {count} custom models.",
|
||||
intro: "Paste a Geek2API API key to use the built-in model route. Keys are used in order: an exhausted or rejected key hands over to the next one, and a key that cannot reach the selected model is passed over for one that can. Several endpoints are measured and fail over automatically.",
|
||||
accountsTitle: "Accounts and keys",
|
||||
refresh: "Refresh",
|
||||
@@ -264,6 +317,13 @@ window.__ModuleLoader__.load({
|
||||
groupsMiss: "Not",
|
||||
groupsPartial: "partly",
|
||||
groupsStale: "groups from the last read",
|
||||
contextCap: "This group caps the context at {tokens} per request; sessions compact early",
|
||||
keyExpiresAt: "Expires {when}",
|
||||
keyExpired: "Expired",
|
||||
dailyKeyExpiresIn: "Free daily key · expires {when} ({hours}h {minutes}m left)",
|
||||
dailyKeyRenewOpen: "Free daily key · expires {when}; claim the next one now, both stay valid",
|
||||
dailyKeyExpired: "Free daily key expired; claim a new one and paste it here",
|
||||
dailyKeyClaim: "Claim →",
|
||||
hostsTitle: "Endpoints",
|
||||
hostsIntro: "Every request uses the fastest endpoint by the last measurement; an endpoint that cannot be reached is skipped for a while and the next one serves.",
|
||||
hostsProbe: "Measure again",
|
||||
@@ -443,6 +503,9 @@ window.__ModuleLoader__.load({
|
||||
.pkc-model>span{display:flex;flex-direction:column;min-width:0;gap:2px}
|
||||
.pkc-model b{font-size:13px;font-weight:500}
|
||||
.pkc-models:disabled .pkc-model{opacity:.5;cursor:not-allowed}
|
||||
.pkc-model b>.pkc-chip{margin-left:6px;vertical-align:1px}
|
||||
.pkc-check{display:inline-flex;align-items:center;gap:6px;font-size:13px;cursor:pointer}
|
||||
.pkc-check>input{flex:none;width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-state-business-primary)}
|
||||
|
||||
.pkc-setting{display:grid;grid-template-columns:112px minmax(0,1fr);gap:6px 16px;align-items:start}
|
||||
.pkc-setting>.pkc-label{padding-top:5px}
|
||||
@@ -658,9 +721,14 @@ window.__ModuleLoader__.load({
|
||||
if (typeof usage.availableUsd !== "number") return void 0;
|
||||
return Math.max(0, Math.min(1, usage.availableUsd / usage.limitUsd));
|
||||
}
|
||||
/** Which catalog families a key reaches, from its per-model coverage. */
|
||||
function reachOf(coverage) {
|
||||
return MODEL_FAMILIES.flatMap(([name, models]) => {
|
||||
const BUILT_IN_IDS = new Set(MODEL_FAMILIES.flatMap(([, models]) => models));
|
||||
/**
|
||||
* Which catalog families a key reaches, from its per-model coverage. Models
|
||||
* the user added by id form one more family of their own.
|
||||
*/
|
||||
function reachOf(coverage, customName) {
|
||||
const custom = Object.keys(coverage ?? {}).filter((id) => !BUILT_IN_IDS.has(id));
|
||||
return (custom.length === 0 ? MODEL_FAMILIES : [...MODEL_FAMILIES, [customName, custom]]).flatMap(([name, models]) => {
|
||||
const known = models.filter((id) => typeof coverage?.[id] === "boolean");
|
||||
if (known.length === 0) return [];
|
||||
const reached = known.filter((id) => coverage[id] === true);
|
||||
@@ -719,7 +787,7 @@ window.__ModuleLoader__.load({
|
||||
className: "pkc-error",
|
||||
children: t("groupsRejected")
|
||||
});
|
||||
const reach = reachOf(group.coverage);
|
||||
const reach = reachOf(group.coverage, t("customFamily"));
|
||||
const names = Array.isArray(group.groups) ? group.groups : [];
|
||||
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
||||
@@ -753,12 +821,66 @@ window.__ModuleLoader__.load({
|
||||
className: "pkc-meta",
|
||||
children: fill(t("groupsExtra"), { count: group.extraModels })
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(KeyContextCap, {
|
||||
windows: group.contextWindows,
|
||||
t
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(KeyLifetime, {
|
||||
lifetime: group.lifetime,
|
||||
t
|
||||
}),
|
||||
group.stale !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-meta",
|
||||
children: t("groupsStale")
|
||||
})
|
||||
] });
|
||||
}
|
||||
/** Where the free daily key is claimed again. */
|
||||
const FREE_DAILY_SITE = "https://www.geek2api.com";
|
||||
const compactTokens = (value) => value >= 1e3 ? `${Math.round(value / 1e3)}K` : String(value);
|
||||
/** The per-request context cap the key's group enforces (the free DeepSeek group: 200K). */
|
||||
function KeyContextCap({ windows, t }) {
|
||||
if (windows === void 0 || windows === null) return null;
|
||||
const values = [...new Set(Object.values(windows).filter((value) => Number.isInteger(value)))];
|
||||
if (values.length === 0) return null;
|
||||
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-meta",
|
||||
children: fill(t("contextCap"), { tokens: values.map(compactTokens).join(" / ") })
|
||||
});
|
||||
}
|
||||
/** When the key expires; a daily free key also links to the page that issues the next one. */
|
||||
function KeyLifetime({ lifetime, t }) {
|
||||
if (lifetime === void 0 || lifetime === null || !Number.isFinite(lifetime.expiresAt)) return null;
|
||||
const left = lifetime.expiresAt - Date.now();
|
||||
const at = new Date(lifetime.expiresAt);
|
||||
const pad = (value) => String(value).padStart(2, "0");
|
||||
const when = `${pad(at.getMonth() + 1)}-${pad(at.getDate())} ${pad(at.getHours())}:${pad(at.getMinutes())}`;
|
||||
const hours = Math.max(0, Math.floor(left / 36e5));
|
||||
const minutes = Math.max(0, Math.floor(left % 36e5 / 6e4));
|
||||
if (lifetime.daily !== true) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-meta",
|
||||
children: left > 0 ? fill(t("keyExpiresAt"), { when }) : t("keyExpired")
|
||||
});
|
||||
const renewOpen = left <= (lifetime.renewWindowHours ?? 2) * 36e5;
|
||||
const href = `${FREE_DAILY_SITE}${lifetime.renewPath ?? "/free-ds"}`;
|
||||
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
||||
className: left <= 0 || renewOpen ? "pkc-error" : "pkc-meta",
|
||||
children: [
|
||||
left <= 0 ? t("dailyKeyExpired") : fill(renewOpen ? t("dailyKeyRenewOpen") : t("dailyKeyExpiresIn"), {
|
||||
when,
|
||||
hours,
|
||||
minutes
|
||||
}),
|
||||
" ",
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
||||
href,
|
||||
target: "_blank",
|
||||
rel: "noreferrer noopener",
|
||||
children: t("dailyKeyClaim")
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
function KeyRow({ entry, row, group, descriptions, groupsLoading, busy, renaming, onRename, onAction, skippedUntil, t }) {
|
||||
const usage = row?.usage;
|
||||
const share = remainingShare(usage);
|
||||
@@ -1230,6 +1352,198 @@ window.__ModuleLoader__.load({
|
||||
]
|
||||
});
|
||||
}
|
||||
const PROTOCOL_KEYS = {
|
||||
"openai-completions": "protocolCompletions",
|
||||
"openai-responses": "protocolResponses",
|
||||
"anthropic-messages": "protocolMessages"
|
||||
};
|
||||
const EMPTY_CUSTOM = {
|
||||
id: "",
|
||||
name: "",
|
||||
api: "openai-completions",
|
||||
reasoning: false,
|
||||
image: false,
|
||||
contextWindow: "",
|
||||
maxTokens: ""
|
||||
};
|
||||
/** One user-added model: its protocol and capabilities, and a remove button. */
|
||||
function CustomModelRow({ model, disabled, onRemove, t }) {
|
||||
const facts = [
|
||||
t(PROTOCOL_KEYS[model.api] ?? "protocolCompletions"),
|
||||
model.reasoning ? t("customReasoning") : void 0,
|
||||
model.image ? t("customImage") : void 0,
|
||||
fill(t("customWindow"), {
|
||||
context: model.contextWindow.toLocaleString(),
|
||||
output: model.maxTokens.toLocaleString()
|
||||
})
|
||||
].filter(Boolean).join(" · ");
|
||||
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
||||
className: "pkc-row",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
||||
className: "pkc-row-top",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
||||
className: "pkc-row-name",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-name",
|
||||
children: model.name === "" ? model.id : model.name
|
||||
}), model.name !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-meta pkc-mono",
|
||||
children: model.id
|
||||
})]
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-actions",
|
||||
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
||||
variant: "danger",
|
||||
disabled,
|
||||
onClick: onRemove,
|
||||
children: t("customRemove")
|
||||
})
|
||||
})]
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-meta",
|
||||
children: facts
|
||||
})]
|
||||
});
|
||||
}
|
||||
/** The form that adds a model by id. */
|
||||
function CustomModelForm({ disabled, onAdd, t }) {
|
||||
const [draft, setDraft] = react.useState(EMPTY_CUSTOM);
|
||||
const set = (patch) => setDraft((current) => ({
|
||||
...current,
|
||||
...patch
|
||||
}));
|
||||
const submit = (event) => {
|
||||
event.preventDefault();
|
||||
if (disabled || draft.id.trim() === "") return;
|
||||
onAdd({
|
||||
id: draft.id.trim(),
|
||||
name: draft.name.trim(),
|
||||
api: draft.api,
|
||||
reasoning: draft.reasoning,
|
||||
image: draft.image,
|
||||
...draft.contextWindow.trim() === "" ? {} : { contextWindow: Number(draft.contextWindow) },
|
||||
...draft.maxTokens.trim() === "" ? {} : { maxTokens: Number(draft.maxTokens) }
|
||||
}).then((saved) => {
|
||||
if (saved) setDraft(EMPTY_CUSTOM);
|
||||
});
|
||||
};
|
||||
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
||||
className: "pkc-add",
|
||||
onSubmit: submit,
|
||||
children: [
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-label",
|
||||
children: t("customAddTitle")
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
||||
className: "pkc-form",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
||||
className: "pkc-input pkc-mono",
|
||||
type: "text",
|
||||
maxLength: 128,
|
||||
spellCheck: false,
|
||||
autoComplete: "off",
|
||||
placeholder: t("customIdPlaceholder"),
|
||||
disabled,
|
||||
value: draft.id,
|
||||
onChange: (event) => set({ id: event.target.value })
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
||||
className: "pkc-input",
|
||||
type: "text",
|
||||
maxLength: 64,
|
||||
placeholder: t("customNamePlaceholder"),
|
||||
disabled,
|
||||
value: draft.name,
|
||||
onChange: (event) => set({ name: event.target.value })
|
||||
})]
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
||||
className: "pkc-setting",
|
||||
children: [
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-label",
|
||||
children: t("customProtocol")
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Segmented, {
|
||||
label: t("customProtocol"),
|
||||
options: Object.keys(PROTOCOL_KEYS).map((value) => ({
|
||||
value,
|
||||
label: t(PROTOCOL_KEYS[value])
|
||||
})),
|
||||
value: draft.api,
|
||||
disabled,
|
||||
onChange: (api) => set({ api })
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
||||
className: "pkc-note",
|
||||
children: t("customProtocolHint")
|
||||
})] }),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-label",
|
||||
children: t("customCapabilities")
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
||||
className: "pkc-form",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
||||
className: "pkc-check",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
||||
type: "checkbox",
|
||||
disabled,
|
||||
checked: draft.reasoning,
|
||||
onChange: (event) => set({ reasoning: event.target.checked })
|
||||
}), t("customReasoning")]
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
||||
className: "pkc-check",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
||||
type: "checkbox",
|
||||
disabled,
|
||||
checked: draft.image,
|
||||
onChange: (event) => set({ image: event.target.checked })
|
||||
}), t("customImage")]
|
||||
})]
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-label",
|
||||
children: t("customLimits")
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
||||
className: "pkc-form",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
||||
className: "pkc-input",
|
||||
type: "number",
|
||||
min: 1e3,
|
||||
step: 1e3,
|
||||
placeholder: t("customContextPlaceholder"),
|
||||
disabled,
|
||||
value: draft.contextWindow,
|
||||
onChange: (event) => set({ contextWindow: event.target.value })
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
||||
className: "pkc-input",
|
||||
type: "number",
|
||||
min: 1,
|
||||
step: 1e3,
|
||||
placeholder: t("customOutputPlaceholder"),
|
||||
disabled,
|
||||
value: draft.maxTokens,
|
||||
onChange: (event) => set({ maxTokens: event.target.value })
|
||||
})]
|
||||
})
|
||||
]
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
||||
className: "pkc-split",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
||||
className: "pkc-note",
|
||||
children: t("customReasoningHint")
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
||||
type: "submit",
|
||||
variant: "primary",
|
||||
disabled: disabled || draft.id.trim() === "",
|
||||
children: t("customAdd")
|
||||
})]
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
function ModelsCard({ call, t }) {
|
||||
const [state, setState] = react.useState();
|
||||
const [busy, setBusy] = react.useState(false);
|
||||
@@ -1246,14 +1560,25 @@ window.__ModuleLoader__.load({
|
||||
};
|
||||
}, [call]);
|
||||
const models = state?.models ?? [];
|
||||
const custom = Array.isArray(state?.customModels) ? state.customModels : [];
|
||||
const selectedIds = models.filter((model) => model.selected).map((model) => model.id);
|
||||
const disabled = busy || state?.writable !== true;
|
||||
const update = (ids) => {
|
||||
if (disabled) return;
|
||||
/** Run one write; resolves true when it was saved. */
|
||||
const write = (endpoint, payload) => {
|
||||
if (disabled) return Promise.resolve(false);
|
||||
setBusy(true);
|
||||
setError(void 0);
|
||||
call("models/update", { selectedIds: ids }).then(setState).catch((failure) => setError(clearMessage(failure))).finally(() => setBusy(false));
|
||||
return call(endpoint, payload).then((next) => {
|
||||
setState(next);
|
||||
return true;
|
||||
}).catch((failure) => {
|
||||
setError(clearMessage(failure));
|
||||
return false;
|
||||
}).finally(() => setBusy(false));
|
||||
};
|
||||
const update = (ids) => void write("models/update", { selectedIds: ids });
|
||||
const saveCustom = (list) => write("models/custom/update", { customModels: list });
|
||||
const full = custom.length >= (state?.maxCustomModels ?? Infinity);
|
||||
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Card, {
|
||||
title: t("modelsTitle"),
|
||||
aside: state !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
@@ -1296,7 +1621,11 @@ window.__ModuleLoader__.load({
|
||||
type: "checkbox",
|
||||
checked: model.selected,
|
||||
onChange: (event) => update(event.target.checked ? [...selectedIds, model.id] : selectedIds.filter((id) => id !== model.id))
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: model.name }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("b", { children: [model.name, model.custom === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-chip",
|
||||
"data-tone": "info",
|
||||
children: t("customChip")
|
||||
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "pkc-meta pkc-mono",
|
||||
children: model.id
|
||||
})] })]
|
||||
@@ -1306,6 +1635,34 @@ window.__ModuleLoader__.load({
|
||||
className: "pkc-note",
|
||||
children: t("modelsEmpty")
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
||||
className: "pkc-advanced",
|
||||
open: custom.length > 0 ? true : void 0,
|
||||
children: [
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", { children: fill(t("customTitle"), { count: custom.length }) }),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
||||
className: "pkc-note",
|
||||
children: t("customIntro")
|
||||
}),
|
||||
custom.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
||||
className: "pkc-list",
|
||||
children: custom.map((model) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CustomModelRow, {
|
||||
model,
|
||||
disabled,
|
||||
onRemove: () => void saveCustom(custom.filter((entry) => entry.id !== model.id)),
|
||||
t
|
||||
}, model.id))
|
||||
}),
|
||||
full ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
||||
className: "pkc-note",
|
||||
children: fill(t("customFull"), { count: state.maxCustomModels })
|
||||
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CustomModelForm, {
|
||||
disabled,
|
||||
onAdd: (entry) => saveCustom([...custom, entry]),
|
||||
t
|
||||
})
|
||||
]
|
||||
}),
|
||||
state.writable !== true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
||||
className: "pkc-note",
|
||||
children: t("searchNotWritable")
|
||||
|
||||
Reference in new issue
Block a user