From c3dd251cced2a62fe9c0a5e32f78ca11e47b0f0e Mon Sep 17 00:00:00 2001 From: infosave2007 Date: Fri, 7 Aug 2026 19:41:56 +0300 Subject: [PATCH] fix(keys): drop the allowed-models picker from the new-key dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creating a key now asks only account, rate limit and optional custom value — allow_models is sent empty (= all models). Per-key model restrictions stay editable in Settings for whoever actually needs them. --- web/js/views/keys.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/web/js/views/keys.js b/web/js/views/keys.js index 8d7d98b..5695e0b 100644 --- a/web/js/views/keys.js +++ b/web/js/views/keys.js @@ -4,27 +4,17 @@ import { t } from "../i18n.js"; import { api } from "../api.js"; export async function renderKeys() { - const modelsData = await api.listModels(); - const ids = (modelsData.models || []).map((m) => m.id); const root = h("div"); function openCreate(reload) { const accountIn = h("input", { placeholder: "team-a" }); const rateIn = h("input", { type: "number", value: 600 }); const customIn = h("input", { placeholder: "sk-gw-…" }); - const allowInputs = ids.map((id) => ({ id, cb: h("input", { type: "checkbox" }) })); const body = h( "div", {}, h("label", { class: "field" }, h("span", {}, t("keys.form.account")), accountIn), h("label", { class: "field" }, h("span", {}, t("keys.form.rate")), rateIn), - h( - "label", - { class: "field" }, - h("span", {}, t("keys.form.allow")), - h("div", { class: "flex wrap" }, ...allowInputs.map(({ id, cb }) => h("label", { class: "check" }, cb, id))), - h("div", { class: "hint" }, t("keys.form.allowHint")) - ), h("label", { class: "field" }, h("span", {}, t("keys.form.custom")), customIn, h("div", { class: "hint" }, t("keys.form.customHint"))) ); modal(t("keys.form.title"), body, async () => { @@ -33,7 +23,7 @@ export async function renderKeys() { key: customIn.value.trim(), account: accountIn.value.trim() || "default", rate_per_min: parseInt(rateIn.value) || 0, - allow_models: allowInputs.filter(({ cb }) => cb.checked).map(({ id }) => id), + allow_models: [], }); reload(); showCreated(r.key);