Skip to content

Commit

Permalink
✨ 下载安装包
Browse files Browse the repository at this point in the history
  • Loading branch information
neila-a committed Aug 27, 2023
1 parent 8cca146 commit 3f765ae
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
4 changes: 3 additions & 1 deletion app/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,7 @@
"创建工具列表": "创建工具列表",
"编辑工具列表": "编辑工具列表",
"删除此工具列表": "删除此工具列表",
"确定删除此工具列表吗?": "确定删除此工具列表吗?"
"确定删除此工具列表吗?": "确定删除此工具列表吗?",
"将本应用通过浏览器添加至桌面": "将本应用通过浏览器添加至桌面",
"下载单独安装包": "下载单独安装包"
}
25 changes: 22 additions & 3 deletions app/setting/Options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
InputLabel,
Select,
MenuItem,
Button
Button,
ButtonGroup
} from "@mui/material";
import {
Download as DownloadIcon
Expand All @@ -22,9 +23,11 @@ import {
import {
stringifyCheck
} from "./Switcher";
import PureDialog from "../components/dialog/PureDialog";
export type options = [string, string, stringifyCheck];
export default function Options() {
var [lang, setLang] = useState<string>("");
var [lang, setLang] = useState<string>(""),
[dialogOpen, setDialogOpen] = useState<boolean>(false);
return (
<FormGroup>
{([["fork-me-on-github", "Fork me on GitHub", "false"], ["darkmode", "暗色模式", "false"], ["color", "多彩主页", "true"]] as options[]).map((options, index) => (
Expand Down Expand Up @@ -56,10 +59,26 @@ export default function Options() {
<Button variant="contained" startIcon={
<DownloadIcon />
} onClick={() => {
window.installPWA();
setDialogOpen(true);
}}>
{I18N.get("下载本应用")}
</Button>
{dialogOpen && <PureDialog title={I18N.get("下载本应用")} onClose={() => {
setDialogOpen(false);
}}>
<ButtonGroup variant="contained" fullWidth>
<Button onClick={event => {
window.installPWA();
}}>
{I18N.get("将本应用通过浏览器添加至桌面")}
</Button>
<Button onClick={event => {
window.location.href = "https://github.com/neila-a/NeilaTools/releases";
}}>
{I18N.get("下载单独安装包")}
</Button>
</ButtonGroup>
</PureDialog>}
</FormGroup>
);
}

1 comment on commit 3f765ae

@vercel
Copy link

@vercel vercel bot commented on 3f765ae Aug 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.