Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求旨在将 Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
| // GitHub 镜像配置(引导页中也可设置) | ||
| const githubMirrorEnabled = computed({ | ||
| get: () => appStore.githubMirrorEnabled, | ||
| set: (val) => appStore.githubMirrorEnabled = val | ||
| }) | ||
|
|
||
| const githubMirrorSource = computed({ | ||
| get: () => appStore.githubMirrorSource, | ||
| set: (val) => appStore.githubMirrorSource = val | ||
| }) | ||
|
|
||
| const githubMirrorCustomTemplate = computed({ | ||
| get: () => appStore.githubMirrorCustomTemplate, | ||
| set: (val) => appStore.githubMirrorCustomTemplate = val | ||
| }) | ||
|
|
||
| const githubMirrorSourceOptions = computed(() => [ | ||
| { label: t('settings.githubMirror.sources.gh-proxy-cf'), value: 'gh-proxy-cf' as const }, | ||
| { label: t('settings.githubMirror.sources.gh-proxy-fastly'), value: 'gh-proxy-fastly' as const }, | ||
| { label: t('settings.githubMirror.sources.gh-proxy-edgeone'), value: 'gh-proxy-edgeone' as const }, | ||
| { label: t('settings.githubMirror.sources.ghfast'), value: 'ghfast' as const }, | ||
| { label: t('settings.githubMirror.sources.custom'), value: 'custom' as const }, | ||
| ]) | ||
|
|
||
| const githubMirrorConnectivity = ref<{ status: 'idle' | 'testing' | 'success' | 'failed'; latency: number; error: string }>({ | ||
| status: 'idle', | ||
| latency: 0, | ||
| error: '' | ||
| }) | ||
|
|
||
| const getGithubMirrorTemplate = () => { | ||
| if (githubMirrorSource.value === 'custom') { | ||
| return githubMirrorCustomTemplate.value || '{url}' | ||
| } | ||
| return GITHUB_MIRROR_TEMPLATES[githubMirrorSource.value] | ||
| } | ||
|
|
||
| const testGithubMirrorConnection = async () => { | ||
| if (!TAURI_OK || !githubMirrorEnabled.value) { | ||
| githubMirrorConnectivity.value = { status: 'idle', latency: 0, error: '' } | ||
| return | ||
| } | ||
|
|
||
| const template = getGithubMirrorTemplate() | ||
| if (!template || template === '{url}') { | ||
| githubMirrorConnectivity.value = { status: 'idle', latency: 0, error: '' } | ||
| return | ||
| } | ||
|
|
||
| githubMirrorConnectivity.value = { status: 'testing', latency: 0, error: '' } | ||
| try { | ||
| const latency = await testGithubMirror(template) | ||
| githubMirrorConnectivity.value = { status: 'success', latency, error: '' } | ||
| } catch (e: any) { | ||
| console.error('GitHub mirror test failed:', e) | ||
| githubMirrorConnectivity.value = { | ||
| status: 'failed', | ||
| latency: 0, | ||
| error: typeof e === 'string' ? e : t('guide.connectionFailed') | ||
| } | ||
| } | ||
| } | ||
|
|
||
| const selectGithubMirrorSource = async (source: GithubMirrorSourceType) => { | ||
| githubMirrorSource.value = source | ||
| await testGithubMirrorConnection() | ||
| } | ||
|
|
||
| watch(githubMirrorEnabled, (enabled) => { | ||
| if (enabled) { | ||
| void testGithubMirrorConnection() | ||
| } else { | ||
| githubMirrorConnectivity.value = { status: 'idle', latency: 0, error: '' } | ||
| } | ||
| }) | ||
|
|
||
| watch(githubMirrorCustomTemplate, () => { | ||
| if (githubMirrorSource.value === 'custom') { | ||
| githubMirrorConnectivity.value = { status: 'idle', latency: 0, error: '' } | ||
| } | ||
| }) |
There was a problem hiding this comment.
| <img src="https://img.shields.io/badge/License-GPL_v2-blue.svg" alt="License"> | ||
| </a> | ||
| <img src="https://img.shields.io/badge/Version-0.1.2-green.svg" alt="Version"> | ||
| <img src="https://img.shields.io/badge/Version-0.2.1-green.svg" alt="Version"> |
| <img src="https://img.shields.io/badge/License-GPL_v2-blue.svg" alt="License"> | ||
| </a> | ||
| <img src="https://img.shields.io/badge/Version-0.1.2-green.svg" alt="Version"> | ||
| <img src="https://img.shields.io/badge/Version-0.2.1-green.svg" alt="Version"> |
There was a problem hiding this comment.
The version badge shows 0.2.1, which is inconsistent with the project version 0.3.1 defined in package.json and other configuration files. Please update the version in the documentation to match the actual project version to avoid confusion.
| <img src="https://img.shields.io/badge/Version-0.2.1-green.svg" alt="Version"> | |
| <img src="https://img.shields.io/badge/Version-0.3.1-green.svg" alt="Version"> |
| fn legacy_db_paths(app: &AppHandle, exe_dir: &Path) -> Vec<PathBuf> { | ||
| let mut paths = Vec::new(); | ||
|
|
||
| if !config_dir.exists() { | ||
| fs::create_dir_all(&config_dir).map_err(|e| e.to_string())?; | ||
| // Prefer the unconfigured default (portable `exe_dir/data` first, then `Documents/endcat`). | ||
| if let Ok(default_dir) = default_data_dir(app) { | ||
| paths.push(default_dir.join("database").join("endcat.db")); | ||
| } | ||
| if !db_dir.exists() { | ||
| fs::create_dir_all(&db_dir).map_err(|e| e.to_string())?; | ||
|
|
||
| // Legacy portable paths (old versions). | ||
| paths.push(exe_dir.join("data").join("database").join("endcat.db")); | ||
| paths.push(exe_dir.join("userData").join("endcat.db")); | ||
|
|
||
| if let Ok(dir) = app_config_dir(app) { | ||
| paths.push(dir.join("endcat.db")); | ||
| } | ||
|
|
||
| Ok(StoragePaths { | ||
| config: config_dir.join("config.json").to_string_lossy().to_string(), | ||
| database: db_dir.join("endcat.db").to_string_lossy().to_string(), | ||
| }) | ||
| paths | ||
| } |
准备将 dev 分支当前变更合并到 preview,用于后续预发布流程。
主要改动请查看本次 PR 的 commits 与 diff。