mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 05:13:44 +08:00
feat: add lite mode toggle to home page
This commit is contained in:
parent
772ecdd3b0
commit
74e441df5b
@ -23,6 +23,7 @@ import {
|
|||||||
DnsOutlined,
|
DnsOutlined,
|
||||||
SpeedOutlined,
|
SpeedOutlined,
|
||||||
HelpOutlineRounded,
|
HelpOutlineRounded,
|
||||||
|
HistoryEduOutlined,
|
||||||
} from "@mui/icons-material";
|
} from "@mui/icons-material";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { ProxyTunCard } from "@/components/home/proxy-tun-card";
|
import { ProxyTunCard } from "@/components/home/proxy-tun-card";
|
||||||
@ -36,7 +37,7 @@ import { BasePage } from "@/components/base";
|
|||||||
import { ClashInfoCard } from "@/components/home/clash-info-card";
|
import { ClashInfoCard } from "@/components/home/clash-info-card";
|
||||||
import { SystemInfoCard } from "@/components/home/system-info-card";
|
import { SystemInfoCard } from "@/components/home/system-info-card";
|
||||||
import { useLockFn } from "ahooks";
|
import { useLockFn } from "ahooks";
|
||||||
import { openWebUrl } from "@/services/cmds";
|
import { openWebUrl, patchVergeConfig } from "@/services/cmds";
|
||||||
import { TestCard } from "@/components/home/test-card";
|
import { TestCard } from "@/components/home/test-card";
|
||||||
import { IpInfoCard } from "@/components/home/ip-info-card";
|
import { IpInfoCard } from "@/components/home/ip-info-card";
|
||||||
|
|
||||||
@ -258,6 +259,11 @@ const HomePage = () => {
|
|||||||
contentStyle={{ padding: 2 }}
|
contentStyle={{ padding: 2 }}
|
||||||
header={
|
header={
|
||||||
<Box sx={{ display: "flex", alignItems: "center" }}>
|
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||||
|
<Tooltip title={t("Lite Mode")} arrow>
|
||||||
|
<IconButton onClick={() => patchVergeConfig({ enable_lite_mode: true })} size="small" color="inherit">
|
||||||
|
<HistoryEduOutlined />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
<Tooltip title={t("Manual")} arrow>
|
<Tooltip title={t("Manual")} arrow>
|
||||||
<IconButton onClick={toGithubDoc} size="small" color="inherit">
|
<IconButton onClick={toGithubDoc} size="small" color="inherit">
|
||||||
<HelpOutlineRounded />
|
<HelpOutlineRounded />
|
||||||
@ -275,9 +281,9 @@ const HomePage = () => {
|
|||||||
{/* 订阅和当前节点部分 */}
|
{/* 订阅和当前节点部分 */}
|
||||||
{homeCards.profile && (
|
{homeCards.profile && (
|
||||||
<Grid size={6}>
|
<Grid size={6}>
|
||||||
<HomeProfileCard
|
<HomeProfileCard
|
||||||
current={current}
|
current={current}
|
||||||
onProfileUpdated={mutateProfiles}
|
onProfileUpdated={mutateProfiles}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user