diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..9a7cc76 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +CHANGELOG.md +pnpm-lock.yaml diff --git a/.prettierrc b/.prettierrc index 042b6cc..d4bad54 100644 --- a/.prettierrc +++ b/.prettierrc @@ -4,5 +4,6 @@ "prettier-plugin-tailwindcss" ], "semi": false, - "singleQuote": true + "singleQuote": true, + "endOfLine": "crlf" } diff --git a/package.json b/package.json index 54afb87..471b3fc 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "build": "vite build", "dev": "vite", + "format": "prettier -w .", "prepare": "husky install", "serve": "vite preview" }, diff --git a/src/constants/index.ts b/src/constants/index.ts index 0a3c058..07fd3a8 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -153,3 +153,11 @@ export enum MODE_OPTIONS { Rule = 'rule', Direct = 'direct', } + +export enum LOG_LEVEL { + Info = 'info', + Error = 'error', + Warning = 'warning', + Debug = 'debug', + Silent = 'silent', +} diff --git a/src/i18n/en.ts b/src/i18n/en.ts index e4b8033..dc6d71d 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -61,6 +61,12 @@ export default { updated: 'Updated', renderProxiesInSamePage: 'Render proxies and proxy provider in same page', tableSize: 'Table size', + logLevel: 'Log Level', + info: 'info', + silent: 'silent', + debug: 'debug', + warning: 'warning', + error: 'error', xs: 'Extra small size', sm: 'Small size', md: 'Normal size', diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts index 012cc25..775b1c3 100644 --- a/src/i18n/zh.ts +++ b/src/i18n/zh.ts @@ -61,6 +61,12 @@ export default { updated: '更新于', renderProxiesInSamePage: '将代理和代理提供者显示在同一页', tableSize: '表格大小', + logLevel: '日志等级', + info: '信息', + silent: '静默', + debug: '调试', + warning: '警告', + error: '错误', xs: '超小尺寸', sm: '小尺寸', md: '正常尺寸', diff --git a/src/pages/Config.tsx b/src/pages/Config.tsx index 22846e5..64abf6a 100644 --- a/src/pages/Config.tsx +++ b/src/pages/Config.tsx @@ -25,6 +25,7 @@ import { import { Button } from '~/components' import { LANG, + LOG_LEVEL, MODE_OPTIONS, PROXIES_ORDERING_TYPE, PROXIES_PREVIEW_TYPE, @@ -40,6 +41,7 @@ import { favDayTheme, favNightTheme, latencyTestTimeoutDuration, + logLevel, proxiesOrderingType, proxiesPreviewType, renderInTwoColumns, @@ -49,6 +51,7 @@ import { setFavDayTheme, setFavNightTheme, setLatencyTestTimeoutDuration, + setLogLevel, setProxiesOrderingType, setProxiesPreviewType, setRenderInTwoColumns, @@ -407,6 +410,33 @@ const ConfigForXd = () => { +
+ {t('logLevel')} + + +
+