mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:15:38 +08:00
refactor: ts path alias
This commit is contained in:
@@ -10,8 +10,8 @@ import {
|
||||
DialogTitle,
|
||||
} from "@mui/material";
|
||||
import { InfoRounded } from "@mui/icons-material";
|
||||
import { atomThemeMode } from "../../services/states";
|
||||
import { getRunningConfig } from "../../services/cmds";
|
||||
import { atomThemeMode } from "../../../services/states";
|
||||
import { getRunningConfig } from "../../../services/cmds";
|
||||
|
||||
import "monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.js";
|
||||
import "monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution.js";
|
||||
@@ -3,9 +3,9 @@ import { useState } from "react";
|
||||
import { useLockFn } from "ahooks";
|
||||
import { Menu, MenuItem } from "@mui/material";
|
||||
import { Settings } from "@mui/icons-material";
|
||||
import { changeClashCore, getVergeConfig } from "../../services/cmds";
|
||||
import { getVersion } from "../../services/api";
|
||||
import Notice from "../base/base-notice";
|
||||
import { changeClashCore, getVergeConfig } from "@/services/cmds";
|
||||
import { getVersion } from "@/services/api";
|
||||
import Notice from "@/components/base/base-notice";
|
||||
|
||||
const VALID_CORE = [
|
||||
{ name: "Clash", core: "clash" },
|
||||
@@ -1,5 +1,5 @@
|
||||
import { cloneElement, isValidElement, ReactNode, useRef } from "react";
|
||||
import noop from "../../utils/noop";
|
||||
import noop from "@/utils/noop";
|
||||
|
||||
interface Props<Value> {
|
||||
value?: Value;
|
||||
@@ -14,9 +14,9 @@ import {
|
||||
installService,
|
||||
uninstallService,
|
||||
patchVergeConfig,
|
||||
} from "../../services/cmds";
|
||||
import Notice from "../base/base-notice";
|
||||
import noop from "../../utils/noop";
|
||||
} from "@/services/cmds";
|
||||
import Notice from "@/components/base/base-notice";
|
||||
import noop from "@/utils/noop";
|
||||
|
||||
interface Props {
|
||||
open: boolean;
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { InfoRounded } from "@mui/icons-material";
|
||||
import { ClickAwayListener, Tooltip } from "@mui/material";
|
||||
import { getSystemProxy } from "../../services/cmds";
|
||||
import { getSystemProxy } from "@/services/cmds";
|
||||
|
||||
const SysproxyTooltip = () => {
|
||||
const [open, setOpen] = useState(false);
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Button, ButtonGroup } from "@mui/material";
|
||||
import { CmdType } from "../../services/types";
|
||||
|
||||
type ThemeValue = CmdType.VergeConfig["theme_mode"];
|
||||
|
||||
@@ -10,22 +10,18 @@ import {
|
||||
Typography,
|
||||
Box,
|
||||
} from "@mui/material";
|
||||
import { ApiType } from "../../services/types";
|
||||
import { atomClashPort } from "../../services/states";
|
||||
import { patchClashConfig } from "../../services/cmds";
|
||||
import { atomClashPort } from "@/services/states";
|
||||
import { patchClashConfig } from "@/services/cmds";
|
||||
import { SettingList, SettingItem } from "./setting";
|
||||
import { getClashConfig, getVersion, updateConfigs } from "../../services/api";
|
||||
import { getClashConfig, getVersion, updateConfigs } from "@/services/api";
|
||||
import Notice from "../base/base-notice";
|
||||
import GuardState from "./guard-state";
|
||||
import CoreSwitch from "./core-switch";
|
||||
import GuardState from "./mods/guard-state";
|
||||
import CoreSwitch from "./mods/core-switch";
|
||||
|
||||
interface Props {
|
||||
onError: (err: Error) => void;
|
||||
}
|
||||
|
||||
// const MULTI_CORE = !!import.meta.env.VITE_MULTI_CORE;
|
||||
const MULTI_CORE = true;
|
||||
|
||||
const SettingClash = ({ onError }: Props) => {
|
||||
const { t } = useTranslation();
|
||||
const { mutate } = useSWRConfig();
|
||||
@@ -136,14 +132,10 @@ const SettingClash = ({ onError }: Props) => {
|
||||
<SettingItem>
|
||||
<ListItemText
|
||||
primary={
|
||||
MULTI_CORE ? (
|
||||
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||
<span style={{ marginRight: 4 }}>{t("Clash Core")}</span>
|
||||
<CoreSwitch />
|
||||
</Box>
|
||||
) : (
|
||||
t("Clash Core")
|
||||
)
|
||||
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||
<span style={{ marginRight: 4 }}>{t("Clash Core")}</span>
|
||||
<CoreSwitch />
|
||||
</Box>
|
||||
}
|
||||
/>
|
||||
<Typography sx={{ py: 1 }}>{clashVer}</Typography>
|
||||
|
||||
@@ -13,14 +13,13 @@ import {
|
||||
checkService,
|
||||
getVergeConfig,
|
||||
patchVergeConfig,
|
||||
} from "../../services/cmds";
|
||||
} from "@/services/cmds";
|
||||
import { SettingList, SettingItem } from "./setting";
|
||||
import { CmdType } from "../../services/types";
|
||||
import GuardState from "./guard-state";
|
||||
import ServiceMode from "./service-mode";
|
||||
import ConfigViewer from "./config-viewer";
|
||||
import SysproxyTooltip from "./sysproxy-tooltip";
|
||||
import getSystem from "../../utils/get-system";
|
||||
import getSystem from "@/utils/get-system";
|
||||
import GuardState from "./mods/guard-state";
|
||||
import ServiceMode from "./mods/service-mode";
|
||||
import ConfigViewer from "./mods/config-viewer";
|
||||
import SysproxyTooltip from "./mods/sysproxy-tooltip";
|
||||
|
||||
interface Props {
|
||||
onError?: (err: Error) => void;
|
||||
|
||||
@@ -15,8 +15,8 @@ import {
|
||||
TextField,
|
||||
useTheme,
|
||||
} from "@mui/material";
|
||||
import { getVergeConfig, patchVergeConfig } from "../../services/cmds";
|
||||
import { defaultTheme, defaultDarkTheme } from "../../pages/_theme";
|
||||
import { getVergeConfig, patchVergeConfig } from "@/services/cmds";
|
||||
import { defaultTheme, defaultDarkTheme } from "@/pages/_theme";
|
||||
|
||||
interface Props {
|
||||
open: boolean;
|
||||
|
||||
@@ -14,13 +14,12 @@ import {
|
||||
openAppDir,
|
||||
openLogsDir,
|
||||
patchVergeConfig,
|
||||
} from "../../services/cmds";
|
||||
} from "@/services/cmds";
|
||||
import { ArrowForward } from "@mui/icons-material";
|
||||
import { SettingList, SettingItem } from "./setting";
|
||||
import { CmdType } from "../../services/types";
|
||||
import { version } from "../../../package.json";
|
||||
import ThemeModeSwitch from "./theme-mode-switch";
|
||||
import GuardState from "./guard-state";
|
||||
import { version } from "@root/package.json";
|
||||
import ThemeModeSwitch from "./mods/theme-mode-switch";
|
||||
import GuardState from "./mods/guard-state";
|
||||
import SettingTheme from "./setting-theme";
|
||||
|
||||
interface Props {
|
||||
|
||||
Reference in New Issue
Block a user