Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src-tauri/src/app_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ pub(crate) async fn check_app_update(
let unsupported_reason = if auto_update_supported {
None
} else if portable_support != Some(true) {
Some("当前程序不是支持自动升级的便携版,请手动下载首个支持版本".to_string())
Some("Current application is not a portable build supporting automatic updates; please download manually".to_string())
} else {
Some("更新清单不包含当前平台或架构".to_string())
Some("Update manifest does not include current platform or architecture".to_string())
};

let pending = if update_available && auto_update_supported {
Expand Down Expand Up @@ -244,7 +244,7 @@ pub(crate) async fn fetch_portable_update_manifest(
Err(error) => failures.push(format!("{}: {error}", candidate.display_name())),
}
}
Err(format!("所有软件版本检测源均失败: {}", failures.join("; ")))
Err(format!("All application version check sources failed: {}", failures.join("; ")))
}

pub(crate) async fn fetch_portable_update_manifest_from_gitcode(
Expand Down Expand Up @@ -291,11 +291,11 @@ pub(crate) async fn fetch_portable_update_manifest_url(
}

pub(crate) fn configured_gitcode_gui_repository() -> Option<&'static str> {
configured_gitcode_repository(option_env!("GITCODE_GUI_REPOSITORY"))
configured_gitcode_repository(option_env!("GITCODE_GUI_REPOSITORY").or(Some("lzt404/EasyCLIProxyAPI")))
}

pub(crate) fn configured_gitcode_core_repository() -> Option<&'static str> {
configured_gitcode_repository(option_env!("GITCODE_CORE_REPOSITORY"))
configured_gitcode_repository(option_env!("GITCODE_CORE_REPOSITORY").or(Some("lzt404/CLIProxyAPI")))
}

pub(crate) fn configured_gitcode_repository(
Expand Down Expand Up @@ -1072,7 +1072,7 @@ pub(crate) async fn download_portable_update_archive(
Err(error) => failures.push(error),
}
}
Err(format!("所有应用更新下载源均失败: {}", failures.join("; ")))
Err(format!("All application update download sources failed: {}", failures.join("; ")))
}

pub(crate) fn portable_update_download_urls(
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/core_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ pub(crate) async fn fetch_release(
Err(error) => failures.push(format!("{}: {error}", candidate.display_name())),
}
}
Err(format!("所有内核版本检测源均失败: {}", failures.join("")))
Err(format!("All core version check sources failed: {}", failures.join("; ")))
}

pub(crate) async fn fetch_release_from_github(
Expand Down Expand Up @@ -878,7 +878,7 @@ pub(crate) async fn download_asset(
let _ = fs::remove_file(archive_path);
return Err("内核发行版没有可用的下载地址".to_string());
}
Err(format!("所有内核下载源均失败: {}", failures.join("")))
Err(format!("All core download sources failed: {}", failures.join("; ")))
}

