From 66354ecb8329ecb5ddf09a1995ffb6ab7040d4fe Mon Sep 17 00:00:00 2001 From: argszero Date: Sat, 12 Sep 2026 13:05:28 +0800 Subject: [PATCH] fix(ui): remove the dead plan-note hint from the listing form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `showPlanHint()` appended ` · {note}` from the selected plan, but the only reachable plan source (`Live.plans`, i.e. `GET /api/plans`) never returns a `note` field: `src/config.rs`'s `Plan` struct has none and `[[plans]]` in `config.example.toml` declares none (verified across all history). So for a logged-in user the expression `pl.note` is always undefined, the ternary never fires, and the suffix never renders — the hint keeps only the paygo/subscription text. The read became dead in `a2e40f2` ("fix(integration): 3 browser-found bugs"), which switched the plan source from the `data.js` fallback to `GET /api/plans` without carrying `note` across. `44a3040` cleaned up the sibling UI-only field `keyPrefix` (read + i18n key + fallback field) but left `note` behind, because at that point `note` had never had a config counterpart. This removes the dead read and the now-unused `share.plan.note` key from both language packs (its only call site was here), and corrects the `ui/README.md` line that promised an endpoint hint the form can no longer show. The `note` values in `ui/js/data.js`'s fallback `PLANS` are left in place: they are inert (no longer referenced) and describe each plan's real endpoint conventions, so surfacing them properly would mean promoting them to config `[[plans]]` — a separate, product-level change. No production Rust behaviour changes; the i18n gate control values follow the extraction (786→785 keys, 538→537 call sites, 431→430 distinct). --- src/i18n_pack.rs | 8 ++++---- ui/README.md | 2 +- ui/index.html | 10 +++++----- ui/js/app.js | 8 +++++--- ui/js/i18n.js | 2 -- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/i18n_pack.rs b/src/i18n_pack.rs index 3d74865..5ecce8f 100644 --- a/src/i18n_pack.rs +++ b/src/i18n_pack.rs @@ -43,12 +43,12 @@ const EN_END: &str = "\n };"; /// 是这条阳性对照把 531 报了出来。改动后请以提取器的实际输出校准,再核对是否与 diff 相符。 /// 本轮实测的校准路径就是这条规则:783/531/426 三处**依次**报出 786 → 535 → 429, /// 每一步都是先让门禁报出真值、再照抄,而不是先写一个自己算的数。 -const ZH_KEY_COUNT: usize = 786; -const EN_KEY_COUNT: usize = 786; +const ZH_KEY_COUNT: usize = 785; +const EN_KEY_COUNT: usize = 785; const STATIC_ATTR_COUNT: usize = 330; const STATIC_ATTR_DISTINCT: usize = 305; -const T_LITERAL_COUNT: usize = 538; -const T_LITERAL_DISTINCT: usize = 431; +const T_LITERAL_COUNT: usize = 537; +const T_LITERAL_DISTINCT: usize = 430; /// 切出语言包区段(起点标记 → 终点标记,含起点)。 fn pack_region<'a>(src: &'a str, start_mark: &str, end_mark: &str) -> &'a str { diff --git a/ui/README.md b/ui/README.md index 8a7a625..2fb265d 100644 --- a/ui/README.md +++ b/ui/README.md @@ -50,7 +50,7 @@ python3 -m http.server 8000 --directory ui 1. 仪表盘 Dashboard — 点数余额、本月用量、共享收益、**本月点数变化(近 1 月按类型汇总收支:赠送/过期/收益/消费/充值/提现 + 净变化,取代静态"点数来源"分组)** 2. 模型市场 Marketplace — 模型浏览、**搜索(输入防抖 ~150ms + 关键词 `` 高亮 + 清空 × 按钮,v1.18 D)**、厂商筛选、排序(按价格/上下文);可用性标注「多 key · 自动故障转移」(该模型配置多个上游 key,架构 v0.2 路由策略);每行「使用 / 消费」入口 → 聊天 Mock 模拟调用(按模型输出参考价扣小数点数,如 -0.38 点,产生消费交易;余额不足时阻断并提示) -3. 共享管理 Sharing — 默认只显示统计 + 我的共享列表(key 脱敏展示,可暂停/恢复/重新上架/彻底删除;列表展示「厂商 · Plan / 模型 · 可用时间段」,如「智谱 · GLM Coding Plan / glm-5.2 · 周一~周五 09:00-18:00」,未设置显示「全天」);点击"+ 添加 / 上架新 key"展开上架表单(**三级联动:厂商 → Plan → 模型**——内置国内已知 Plan 清单(阿里云百炼 / 智谱 / 火山方舟 / Kimi / MiniMax / DeepSeek,每家含「API(按量)」= 按量计价的 key),选 Plan 后显示专属端点提示;**可用时间段为结构化字段**:星期多选 chips + 起止时间(留空 = 全天不限),备注仅纯文本;须填 API Key,平台加密托管;分享者只填声明额度,单价由平台按模型定价自动计算并展示参考价),提交成功或取消后自动收起 +3. 共享管理 Sharing — 默认只显示统计 + 我的共享列表(key 脱敏展示,可暂停/恢复/重新上架/彻底删除;列表展示「厂商 · Plan / 模型 · 可用时间段」,如「智谱 · GLM Coding Plan / glm-5.2 · 周一~周五 09:00-18:00」,未设置显示「全天」);点击"+ 添加 / 上架新 key"展开上架表单(**三级联动:厂商 → Plan → 模型**——内置国内已知 Plan 清单(阿里云百炼 / 智谱 / 火山方舟 / Kimi / MiniMax / DeepSeek,每家含「API(按量)」= 按量计价的 key),选 Plan 后显示 Plan 类型(按量 / 订阅);**可用时间段为结构化字段**:星期多选 chips + 起止时间(留空 = 全天不限),备注仅纯文本;须填 API Key,平台加密托管;分享者只填声明额度,单价由平台按模型定价自动计算并展示参考价),提交成功或取消后自动收起 4. 钱包 Wallet — 点数余额、**本月点数变化(近 1 月按类型汇总收支 + 净变化,与仪表盘一致)**、**充值入口(US-4:模拟流程——输入点数 → 余额增加 → topup 交易记录;文案注明"演示,真实支付后续接入";提现仍 disabled)**、**申请加额(US-20:企业成员余额低时申请更多点数 → 提交后等待管理员审批,默认需审批)**;收支明细已去重,统一到【交易记录】(页内提供跳转提示) 5. 交易记录 Transactions — 消费/收益/充值/提现/赠送(gift)唯一明细入口,Tab 筛选 + MRT 风格表格(列排序/列筛选/分页,与 Tab 叠加生效) 6. 设置 Settings — 账户、**API Key 管理(独占整行全宽,表格字段不挤压;完整增删改查:生成带名字、改名、删除需确认「删除后该 key 立即失效」、按名字搜索(防抖+高亮+清空,v1.18 D)、一键复制完整 key——列表脱敏展示 atk_live_****xxxx,复制为完整值;file:// 下 clipboard API 受限时降级为选中+Ctrl/Cmd+C)**、通知、偏好 diff --git a/ui/index.html b/ui/index.html index 7ef28bb..92d3d67 100644 --- a/ui/index.html +++ b/ui/index.html @@ -5,7 +5,7 @@ AITokenPool - + @@ -842,9 +842,9 @@

使用模型

- - - - + + + + diff --git a/ui/js/app.js b/ui/js/app.js index 2e5a91b..23ed72b 100644 --- a/ui/js/app.js +++ b/ui/js/app.js @@ -390,15 +390,17 @@ } } - // Plan 提示:按量/订阅 + 专属端点说明(来自 PLANS;登录后为 /api/plans) + // Plan 提示:按量/订阅(来自 PLANS;登录后为 /api/plans) + // 注:曾拼接 ` · {note}`(data.js 的端点说明),但 /api/plans 从不返回 note + //(config [[plans]] 与 Plan 结构体均无该字段)⇒ 登录态(唯一可达路径)恒为 undefined, + // 该后缀永不显示 ⇒ 已移除读点与 i18n 键 `share.plan.note`(同 44a3040 清 keyPrefix 的先例)。 function showPlanHint(planId) { const el = $("#sf-plan-hint"); if (!el) return; const plans = Live.plans || D.PLANS; const pl = plans.find((x) => x.id === planId); if (!pl) { el.textContent = ""; return; } - el.textContent = (pl.type === "paygo" ? T("share.plan.paygo") : T("share.plan.sub")) + - (pl.note ? T("share.plan.note", { note: pl.note }) : ""); + el.textContent = pl.type === "paygo" ? T("share.plan.paygo") : T("share.plan.sub"); } /* ---------------- 导航 ---------------- */ diff --git a/ui/js/i18n.js b/ui/js/i18n.js index 829d49a..2d4b2f8 100644 --- a/ui/js/i18n.js +++ b/ui/js/i18n.js @@ -307,7 +307,6 @@ "share.select.model": "选择模型", "share.plan.paygo": "按量计价的 key", "share.plan.sub": "订阅 Plan", - "share.plan.note": " · {note}", "share.price.auto": "{n} 点 / 1M 输出(自动)", "share.price.default": "按默认价:{n} 点 / 1M 输出(自动)", "share.priceUnit": "点/1M", @@ -1123,7 +1122,6 @@ "share.select.model": "Select model", "share.plan.paygo": "Pay-as-you-go key", "share.plan.sub": "Subscription Plan", - "share.plan.note": " · {note}", "share.price.auto": "{n} pts / 1M output (auto)", "share.price.default": "Default price: {n} pts / 1M output (auto)", "share.priceUnit": "pts/1M",