From 3fbd8da71aead0c150c9dfb97a6f86d4d62a209b Mon Sep 17 00:00:00 2001 From: argszero Date: Mon, 28 Sep 2026 12:47:50 +0800 Subject: [PATCH] fix(i18n): drop the retired "shown once" claim from the generate-key toast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `settings.ak.gen.ok` (both packs) told the user the full API key is shown "仅此一次" / "once". That sentence was true when it was written (#86, v1.21) and stopped being true in v1.22.1 (#95): `GET /api/api-keys` now returns the owner-visible `full_key` next to the masked `key` (`src/dao.rs`, pinned by `routes::tests`), `copyKey()` copies it straight from the list data, and the `Live.fullKeys` session cache is gone -- which is why #95's own message records "removed ... the 'shown once' logic" and deletes the sibling string `settings.ak.copy.once`. #95 removed the logic and one carrier and left this one restating the retired fact. The comment three lines below `copyKey()` still states the policy the string violates: 「绝不提示「仅生成时展示一次」」. Value-only fix; no key added or removed: - zh: 已生成新 API Key「{name}」(完整 key 可在列表中随时复制) - en: New API Key “{name}” generated (full key can be copied from the list anytime) The sibling comment that repeated the same retired fact ("完整 key 仅生成时可得") now names the mechanism, and `ui/index.html` bumps the two changed cache-bust tokens. No behaviour change: the list keeps showing the backend-masked value, the copy button keeps handing out `full_key`, and the `{name}` slot is kept in both packs. Key counts are untouched (688 keys before and after), so the i18n gates still pass unchanged. --- ui/index.html | 4 ++-- ui/js/app.js | 4 +++- ui/js/i18n.js | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/index.html b/ui/index.html index 15747de..f910bdc 100644 --- a/ui/index.html +++ b/ui/index.html @@ -861,7 +861,7 @@

使用模型

- - + + diff --git a/ui/js/app.js b/ui/js/app.js index c3c233e..20a4d2b 100644 --- a/ui/js/app.js +++ b/ui/js/app.js @@ -2372,7 +2372,9 @@ pulseTbody($("#api-keys")); return; } - // P2-B:登录 → 后端 /api/api-keys(key 已脱敏;完整 key 仅生成时可得) + // P2-B:登录 → 后端 /api/api-keys(列表 `key` 是后端脱敏值 `atk_live_****xxxx`,属主的完整值 + // 随行返回 `full_key` ⇒ 复制按钮**随时**可取。「完整 key 仅生成时可得」是 v1.22.1(#95)之前的 + // 说法,见 copyKey 的注释 let list; if (Live.apiKeys) { // idx = 定位符:行内按钮带的索引是**缓存数组里的下标**,不是搜索过滤后的行号 diff --git a/ui/js/i18n.js b/ui/js/i18n.js index 4da5281..bf8788c 100644 --- a/ui/js/i18n.js +++ b/ui/js/i18n.js @@ -459,7 +459,7 @@ "settings.ak.del.fail": "删除失败", "settings.ak.rename.fail": "改名失败", "settings.ak.gen.fail": "生成失败", - "settings.ak.gen.ok": "已生成新 API Key「{name}」(完整 key 已展示,仅此一次)", + "settings.ak.gen.ok": "已生成新 API Key「{name}」(完整 key 可在列表中随时复制)", "settings.ak.gen.ok.mock": "已生成新 API Key「{name}」(完整 key 已展示在列表,可复制)", "settings.account": "账户", "settings.account.nickname": "昵称", @@ -1286,7 +1286,7 @@ "settings.ak.del.fail": "Delete failed", "settings.ak.rename.fail": "Rename failed", "settings.ak.gen.fail": "Generate failed", - "settings.ak.gen.ok": "New API Key “{name}” generated (full key shown once)", + "settings.ak.gen.ok": "New API Key “{name}” generated (full key can be copied from the list anytime)", "settings.ak.gen.ok.mock": "New API Key “{name}” generated (full key shown in the list, copyable)", "settings.account": "Account", "settings.account.nickname": "Nickname",