Skip to content
Snippets Groups Projects
Unverified Commit f3341f20 authored by GyDi's avatar GyDi
Browse files

refactor: ts path alias

parent bf0dafab
No related branches found
No related tags found
No related merge requests found
Showing
with 36 additions and 49 deletions
......@@ -2,9 +2,8 @@ import dayjs from "dayjs";
import { useLockFn } from "ahooks";
import { styled, ListItem, IconButton, ListItemText } from "@mui/material";
import { CloseRounded } from "@mui/icons-material";
import { ApiType } from "../../services/types";
import { deleteConnection } from "../../services/api";
import parseTraffic from "../../utils/parse-traffic";
import { deleteConnection } from "@/services/api";
import parseTraffic from "@/utils/parse-traffic";
const Tag = styled("span")(({ theme }) => ({
display: "inline-block",
......
......@@ -4,13 +4,12 @@ import { useRecoilValue } from "recoil";
import { Box, Typography } from "@mui/material";
import { ArrowDownward, ArrowUpward } from "@mui/icons-material";
import { listen } from "@tauri-apps/api/event";
import { ApiType } from "../../services/types";
import { getInformation } from "../../services/api";
import { getVergeConfig } from "../../services/cmds";
import { atomClashPort } from "../../services/states";
import { getInformation } from "@/services/api";
import { getVergeConfig } from "@/services/cmds";
import { atomClashPort } from "@/services/states";
import TrafficGraph from "./traffic-graph";
import useLogSetup from "./use-log-setup";
import parseTraffic from "../../utils/parse-traffic";
import parseTraffic from "@/utils/parse-traffic";
// setup the traffic
const LayoutTraffic = () => {
......
......@@ -13,8 +13,8 @@ import {
} from "@mui/material";
import { relaunch } from "@tauri-apps/api/process";
import { checkUpdate, installUpdate } from "@tauri-apps/api/updater";
import { killSidecar, restartSidecar } from "../../services/cmds";
import { atomUpdateState } from "../../services/states";
import { killSidecar, restartSidecar } from "@/services/cmds";
import { atomUpdateState } from "@/services/states";
import Notice from "../base/base-notice";
interface Props {
......
......@@ -3,9 +3,9 @@ import { useEffect, useMemo } from "react";
import { useRecoilState } from "recoil";
import { createTheme } from "@mui/material";
import { appWindow } from "@tauri-apps/api/window";
import { getVergeConfig } from "../../services/cmds";
import { atomThemeMode } from "../../services/states";
import { defaultTheme, defaultDarkTheme } from "../../pages/_theme";
import { getVergeConfig } from "@/services/cmds";
import { atomThemeMode } from "@/services/states";
import { defaultTheme, defaultDarkTheme } from "@/pages/_theme";
/**
* custome theme
......
......@@ -2,9 +2,8 @@ import dayjs from "dayjs";
import { useEffect, useState } from "react";
import { useSetRecoilState } from "recoil";
import { listen } from "@tauri-apps/api/event";
import { ApiType } from "../../services/types";
import { getInformation } from "../../services/api";
import { atomLogData } from "../../services/states";
import { getInformation } from "@/services/api";
import { atomLogData } from "@/services/states";
const MAX_LOG_NUM = 1000;
......
import { styled, Box } from "@mui/material";
import { ApiType } from "../../services/types";
const Item = styled(Box)(({ theme }) => ({
padding: "8px 0",
......
......@@ -24,8 +24,7 @@ import {
enhanceProfiles,
changeProfileChain,
changeProfileValid,
} from "../../services/cmds";
import { CmdType } from "../../services/types";
} from "@/services/cmds";
import ProfileMore from "./profile-more";
import Notice from "../base/base-notice";
......
......@@ -9,8 +9,8 @@ import {
DialogContent,
DialogTitle,
} from "@mui/material";
import { atomThemeMode } from "../../services/states";
import { readProfileFile, saveProfileFile } from "../../services/cmds";
import { atomThemeMode } from "@/services/states";
import { readProfileFile, saveProfileFile } from "@/services/cmds";
import Notice from "../base/base-notice";
import "monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.js";
......
......@@ -12,8 +12,7 @@ import {
TextField,
} from "@mui/material";
import { Settings } from "@mui/icons-material";
import { CmdType } from "../../services/types";
import { patchProfile } from "../../services/cmds";
import { patchProfile } from "@/services/cmds";
import Notice from "../base/base-notice";
interface Props {
......
......@@ -16,10 +16,9 @@ import {
Menu,
} from "@mui/material";
import { RefreshRounded } from "@mui/icons-material";
import { CmdType } from "../../services/types";
import { atomLoadingCache } from "../../services/states";
import { updateProfile, deleteProfile, viewProfile } from "../../services/cmds";
import parseTraffic from "../../utils/parse-traffic";
import { atomLoadingCache } from "@/services/states";
import { updateProfile, deleteProfile, viewProfile } from "@/services/cmds";
import parseTraffic from "@/utils/parse-traffic";
import ProfileEdit from "./profile-edit";
import FileEditor from "./file-editor";
import Notice from "../base/base-notice";
......
......@@ -11,9 +11,8 @@ import {
MenuItem,
Menu,
} from "@mui/material";
import { CmdType } from "../../services/types";
import { viewProfile } from "../../services/cmds";
import enhance from "../../services/enhance";
import { viewProfile } from "@/services/cmds";
import enhance from "@/services/enhance";
import ProfileEdit from "./profile-edit";
import FileEditor from "./file-editor";
import Notice from "../base/base-notice";
......
......@@ -15,7 +15,7 @@ import {
TextField,
} from "@mui/material";
import { Settings } from "@mui/icons-material";
import { createProfile } from "../../services/cmds";
import { createProfile } from "@/services/cmds";
import Notice from "../base/base-notice";
import FileInput from "./file-input";
......
......@@ -2,13 +2,12 @@ import useSWR, { useSWRConfig } from "swr";
import { useEffect, useRef, useState } from "react";
import { useLockFn } from "ahooks";
import { Virtuoso } from "react-virtuoso";
import { ApiType } from "../../services/types";
import { updateProxy } from "../../services/api";
import { getProfiles, patchProfile } from "../../services/cmds";
import { updateProxy } from "@/services/api";
import { getProfiles, patchProfile } from "@/services/cmds";
import delayManager from "@/services/delay";
import useSortProxy from "./use-sort-proxy";
import useHeadState from "./use-head-state";
import useFilterProxy from "./use-filter-proxy";
import delayManager from "../../services/delay";
import ProxyHead from "./proxy-head";
import ProxyItem from "./proxy-item";
......
......@@ -15,13 +15,12 @@ import {
ExpandLessRounded,
ExpandMoreRounded,
} from "@mui/icons-material";
import { ApiType } from "../../services/types";
import { updateProxy } from "../../services/api";
import { getProfiles, patchProfile } from "../../services/cmds";
import { updateProxy } from "@/services/api";
import { getProfiles, patchProfile } from "@/services/cmds";
import delayManager from "@/services/delay";
import useSortProxy from "./use-sort-proxy";
import useHeadState from "./use-head-state";
import useFilterProxy from "./use-filter-proxy";
import delayManager from "../../services/delay";
import ProxyHead from "./proxy-head";
import ProxyItem from "./proxy-item";
......
......@@ -13,7 +13,7 @@ import {
SortByAlphaRounded,
SortRounded,
} from "@mui/icons-material";
import delayManager from "../../services/delay";
import delayManager from "@/services/delay";
import type { HeadState } from "./use-head-state";
import type { ProxySortType } from "./use-sort-proxy";
......
......@@ -12,8 +12,7 @@ import {
SxProps,
Theme,
} from "@mui/material";
import { ApiType } from "../../services/types";
import delayManager from "../../services/delay";
import delayManager from "@/services/delay";
interface Props {
groupName: string;
......
import { useMemo } from "react";
import { ApiType } from "../../services/types";
import delayManager from "../../services/delay";
import delayManager from "@/services/delay";
const regex1 = /delay([=<>])(\d+|timeout|error)/i;
const regex2 = /type=(.*)/i;
......
import { useCallback, useEffect, useState } from "react";
import { useRecoilValue } from "recoil";
import { atomCurrentProfile } from "../../services/states";
import { atomCurrentProfile } from "@/services/states";
import { ProxySortType } from "./use-sort-proxy";
export interface HeadState {
......
import { useMemo } from "react";
import { ApiType } from "../../services/types";
import delayManager from "../../services/delay";
import delayManager from "@/services/delay";
// default | delay | alpha
export type ProxySortType = 0 | 1 | 2;
......
......@@ -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";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment