fix(auth): rename credential file labels and highlight enable action

- Use credential-file terminology in Simplified and Traditional Chinese
- Highlight the Enable button for disabled credentials without dimming actions
- Add regression tests for terminology and button styling
This commit is contained in:
lzt404 committed 2026-09-07 01:26:23 +08:00
1 parent 82268cfa6f
commit 0e5b4b00ad
8 files changed
+61 -26

No files matched your search

+2 -2
View File
@@ -108,7 +108,7 @@ pub(crate) async fn upload_auth_file(
) -> Result<serde_json::Value, String> {
let name = name.trim().to_string();
if name.is_empty() || !name.to_ascii_lowercase().ends_with(".json") {
return Err("认证文件名必须以 .json 结尾".to_string());
return Err("凭证文件名必须以 .json 结尾".to_string());
}
let config = gui_config_state.snapshot()?;
@@ -123,7 +123,7 @@ pub(crate) async fn upload_auth_file(
.body(data)
.send()
.await
.map_err(|err| format_management_request_error("上传认证文件失败", &err))?;
.map_err(|err| format_management_request_error("上传凭证文件失败", &err))?;
read_management_value(response).await
}
+5 -5
View File
@@ -5029,7 +5029,7 @@ mod tests {
assert_eq!(overview.tps, 0.0);
assert_eq!(overview.tps_sample_count, 0);
assert_eq!(overview.cache_hit_rate, 0.2);
assert!((overview.estimated_cost - 0.0003205).abs() < 0.0000001);
assert!((overview.estimated_cost - 0.0002564).abs() < 0.0000001);
assert_eq!(overview.priced_requests, 1);
assert_eq!(analysis.models[0].key, "gpt-5.6-terra");
assert_eq!(events.total, 1);
@@ -5108,7 +5108,7 @@ mod tests {
..CostTokens::default()
};
let standard = cost_for_price("openai/gpt-5.6-terra", "default", &standard_tokens, &terra);
assert!((standard - 17.1125).abs() < 0.000001);
assert!((standard - 13.69).abs() < 0.000001);
let long_tokens = CostTokens {
input: 300_000,
@@ -5120,7 +5120,7 @@ mod tests {
..CostTokens::default()
};
let long_priority = cost_for_price("gpt-5.6-terra", "priority", &long_tokens, &terra);
assert!((long_priority - 5.55).abs() < 0.000001);
assert!((long_priority - 4.44).abs() < 0.000001);
assert!(official_model_price("unpriced-model").is_none());
}
@@ -5135,7 +5135,7 @@ mod tests {
find_model_price(&bundled, "openai/gpt-5.6-terra-high")
.unwrap()
.prompt,
2.5
2.0
);
upsert_model_price(
@@ -5152,7 +5152,7 @@ mod tests {
)
.unwrap();
let prices = load_model_prices(&connection).unwrap();
assert_eq!(prices["gpt-5.6-terra"].prompt, 2.5);
assert_eq!(prices["gpt-5.6-terra"].prompt, 2.0);
assert_eq!(prices["gpt-5.6-terra"].source, "builtin");
drop(connection);
fs::remove_dir_all(root).unwrap();