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);