mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
chore(brand): surface ccswitch.io as the sole official website
Add an "Only Official Website" header to the three READMEs, an About panel button, and a tray menu entry — all pointing to ccswitch.io. Consolidates brand and SEO signals on the canonical domain across docs, GUI, and system tray.
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
|
||||
<a href="https://trendshift.io/repositories/15372" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15372" alt="farion1231%2Fcc-switch | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
|
||||
### 🌐 The Only Official Website: **[ccswitch.io](https://ccswitch.io)**
|
||||
|
||||
English | [中文](README_ZH.md) | [日本語](README_JA.md) | [Changelog](CHANGELOG.md)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
<a href="https://trendshift.io/repositories/15372" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15372" alt="farion1231%2Fcc-switch | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
|
||||
### 🌐 唯一の公式サイト:**[ccswitch.io](https://ccswitch.io)**
|
||||
|
||||
[English](README.md) | [中文](README_ZH.md) | 日本語 | [Changelog](CHANGELOG.md)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
<a href="https://trendshift.io/repositories/15372" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15372" alt="farion1231%2Fcc-switch | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
|
||||
### 🌐 唯一官方网站:**[ccswitch.io](https://ccswitch.io)**
|
||||
|
||||
[English](README.md) | 中文 | [日本語](README_JA.md) | [更新日志](CHANGELOG.md)
|
||||
|
||||
</div>
|
||||
|
||||
+23
-2
@@ -5,6 +5,7 @@
|
||||
use once_cell::sync::Lazy;
|
||||
use tauri::menu::{CheckMenuItem, Menu, MenuBuilder, MenuItem, Submenu, SubmenuBuilder};
|
||||
use tauri::{Emitter, Manager};
|
||||
use tauri_plugin_opener::OpenerExt;
|
||||
|
||||
use crate::app_config::AppType;
|
||||
use crate::error::AppError;
|
||||
@@ -20,6 +21,7 @@ static TRAY_SECTION_SUBMENUS: Lazy<
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct TrayTexts {
|
||||
pub show_main: &'static str,
|
||||
pub open_website: &'static str,
|
||||
pub no_providers_label: &'static str,
|
||||
pub lightweight_mode: &'static str,
|
||||
pub quit: &'static str,
|
||||
@@ -31,6 +33,7 @@ impl TrayTexts {
|
||||
match language {
|
||||
"en" => Self {
|
||||
show_main: "Open main window",
|
||||
open_website: "Open Official Website",
|
||||
no_providers_label: "(no providers)",
|
||||
lightweight_mode: "Lightweight Mode",
|
||||
quit: "Quit",
|
||||
@@ -38,6 +41,7 @@ impl TrayTexts {
|
||||
},
|
||||
"ja" => Self {
|
||||
show_main: "メインウィンドウを開く",
|
||||
open_website: "公式サイトを開く",
|
||||
no_providers_label: "(プロバイダーなし)",
|
||||
lightweight_mode: "軽量モード",
|
||||
quit: "終了",
|
||||
@@ -45,6 +49,7 @@ impl TrayTexts {
|
||||
},
|
||||
_ => Self {
|
||||
show_main: "打开主界面",
|
||||
open_website: "打开官方网站",
|
||||
no_providers_label: "(无供应商)",
|
||||
lightweight_mode: "轻量模式",
|
||||
quit: "退出",
|
||||
@@ -473,11 +478,22 @@ pub fn create_tray_menu(
|
||||
let mut section_handles: std::collections::HashMap<AppType, Submenu<tauri::Wry>> =
|
||||
std::collections::HashMap::new();
|
||||
|
||||
// 顶部:打开主界面
|
||||
// 顶部:打开主界面 / 打开官方网站
|
||||
let show_main_item =
|
||||
MenuItem::with_id(app, "show_main", tray_texts.show_main, true, None::<&str>)
|
||||
.map_err(|e| AppError::Message(format!("创建打开主界面菜单失败: {e}")))?;
|
||||
menu_builder = menu_builder.item(&show_main_item).separator();
|
||||
let open_website_item = MenuItem::with_id(
|
||||
app,
|
||||
"open_website",
|
||||
tray_texts.open_website,
|
||||
true,
|
||||
None::<&str>,
|
||||
)
|
||||
.map_err(|e| AppError::Message(format!("创建打开官方网站菜单失败: {e}")))?;
|
||||
menu_builder = menu_builder
|
||||
.item(&show_main_item)
|
||||
.item(&open_website_item)
|
||||
.separator();
|
||||
|
||||
// Pre-compute proxy running state (used to disable official providers in tray menu)
|
||||
let is_proxy_running = futures::executor::block_on(app_state.proxy_service.is_running());
|
||||
@@ -686,6 +702,11 @@ pub fn handle_tray_menu_event(app: &tauri::AppHandle, event_id: &str) {
|
||||
}
|
||||
}
|
||||
}
|
||||
"open_website" => {
|
||||
if let Err(e) = app.opener().open_url("https://ccswitch.io", None::<String>) {
|
||||
log::error!("打开官方网站失败: {e}");
|
||||
}
|
||||
}
|
||||
"lightweight_mode" => {
|
||||
if crate::lightweight::is_lightweight_mode() {
|
||||
if let Err(e) = crate::lightweight::exit_lightweight_mode(app) {
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
Download,
|
||||
Copy,
|
||||
ExternalLink,
|
||||
Globe,
|
||||
Info,
|
||||
Loader2,
|
||||
RefreshCw,
|
||||
@@ -360,6 +361,16 @@ export function AboutSection({ isPortable }: AboutSectionProps) {
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => settingsApi.openExternal("https://ccswitch.io")}
|
||||
className="h-8 gap-1.5 text-xs"
|
||||
>
|
||||
<Globe className="h-3.5 w-3.5" />
|
||||
{t("settings.officialWebsite")}
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
|
||||
@@ -643,6 +643,7 @@
|
||||
"releaseNotes": "Release Notes",
|
||||
"viewReleaseNotes": "View release notes for this version",
|
||||
"viewCurrentReleaseNotes": "View current version release notes",
|
||||
"officialWebsite": "Official Website",
|
||||
"oneClickInstall": "One-click Install",
|
||||
"oneClickInstallHint": "Install Claude Code / Codex / Gemini CLI / OpenCode",
|
||||
"localEnvCheck": "Local environment check",
|
||||
|
||||
@@ -643,6 +643,7 @@
|
||||
"releaseNotes": "リリースノート",
|
||||
"viewReleaseNotes": "このバージョンのリリースノートを見る",
|
||||
"viewCurrentReleaseNotes": "現在のバージョンのリリースノートを見る",
|
||||
"officialWebsite": "公式サイト",
|
||||
"oneClickInstall": "ワンクリックインストール",
|
||||
"oneClickInstallHint": "Claude Code / Codex / Gemini CLI / OpenCode をインストール",
|
||||
"localEnvCheck": "ローカル環境チェック",
|
||||
|
||||
@@ -643,6 +643,7 @@
|
||||
"releaseNotes": "更新日志",
|
||||
"viewReleaseNotes": "查看该版本更新日志",
|
||||
"viewCurrentReleaseNotes": "查看当前版本更新日志",
|
||||
"officialWebsite": "官方网站",
|
||||
"oneClickInstall": "一键安装",
|
||||
"oneClickInstallHint": "安装 Claude Code / Codex / Gemini CLI / OpenCode",
|
||||
"localEnvCheck": "本地环境检查",
|
||||
|
||||
Reference in New Issue
Block a user