add: Verge Version copy button (#4164)

This commit is contained in:
Dyna
2025-07-23 11:11:34 +08:00
committed by GitHub
Unverified
parent f209d17e3c
commit f580409ade
4 changed files with 26 additions and 3 deletions

View File

@@ -4,6 +4,10 @@
- 修复系统主题窗口颜色不一致问题
### ✨ 新增功能
- 增加 `Verge Version` 复制按钮
## v2.3.2
### 🐞 修复问题

View File

@@ -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 (
<SettingList title={t("Verge Advanced Setting")}>
<ThemeViewer ref={themeRef} />
@@ -135,7 +141,16 @@ const SettingVergeAdvanced = ({ onError }: Props) => {
}
></SettingItem>
<SettingItem label={t("Verge Version")}>
<SettingItem
label={t("Verge Version")}
extra={
<TooltipIcon
icon={ContentCopyRounded}
onClick={copyVersion}
title={t("Copy Version")}
/>
}
>
<Typography sx={{ py: "7px", pr: 1 }}>v{version}</Typography>
</SettingItem>
</SettingList>

View File

@@ -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"
}

View File

@@ -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版本已复制到剪贴板"
}