Skip to content

Commit ea128da

Browse files
authored
docs(config): the plan display name is the frontend's, not /api/plans (#371)
`Plan.name` claimed "为空时 /api/plans 按 type 推导" — the opposite of what the endpoint does. `plans()` returns the config value verbatim (empty string when unset) and there is a gate pinning that: a backend-invented label would surface as Chinese text in the `en` UI, because response *data* fields are rendered as-is (`I18n.mapErr` only translates the `error` field). The `type` → label mapping lives in the frontend's `planLabel()`, which reads the language pack. The comment outlived the behaviour it describes: the derivation was removed in the same change that rewrote `plans()`'s own doc comment, which this struct field never received. Point at the real owner instead of restating the history that `gateway.rs` already carries. Comment only — no behaviour, no signature, no config-shape change.
1 parent 64c77f9 commit ea128da

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/config.rs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,9 @@ pub struct Provider {
361361
pub struct Plan {
362362
pub id: String,
363363
pub provider: String,
364-
/// 显示名(可选;为空时 /api/plans 按 type 推导)
364+
/// 显示名(可选):`config.example.toml` 的 `[[plans]]` 一律不写它 ⇒ `/api/plans` 原样回传
365+
/// 空串(语言中性标记,后端**不自造**);显示文案由前端 `planLabel()` 按 `type` 取语言包键
366+
///(机制与缘由见 `src/gateway.rs` 的 `plans()`)。
365367
#[serde(default)]
366368
pub name: String,
367369
/// paygo | token | coding

0 commit comments

Comments
 (0)