pub(crate) fn core_download_source_name(url: &str) -> String {
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ const LEGACY_GUI_CONFIG_FILE: &str = "cpa-gui.yaml";
const MIN_MAIN_WINDOW_WIDTH: u32 = 640;
const MIN_MAIN_WINDOW_HEIGHT: u32 = 600;
const MAX_SAVED_WINDOW_DIMENSION: u32 = 16_384;
const DEFAULT_MAIN_WINDOW_WIDTH: u32 = 1280;
const DEFAULT_MAIN_WINDOW_HEIGHT: u32 = 800;
const DEFAULT_MAIN_WINDOW_WIDTH: u32 = 1400;
const DEFAULT_MAIN_WINDOW_HEIGHT: u32 = 860;
const LEGACY_DEFAULT_MAIN_WINDOW_WIDTH: u32 = 1531;
const LEGACY_DEFAULT_MAIN_WINDOW_HEIGHT: u32 = 891;
const OAUTH_DIR_NAME: &str = "oauth";
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/src/tests/app_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ fn gui_config_defaults_are_stable() {
assert!(content.contains("close-behavior = \"ask\""));
assert!(content.contains("default-terminal = \"auto\""));
assert_eq!(config.default_terminal, DEFAULT_AGENT_TERMINAL);
assert!(content.contains("window-width = 1280"));
assert!(content.contains("window-height = 800"));
assert!(content.contains("window-width = 1400"));
assert!(content.contains("window-height = 860"));
assert!(content.contains("auth-dir = \"../oauth\""));
assert!(content.contains("[[api-keys]]"));
assert!(content.contains("key = \"123456\""));
Expand Down
10 changes: 5 additions & 5 deletions src-tauri/src/usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3179,7 +3179,7 @@ fn load_usage_analysis(
) -> Result<UsageAnalysis, String> {
Ok(UsageAnalysis {
models: load_simple_categories(connection, query, "model", "unknown")?,
providers: load_simple_categories(connection, query, "provider", "未知 Provider")?,
providers: load_simple_categories(connection, query, "provider", "Unknown Provider")?,
sources: load_source_categories(connection, query, config)?,
api_keys: load_api_key_categories(connection, query)?,
})
Expand All @@ -3190,7 +3190,7 @@ fn load_source_categories(
query: &UsageQuery,
config: &GuiConfigFile,
) -> Result<Vec<UsageCategory>, String> {
let mut categories = load_simple_categories(connection, query, "source", "未知来源")?;
let mut categories = load_simple_categories(connection, query, "source", "Unknown Source")?;
for category in &mut categories {
category.label = usage_source_display(config, "", &category.key);
}
Expand Down Expand Up @@ -3248,7 +3248,7 @@ fn load_api_key_categories(
let sql = format!(
r#"
SELECT
COALESCE(NULLIF(TRIM(api_key_hash), ''), '未记录密钥'),
COALESCE(NULLIF(TRIM(api_key_hash), ''), 'Unrecorded Key'),
MAX(TRIM(api_key_remark)),
MAX(TRIM(api_key_display)),
COUNT(*),
Expand Down Expand Up @@ -3529,14 +3529,14 @@ fn api_key_category_label(remark: String, display: String) -> String {
} else if !display.is_empty() {
mask_api_key(&display)
} else {
"未记录密钥".to_string()
"Unrecorded Key".to_string()
}
}

fn usage_source_display(config: &GuiConfigFile, provider: &str, source: &str) -> String {
let source = source.trim();
if source.is_empty() {
return "未知来源".to_string();
return "Unknown Source".to_string();
}
if let Some(remark) = config.api_access_remark_for_source(provider, source) {
return remark.to_string();
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
{
"label": "main",
"title": "EasyCLIProxyAPI",
"width": 1280,
"height": 800,
"width": 1400,
"height": 860,
"minWidth": 640,
"minHeight": 600,
"visible": false
Expand Down
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function AppContent() {
return;
}
} catch (error) {
console.error('读取关闭行为设置失败', error);
console.error('Failed to read close behavior settings', error);
}

setWindowsClosePrompt((current) =>
Expand All @@ -200,7 +200,7 @@ function AppContent() {
}
})
.catch((error) => {
console.error('监听 Windows 关闭确认事件失败', error);
console.error('Failed to listen for Windows close confirmation event', error);
});

return () => {
Expand Down Expand Up @@ -231,7 +231,7 @@ function AppContent() {
try {
await invoke('open_external_url', { url: CONTACT_URL });
} catch (error) {
console.error('打开联系我们链接失败', error);
console.error('Failed to open contact URL', error);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/AppErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class AppErrorBoundary extends Component<Props, State> {
}

componentDidCatch(error: Error, info: ErrorInfo) {
console.error('EasyCLIProxyAPI 渲染异常', error, info.componentStack);
console.error('EasyCLIProxyAPI render exception', error, info.componentStack);
}

render() {
Expand Down
2 changes: 1 addition & 1 deletion src/coreRuntime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function CoreRuntimeProvider({ children }: { children: ReactNode }) {
export function useCoreRuntime() {
const context = useContext(CoreRuntimeContext);
if (!context) {
throw new Error('useCoreRuntime 必须在 CoreRuntimeProvider 内使用');
throw new Error('useCoreRuntime must be used within a CoreRuntimeProvider');
}
return context;
}
1 change: 1 addition & 0 deletions src/i18n/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { invoke } from '@tauri-apps/api/core';
import { en, ja, zhCN, zhTW, type MessageKey, type MessageVariables } from './resources';

export type AppLocale = 'zh-CN' | 'zh-TW' | 'ja' | 'en';
export type { MessageKey };

export const languageOptions: ReadonlyArray<{
value: AppLocale;
Expand Down
Loading