feat: support to open core dir

This commit is contained in:
GyDi
2022-12-13 00:44:24 +08:00
parent d93b00cd15
commit 5c5177ec57
6 changed files with 29 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ import {
Switch,
Typography,
} from "@mui/material";
import { openAppDir, openLogsDir, patchVergeConfig } from "@/services/cmds";
import { openAppDir, openCoreDir, openLogsDir } from "@/services/cmds";
import { ArrowForward } from "@mui/icons-material";
import { useVerge } from "@/hooks/use-verge";
import { version } from "@root/package.json";
@@ -94,7 +94,7 @@ const SettingVerge = ({ onError }: Props) => {
onCatch={onError}
onFormat={onSwitchFormat}
onChange={(e) => onChangeData({ traffic_graph: e })}
onGuard={(e) => patchVergeConfig({ traffic_graph: e })}
onGuard={(e) => patchVerge({ traffic_graph: e })}
>
<Switch edge="end" />
</GuardState>
@@ -155,6 +155,17 @@ const SettingVerge = ({ onError }: Props) => {
</IconButton>
</SettingItem>
<SettingItem label={t("Open Core Dir")}>
<IconButton
color="inherit"
size="small"
sx={{ my: "2px" }}
onClick={openCoreDir}
>
<ArrowForward />
</IconButton>
</SettingItem>
<SettingItem label={t("Open Logs Dir")}>
<IconButton
color="inherit"