diff --git a/UPDATELOG.md b/UPDATELOG.md index 2d65f3ae..1699da04 100644 --- a/UPDATELOG.md +++ b/UPDATELOG.md @@ -4,6 +4,10 @@ - 修复系统主题窗口颜色不一致问题 +### ✨ 新增功能 + +- 增加 `Verge Version` 复制按钮 + ## v2.3.2 ### 🐞 修复问题 diff --git a/src/components/setting/setting-verge-advanced.tsx b/src/components/setting/setting-verge-advanced.tsx index 02fc8423..d3d7fa46 100644 --- a/src/components/setting/setting-verge-advanced.tsx +++ b/src/components/setting/setting-verge-advanced.tsx @@ -61,6 +61,12 @@ const SettingVergeAdvanced = ({ onError }: Props) => { showNotice("success", t("Copy Success"), 1000); }, []); + const copyVersion = useCallback(() => { + navigator.clipboard.writeText(`v${version}`).then(() => { + showNotice("success", t("Version copied to clipboard"), 1000); + }); + }, [version, t]); + return ( @@ -135,7 +141,16 @@ const SettingVergeAdvanced = ({ onError }: Props) => { } > - + + } + > v{version} diff --git a/src/locales/en.json b/src/locales/en.json index 6c51d8b7..c2da4bc9 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -651,5 +651,7 @@ "Please enter a valid url": "Please enter a valid url", "Add": "Add", "Development mode: Automatically includes Tauri and localhost origins": "Development mode: Automatically includes Tauri and localhost origins", - "Invalid regular expression": "Invalid regular expression" + "Invalid regular expression": "Invalid regular expression", + "Copy Version": "Copy Version", + "Version copied to clipboard": "Version copied to clipboard" } diff --git a/src/locales/zh.json b/src/locales/zh.json index 76413cb0..8421adde 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -651,5 +651,7 @@ "Please enter a valid url": "请输入有效的网址", "Add": "添加", "Development mode: Automatically includes Tauri and localhost origins": "开发模式:自动包含 Tauri 和 localhost 来源", - "Invalid regular expression": "无效的正则表达式" + "Invalid regular expression": "无效的正则表达式", + "Copy Version": "复制Verge版本号", + "Version copied to clipboard": "Verge版本已复制到剪贴板" }