diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f8adee..9a29623 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ ## [Unreleased] +### 新增 + +- 设置页「交流群」:展示微信号 `JavaScript2`,可一键复制;README 补充加群说明与二维码。 + - Settings → Community: WeChat ID `JavaScript2` with copy; README adds join instructions and QR. + ## [0.1.3] - 2026-10-18 ### 修复 diff --git a/README.md b/README.md index 74baea2..d2d6a60 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,16 @@ | **Containers** | 创建(端口 / bind / 命名卷);行内 Start / Stop / Restart / Logs / Inspect / Exec / Remove;catalog + `OpenContainer` 跨重启恢复 | | **Images** | 拉取弹窗;行内创建容器 / 删除 | | **Volumes** | 弹窗创建(1/2/5/10 GiB);行内删除 | -| **设置** | 可滚动;语言、主题、关闭窗口行为、会话 CPU / 内存(下次新建会话生效);关于(版本 / GitHub / 检查更新) | +| **设置** | 可滚动;语言、主题、关闭窗口行为、会话 CPU / 内存(下次新建会话生效);关于(版本 / GitHub / 检查更新);交流群(微信号) | Logs 走 fork 的 `LogsOptions`(底层 `wslc --session wslc-desktop container logs`)。关闭窗口可最小化到托盘(容器继续运行),或退出并停止运行中的容器;删除容器时命名卷需单独确认。会话本身不会在退出时 `terminate`,便于下次重连。 +## 交流群 + +添加微信 **JavaScript2**,备注「WSLc」,即可拉你进交流群。也可扫下方二维码加好友。 + +![微信二维码](docs/wechat-qr.png) + ## 从源码构建 **要求:** Windows 10/11 x64 · WSL 2.9.3+ · Rust stable-MSVC · VS 2022 C++ + Windows SDK + CMake diff --git a/docs/wechat-qr.png b/docs/wechat-qr.png new file mode 100644 index 0000000..b5ed3d5 Binary files /dev/null and b/docs/wechat-qr.png differ diff --git a/src/app/settings.rs b/src/app/settings.rs index 07fb514..75b1c49 100644 --- a/src/app/settings.rs +++ b/src/app/settings.rs @@ -22,8 +22,15 @@ use super::AppView; const CPU_CHOICES: [u32; 5] = [1, 2, 4, 6, 8]; const MEMORY_CHOICES_MB: [u32; 5] = [1024, 2048, 4096, 8192, 16384]; +/// WeChat ID used to invite users into the community group. +const WECHAT_ID: &str = "JavaScript2"; impl AppView { + fn copy_wechat_id(&mut self, cx: &mut Context) { + cx.write_to_clipboard(ClipboardItem::new_string(WECHAT_ID.to_string())); + self.set_status(self.t().settings_community_copied, cx); + } + pub(crate) fn save_session_prefs(&mut self, cx: &mut Context) { let prefs = self.session_prefs.clone().clamp(); self.session_prefs = prefs.clone(); @@ -396,6 +403,36 @@ impl AppView { .text_color(cx.theme().muted_foreground) .child(releases_url()), ), + ) + .child( + settings_card_section(t.settings_community, t.settings_community_hint, cx) + .child( + div().text_sm().child(i18n::fmt1( + t.settings_community_intro, + "id", + WECHAT_ID, + )), + ) + .child( + h_flex() + .gap_2() + .items_center() + .flex_wrap() + .child( + div().text_sm().child(format!( + "{} {}", + t.settings_community_wechat_id, WECHAT_ID + )), + ) + .child( + Button::new("community-copy-wechat") + .small() + .label(t.settings_community_copy) + .on_click(cx.listener(|this, _, _, cx| { + this.copy_wechat_id(cx); + })), + ), + ), ), ) } diff --git a/src/i18n.rs b/src/i18n.rs index 118a2e7..fe996ef 100644 --- a/src/i18n.rs +++ b/src/i18n.rs @@ -247,6 +247,12 @@ pub struct Strings { pub settings_about_open_release: &'static str, pub settings_about_check_failed: &'static str, pub settings_about_open_failed: &'static str, + pub settings_community: &'static str, + pub settings_community_hint: &'static str, + pub settings_community_intro: &'static str, + pub settings_community_wechat_id: &'static str, + pub settings_community_copy: &'static str, + pub settings_community_copied: &'static str, pub close_prompt_title: &'static str, pub close_prompt_body: &'static str, @@ -478,7 +484,7 @@ pub static EN: Strings = Strings { pull_ok: "OK", pull_failed: "FAILED", - settings_intro: "Language, appearance, close-window behavior, session resources, and about. Language defaults from the system locale (Chinese → 中文, otherwise English).", + settings_intro: "Language, appearance, close-window behavior, session resources, about, and community. Language defaults from the system locale (Chinese → 中文, otherwise English).", language: "Language", language_hint: "UI language for menus, buttons, and status text.", theme: "Theme", @@ -509,6 +515,12 @@ pub static EN: Strings = Strings { settings_about_open_release: "Open release page", settings_about_check_failed: "Could not check for updates: {err}", settings_about_open_failed: "Could not open link: {err}", + settings_community: "Community", + settings_community_hint: "Join the WeChat group for WSLc Desktop tips and discussion.", + settings_community_intro: "Add WeChat ID {id}, note \"WSLc\", and we'll invite you to the group.", + settings_community_wechat_id: "WeChat ID", + settings_community_copy: "Copy WeChat ID", + settings_community_copied: "WeChat ID copied", close_prompt_title: "Close WSLc Desktop", close_prompt_body: "Minimize keeps the manager in the system tray and leaves containers running. Quit and stop shuts down every running container in this session, then exits the app. Your choice is saved and can be changed later in Settings.", @@ -732,7 +744,7 @@ pub static ZH: Strings = Strings { pull_ok: "成功", pull_failed: "失败", - settings_intro: "语言、外观、关闭窗口行为、会话资源与关于信息。语言默认跟随系统区域设置(中文 → 中文,否则英文)。", + settings_intro: "语言、外观、关闭窗口行为、会话资源、关于与交流群。语言默认跟随系统区域设置(中文 → 中文,否则英文)。", language: "语言", language_hint: "菜单、按钮与状态栏使用的界面语言。", theme: "主题", @@ -763,6 +775,12 @@ pub static ZH: Strings = Strings { settings_about_open_release: "打开发布页", settings_about_check_failed: "检查更新失败:{err}", settings_about_open_failed: "无法打开链接:{err}", + settings_community: "交流群", + settings_community_hint: "加入微信群,交流 WSLc Desktop 使用经验与问题。", + settings_community_intro: "添加微信 {id},备注「WSLc」,即可拉你进交流群。", + settings_community_wechat_id: "微信号", + settings_community_copy: "复制微信号", + settings_community_copied: "已复制微信号", close_prompt_title: "关闭 WSLc Desktop", close_prompt_body: "最小化会把管理器收进系统托盘,容器继续运行。「退出并停止」会停止本会话中所有运行中的容器,然后退出应用。本次选择会自动保存,之后可在设置中修改。",