mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-13 14:22:08 +08:00
refactor: reorganize component and hook structure; remove unused modules
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
import { Box, BoxProps } from "@mui/material";
|
||||
import React from "react";
|
||||
|
||||
interface CenterProps extends BoxProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export const Center: React.FC<CenterProps> = ({ children, ...props }) => {
|
||||
return (
|
||||
<Box
|
||||
display="flex"
|
||||
justifyContent="center"
|
||||
alignItems="center"
|
||||
width="100%"
|
||||
height="100%"
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -3,14 +3,14 @@ import { Divider, Stack, Typography } from "@mui/material";
|
||||
import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { useClash } from "@/hooks/use-clash";
|
||||
import {
|
||||
useAppUptime,
|
||||
useClashConfig,
|
||||
useRulesData,
|
||||
useSystemProxyAddress,
|
||||
useSystemProxyData,
|
||||
} from "@/hooks/app-data";
|
||||
import { useClash } from "@/hooks/use-clash";
|
||||
} from "@/hooks/use-clash-data";
|
||||
|
||||
import { EnhancedCard } from "./enhanced-card";
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { closeAllConnections } from "tauri-plugin-mihomo-api";
|
||||
|
||||
import { useClashConfig } from "@/hooks/app-data";
|
||||
import { useClashConfig } from "@/hooks/use-clash-data";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
import { patchClashMode } from "@/services/cmds";
|
||||
import type { TranslationKey } from "@/types/generated/i18n-keys";
|
||||
|
||||
@@ -34,7 +34,11 @@ import { useNavigate } from "react-router";
|
||||
import { delayGroup, healthcheckProxyProvider } from "tauri-plugin-mihomo-api";
|
||||
|
||||
import { EnhancedCard } from "@/components/home/enhanced-card";
|
||||
import { useClashConfig, useProxiesData, useRulesData } from "@/hooks/app-data";
|
||||
import {
|
||||
useClashConfig,
|
||||
useProxiesData,
|
||||
useRulesData,
|
||||
} from "@/hooks/use-clash-data";
|
||||
import { useProfiles } from "@/hooks/use-profiles";
|
||||
import { useProxySelection } from "@/hooks/use-proxy-selection";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
|
||||
@@ -24,7 +24,7 @@ import { useCallback, useMemo, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useNavigate } from "react-router";
|
||||
|
||||
import { useRefreshAll } from "@/hooks/app-data";
|
||||
import { useRefreshAll } from "@/hooks/use-clash-data";
|
||||
import { openWebUrl, updateProfile } from "@/services/cmds";
|
||||
import { showNotice } from "@/services/noticeService";
|
||||
import parseTraffic from "@/utils/parse-traffic";
|
||||
|
||||
@@ -20,9 +20,9 @@ import { useTranslation } from "react-i18next";
|
||||
import { useNavigate } from "react-router";
|
||||
import useSWR from "swr";
|
||||
|
||||
import { useServiceInstaller } from "@/hooks/use-service-installer";
|
||||
import { useSystemState } from "@/hooks/use-system-state";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
import { useServiceInstaller } from "@/hooks/useServiceInstaller";
|
||||
import { getSystemInfo } from "@/services/cmds";
|
||||
import { showNotice } from "@/services/noticeService";
|
||||
import { checkUpdateSafe as checkUpdate } from "@/services/update";
|
||||
|
||||
@@ -22,7 +22,7 @@ import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { updateProxyProvider } from "tauri-plugin-mihomo-api";
|
||||
|
||||
import { useProxiesData, useProxyProvidersData } from "@/hooks/app-data";
|
||||
import { useProxiesData, useProxyProvidersData } from "@/hooks/use-clash-data";
|
||||
import { showNotice } from "@/services/noticeService";
|
||||
import parseTraffic from "@/utils/parse-traffic";
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import {
|
||||
selectNodeForGroup,
|
||||
} from "tauri-plugin-mihomo-api";
|
||||
|
||||
import { useProxiesData } from "@/hooks/app-data";
|
||||
import { useProxiesData } from "@/hooks/use-clash-data";
|
||||
import { calcuProxies, updateProxyChainConfigInRuntime } from "@/services/cmds";
|
||||
import { debugLog } from "@/utils/debug";
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { Virtuoso, type VirtuosoHandle } from "react-virtuoso";
|
||||
import { delayGroup, healthcheckProxyProvider } from "tauri-plugin-mihomo-api";
|
||||
|
||||
import { useProxiesData } from "@/hooks/app-data";
|
||||
import { useProxiesData } from "@/hooks/use-clash-data";
|
||||
import { useProxySelection } from "@/hooks/use-proxy-selection";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
import { updateProxyChainConfigInRuntime } from "@/services/cmds";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useMemo } from "react";
|
||||
import useSWR from "swr";
|
||||
|
||||
import { useProxiesData } from "@/hooks/app-data";
|
||||
import { useProxiesData } from "@/hooks/use-clash-data";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
import { getRuntimeConfig } from "@/services/cmds";
|
||||
import delayManager from "@/services/delay";
|
||||
|
||||
@@ -21,7 +21,10 @@ import { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { updateRuleProvider } from "tauri-plugin-mihomo-api";
|
||||
|
||||
import type { useRuleProvidersData, useRulesData } from "@/hooks/app-data";
|
||||
import type {
|
||||
useRuleProvidersData,
|
||||
useRulesData,
|
||||
} from "@/hooks/use-clash-data";
|
||||
import { showNotice } from "@/services/noticeService";
|
||||
|
||||
// 辅助组件 - 类型框
|
||||
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
useClashConfig,
|
||||
useSystemProxyAddress,
|
||||
useSystemProxyData,
|
||||
} from "@/hooks/app-data";
|
||||
} from "@/hooks/use-clash-data";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
import {
|
||||
getAutotemProxy,
|
||||
|
||||
@@ -16,11 +16,11 @@ import { TooltipIcon } from "@/components/base/base-tooltip-icon";
|
||||
import { GuardState } from "@/components/setting/mods/guard-state";
|
||||
import { SysproxyViewer } from "@/components/setting/mods/sysproxy-viewer";
|
||||
import { TunViewer } from "@/components/setting/mods/tun-viewer";
|
||||
import { useServiceInstaller } from "@/hooks/use-service-installer";
|
||||
import { useServiceUninstaller } from "@/hooks/use-service-uninstaller";
|
||||
import { useSystemProxyState } from "@/hooks/use-system-proxy-state";
|
||||
import { useSystemState } from "@/hooks/use-system-state";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
import { useServiceInstaller } from "@/hooks/useServiceInstaller";
|
||||
import { useServiceUninstaller } from "@/hooks/useServiceUninstaller";
|
||||
import { showNotice } from "@/services/noticeService";
|
||||
|
||||
interface ProxySwitchProps {
|
||||
|
||||
Reference in New Issue
Block a user