diff --git a/apps/frontend/package.json b/apps/frontend/package.json index f6d3c01..2892809 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -6,63 +6,63 @@ "author": "HY2XS", "packageManager": "pnpm@9.15.9", "scripts": { - "dev": "vite serve --mode development", - "build:prod": "vite build --mode production && vue-tsc --noEmit", - "lint:eslint": "eslint --fix --ext .ts,.js,.vue ./src ", - "lint:prettier": "prettier --write \"**/*.{js,cjs,ts,json,tsx,css,less,scss,vue,html,md}\"", - "lint:stylelint": "stylelint \"**/*.{css,scss,vue}\" --fix" + "dev": "vite serve --mode development", + "build:prod": "vite build --mode production && vue-tsc --noEmit", + "lint:eslint": "eslint --fix --ext .ts,.js,.vue ./src ", + "lint:prettier": "prettier --write \"**/*.{js,cjs,ts,json,tsx,css,less,scss,vue,html,md}\"", + "lint:stylelint": "stylelint \"**/*.{css,scss,vue}\" --fix" + }, + "dependencies": { + "@element-plus/icons-vue": "^1.0.0", + "@vueuse/core": "^9.1.1", + "axios": "^1.3.4", + "copy-to-clipboard": "^3.3.3", + "echarts": "^5.5.1", + "element-plus": "^2.3.1", + "nprogress": "^0.2.0", + "path-browserify": "^1.0.1", + "pinia": "^2.0.33", + "qrcode.vue": "3.4.1", + "vue": "^3.2.45", + "vue-echarts": "^7.0.3", + "vue-i18n": "9", + "vue-router": "^4.1.6", + "vuedraggable": "^4.1.0" }, - "dependencies": { - "@element-plus/icons-vue": "^1.0.0", - "@vueuse/core": "^9.1.1", - "axios": "^1.3.4", - "copy-to-clipboard": "^3.3.3", - "echarts": "^5.5.1", - "element-plus": "^2.3.1", - "nprogress": "^0.2.0", - "path-browserify": "^1.0.1", - "pinia": "^2.0.33", - "qrcode.vue": "3.4.1", - "vue": "^3.2.45", - "vue-echarts": "^7.0.3", - "vue-i18n": "9", - "vue-router": "^4.1.6", - "vuedraggable": "^4.1.0" - }, "devDependencies": { - "@iconify-json/ep": "^1.1.8", - "@types/nprogress": "^0.2.0", - "@types/path-browserify": "^1.0.0", - "@typescript-eslint/eslint-plugin": "^5.51.0", - "@typescript-eslint/parser": "^5.51.0", - "@vitejs/plugin-vue": "^4.0.0", - "autoprefixer": "^10.4.13", - "eslint": "^8.34.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-prettier": "^4.2.1", - "eslint-plugin-vue": "^9.9.0", - "postcss": "^8.4.21", - "postcss-html": "^1.5.0", - "postcss-scss": "^4.0.6", - "prettier": "^2.8.7", - "sass": "^1.58.3", - "stylelint": "^15.5.0", - "stylelint-config-html": "^1.1.0", - "stylelint-config-recess-order": "^4.0.0", - "stylelint-config-recommended-scss": "^9.0.1", - "stylelint-config-recommended-vue": "^1.4.0", - "stylelint-config-standard": "^32.0.0", - "stylelint-config-standard-scss": "^8.0.0", - "typescript": "^4.9.3", - "unocss": "^0.50.1", - "unplugin-auto-import": "^0.13.0", - "unplugin-icons": "^0.15.1", - "unplugin-vue-components": "^0.23.0", - "vite": "^4.3.1", - "vite-plugin-svg-icons": "^2.0.1", - "vue-tsc": "^0.35.0" + "@iconify-json/ep": "^1.1.8", + "@types/nprogress": "^0.2.0", + "@types/path-browserify": "^1.0.0", + "@typescript-eslint/eslint-plugin": "^5.51.0", + "@typescript-eslint/parser": "^5.51.0", + "@vitejs/plugin-vue": "^4.0.0", + "autoprefixer": "^10.4.13", + "eslint": "^8.34.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-vue": "^9.9.0", + "postcss": "^8.4.21", + "postcss-html": "^1.5.0", + "postcss-scss": "^4.0.6", + "prettier": "^2.8.7", + "sass": "^1.58.3", + "stylelint": "^15.5.0", + "stylelint-config-html": "^1.1.0", + "stylelint-config-recess-order": "^4.0.0", + "stylelint-config-recommended-scss": "^9.0.1", + "stylelint-config-recommended-vue": "^1.4.0", + "stylelint-config-standard": "^32.0.0", + "stylelint-config-standard-scss": "^8.0.0", + "typescript": "^4.9.3", + "unocss": "^0.50.1", + "unplugin-auto-import": "^0.13.0", + "unplugin-icons": "^0.15.1", + "unplugin-vue-components": "^0.23.0", + "vite": "^4.3.1", + "vite-plugin-svg-icons": "^2.0.1", + "vue-tsc": "^0.35.0" }, "engines": { - "node": ">=18.12.0" + "node": ">=18.12.0" } } diff --git a/apps/frontend/src/App.vue b/apps/frontend/src/App.vue index c8c86b9..bc6e8e9 100644 --- a/apps/frontend/src/App.vue +++ b/apps/frontend/src/App.vue @@ -9,5 +9,3 @@ const appStore = useAppStore(); - - diff --git a/apps/frontend/src/api/admin/index.ts b/apps/frontend/src/api/admin/index.ts index 8716e3b..8271426 100644 --- a/apps/frontend/src/api/admin/index.ts +++ b/apps/frontend/src/api/admin/index.ts @@ -23,7 +23,9 @@ export function getAdminInfoApi(): AxiosPromise { }); } -export function adminChangePasswordApi(data: AdminChangePasswordDto): AxiosPromise { +export function adminChangePasswordApi( + data: AdminChangePasswordDto +): AxiosPromise { return request({ url: "/admin/change-password", method: "post", diff --git a/apps/frontend/src/api/admin/types.ts b/apps/frontend/src/api/admin/types.ts index 5900f4d..e9f8c6f 100644 --- a/apps/frontend/src/api/admin/types.ts +++ b/apps/frontend/src/api/admin/types.ts @@ -24,4 +24,3 @@ export interface AdminChangePasswordDto { export interface AdminSecurityVo { forcePasswordChange: boolean; } - diff --git a/apps/frontend/src/api/config/index.ts b/apps/frontend/src/api/config/index.ts index dcc449a..147c86b 100644 --- a/apps/frontend/src/api/config/index.ts +++ b/apps/frontend/src/api/config/index.ts @@ -110,5 +110,3 @@ export function uploadCertFileApi(data: FormData): AxiosPromise { headers: { "Content-Type": "multipart/form-data" }, }); } - - diff --git a/apps/frontend/src/api/config/types.ts b/apps/frontend/src/api/config/types.ts index c407cf8..d180cc9 100644 --- a/apps/frontend/src/api/config/types.ts +++ b/apps/frontend/src/api/config/types.ts @@ -300,5 +300,3 @@ export interface Hysteria2AcmePathVo { crtPath: string; keyPath: string; } - - diff --git a/apps/frontend/src/api/dashboard/index.ts b/apps/frontend/src/api/dashboard/index.ts index 1d392cf..eddf24f 100644 --- a/apps/frontend/src/api/dashboard/index.ts +++ b/apps/frontend/src/api/dashboard/index.ts @@ -14,7 +14,9 @@ export function dashboardSummaryApi(): AxiosPromise { }); } -export function dashboardTimeseriesApi(range = "24h"): AxiosPromise { +export function dashboardTimeseriesApi( + range = "24h" +): AxiosPromise { return request({ url: "/dashboard/timeseries", method: "get", @@ -22,7 +24,10 @@ export function dashboardTimeseriesApi(range = "24h"): AxiosPromise { +export function dashboardTopPeersApi( + range = "24h", + limit = 10 +): AxiosPromise { return request({ url: "/dashboard/top-peers", method: "get", @@ -36,4 +41,3 @@ export function dashboardSecurityApi(): AxiosPromise { method: "get", }); } - diff --git a/apps/frontend/src/api/dashboard/types.ts b/apps/frontend/src/api/dashboard/types.ts index 4e7debd..4629c11 100644 --- a/apps/frontend/src/api/dashboard/types.ts +++ b/apps/frontend/src/api/dashboard/types.ts @@ -69,4 +69,3 @@ export interface DashboardTopPeerVo { upload: number; total: number; } - diff --git a/apps/frontend/src/api/log/index.ts b/apps/frontend/src/api/log/index.ts index 02ddb72..754e8d1 100644 --- a/apps/frontend/src/api/log/index.ts +++ b/apps/frontend/src/api/log/index.ts @@ -33,5 +33,3 @@ export function exportLogApi(data: LogExportDto): AxiosPromise { responseType: "blob", }); } - - diff --git a/apps/frontend/src/api/log/types.ts b/apps/frontend/src/api/log/types.ts index b682d87..cdb230b 100644 --- a/apps/frontend/src/api/log/types.ts +++ b/apps/frontend/src/api/log/types.ts @@ -22,5 +22,3 @@ export interface LogHysteria2Vo { msg: string; time: string; } - - diff --git a/apps/frontend/src/api/peer/index.ts b/apps/frontend/src/api/peer/index.ts index 8aaf67c..b70e7ff 100644 --- a/apps/frontend/src/api/peer/index.ts +++ b/apps/frontend/src/api/peer/index.ts @@ -96,4 +96,3 @@ export function exportPeerApi(): AxiosPromise { responseType: "blob", }); } - diff --git a/apps/frontend/src/components/Hamburger/index.vue b/apps/frontend/src/components/Hamburger/index.vue index 802c6dc..54674d3 100644 --- a/apps/frontend/src/components/Hamburger/index.vue +++ b/apps/frontend/src/components/Hamburger/index.vue @@ -58,5 +58,3 @@ function toggleClick() { } } - - diff --git a/apps/frontend/src/components/ImputMultiple/index.vue b/apps/frontend/src/components/ImputMultiple/index.vue index 9c78de2..76376de 100644 --- a/apps/frontend/src/components/ImputMultiple/index.vue +++ b/apps/frontend/src/components/ImputMultiple/index.vue @@ -75,5 +75,3 @@ const handleClose = (tag: string): void => { flex-wrap: wrap; } - - diff --git a/apps/frontend/src/components/LangSelect/index.vue b/apps/frontend/src/components/LangSelect/index.vue index c6c60cb..3f2c3e3 100644 --- a/apps/frontend/src/components/LangSelect/index.vue +++ b/apps/frontend/src/components/LangSelect/index.vue @@ -34,5 +34,3 @@ function handleLanguageChange(lang: string) { - - diff --git a/apps/frontend/src/components/MapAdd/index.vue b/apps/frontend/src/components/MapAdd/index.vue index ff769df..77ea778 100644 --- a/apps/frontend/src/components/MapAdd/index.vue +++ b/apps/frontend/src/components/MapAdd/index.vue @@ -180,5 +180,3 @@ const closeDialog = (): void => { flex-wrap: wrap; } - - diff --git a/apps/frontend/src/components/Pagination/index.vue b/apps/frontend/src/components/Pagination/index.vue index 940a394..b81f55d 100644 --- a/apps/frontend/src/components/Pagination/index.vue +++ b/apps/frontend/src/components/Pagination/index.vue @@ -86,5 +86,3 @@ function handleCurrentChange(val: number) { } } - - diff --git a/apps/frontend/src/components/SvgIcon/index.vue b/apps/frontend/src/components/SvgIcon/index.vue index bdd508c..744cf03 100644 --- a/apps/frontend/src/components/SvgIcon/index.vue +++ b/apps/frontend/src/components/SvgIcon/index.vue @@ -41,5 +41,3 @@ const symbolId = computed(() => `#${props.prefix}-${props.iconClass}`); fill: currentcolor; /* currentColor наследует текущий цвет элемента или родителя */ } - - diff --git a/apps/frontend/src/components/UnitSelect/index.vue b/apps/frontend/src/components/UnitSelect/index.vue index a6ff098..ae5f9d6 100644 --- a/apps/frontend/src/components/UnitSelect/index.vue +++ b/apps/frontend/src/components/UnitSelect/index.vue @@ -70,7 +70,3 @@ watch( { immediate: true } ); - - - - diff --git a/apps/frontend/src/directive/index.ts b/apps/frontend/src/directive/index.ts index 547cff0..2173989 100644 --- a/apps/frontend/src/directive/index.ts +++ b/apps/frontend/src/directive/index.ts @@ -7,5 +7,3 @@ export function setupDirective(app: App) { // Делает v-hasRole доступным во всех компонентах app.directive("hasRole", hasRole); } - - diff --git a/apps/frontend/src/directive/permission/index.ts b/apps/frontend/src/directive/permission/index.ts index 020e56a..6d5264c 100644 --- a/apps/frontend/src/directive/permission/index.ts +++ b/apps/frontend/src/directive/permission/index.ts @@ -23,5 +23,3 @@ export const hasRole: Directive = { } }, }; - - diff --git a/apps/frontend/src/lang/index.ts b/apps/frontend/src/lang/index.ts index 52556d1..07dbd13 100644 --- a/apps/frontend/src/lang/index.ts +++ b/apps/frontend/src/lang/index.ts @@ -7,7 +7,9 @@ function initialLocale(): string { if (typeof window === "undefined") { return defaultSettings.language || "ru"; } - return window.localStorage.getItem("language") || defaultSettings.language || "ru"; + return ( + window.localStorage.getItem("language") || defaultSettings.language || "ru" + ); } const messages = { @@ -28,5 +30,3 @@ const i18n = createI18n({ }); export default i18n; - - diff --git a/apps/frontend/src/lang/package/en.ts b/apps/frontend/src/lang/package/en.ts index 7aa5a56..195d944 100644 --- a/apps/frontend/src/lang/package/en.ts +++ b/apps/frontend/src/lang/package/en.ts @@ -139,7 +139,8 @@ export default { clientUri: "Client URI", clientQr: "Client QR", unlimited: "Unlimited", - secretRotateConfirm: "Rotate peer secret? Existing client configurations will stop working until updated.", + secretRotateConfirm: + "Rotate peer secret? Existing client configurations will stop working until updated.", quota: "Quota", download: "Download", upload: "Upload", @@ -406,5 +407,3 @@ export default { }, }, }; - - diff --git a/apps/frontend/src/lang/package/ru.ts b/apps/frontend/src/lang/package/ru.ts index dee9f3a..f2aecbc 100644 --- a/apps/frontend/src/lang/package/ru.ts +++ b/apps/frontend/src/lang/package/ru.ts @@ -23,7 +23,8 @@ export default { passwordFormatIncorrect: "Неверный формат пароля", }, dashboard: { - stale: "Данные дашборда устарели. Выполняется автоматическая повторная попытка...", + stale: + "Данные дашборда устарели. Выполняется автоматическая повторная попытка...", topPeers24h: "Топ пиров (24ч)", topPeersRange: "Топ пиров ({range})", refreshFailed: "Не удалось обновить данные дашборда", @@ -134,7 +135,8 @@ export default { clientUri: "URI клиента", clientQr: "QR клиента", unlimited: "Безлимит", - secretRotateConfirm: "Сменить секрет пира? Текущие клиентские конфиги перестанут работать до обновления.", + secretRotateConfirm: + "Сменить секрет пира? Текущие клиентские конфиги перестанут работать до обновления.", quota: "Квота", download: "Скачано", upload: "Отдано", @@ -181,7 +183,8 @@ export default { mustBeInteger: "Поле должно быть целым числом", invalidWebContext: "Поле должно начинаться с / и содержать только строчные буквы (a-z) и цифры (0-9)", - invalidTrafficTime: "Поле должно быть числом максимум с одним знаком после запятой", + invalidTrafficTime: + "Поле должно быть числом максимум с одним знаком после запятой", }, monitor: { huiVersion: "Версия HY2XS admin", @@ -313,8 +316,15 @@ export default { outbounds: { name: "Имя outbound", type: "Тип", - socks5: { addr: "Адрес SOCKS5", username: "Логин SOCKS5", password: "Пароль SOCKS5" }, - http: { url: "URL HTTP/HTTPS proxy", insecure: "Отключить TLS-проверку proxy" }, + socks5: { + addr: "Адрес SOCKS5", + username: "Логин SOCKS5", + password: "Пароль SOCKS5", + }, + http: { + url: "URL HTTP/HTTPS proxy", + insecure: "Отключить TLS-проверку proxy", + }, direct: { mode: "Тип", bindIPv4: "Локальный IPv4", @@ -332,7 +342,11 @@ export default { rewriteHost: "Переписывать Host header", insecure: "Отключить TLS-проверку", }, - string: { content: "Ответ строкой", headers: "HTTP headers", statusCode: "HTTP status code" }, + string: { + content: "Ответ строкой", + headers: "HTTP headers", + statusCode: "HTTP status code", + }, listenHTTP: "HTTP listen address", listenHTTPS: "HTTPS listen address", forceHTTPS: "Принудительно использовать HTTPS", @@ -340,5 +354,3 @@ export default { }, }, }; - - diff --git a/apps/frontend/src/layout/components/AppMain.vue b/apps/frontend/src/layout/components/AppMain.vue index 531d2b3..1cd92eb 100644 --- a/apps/frontend/src/layout/components/AppMain.vue +++ b/apps/frontend/src/layout/components/AppMain.vue @@ -17,5 +17,3 @@ background-color: var(--el-bg-color-page); } - - diff --git a/apps/frontend/src/layout/components/Navbar.vue b/apps/frontend/src/layout/components/Navbar.vue index 6b142de..f79684c 100644 --- a/apps/frontend/src/layout/components/Navbar.vue +++ b/apps/frontend/src/layout/components/Navbar.vue @@ -35,11 +35,9 @@ function logout() { cancelButtonText: t("common.cancel"), type: "warning", }).then(() => { - adminStore - .logout() - .then(() => { - router.push(`/login?redirect=${route.fullPath}`); - }); + adminStore.logout().then(() => { + router.push(`/login?redirect=${route.fullPath}`); + }); }); } diff --git a/apps/frontend/src/layout/components/Sidebar/Link.vue b/apps/frontend/src/layout/components/Sidebar/Link.vue index c112217..d80b289 100644 --- a/apps/frontend/src/layout/components/Sidebar/Link.vue +++ b/apps/frontend/src/layout/components/Sidebar/Link.vue @@ -35,5 +35,3 @@ function push() { - - diff --git a/apps/frontend/src/layout/components/Sidebar/Logo.vue b/apps/frontend/src/layout/components/Sidebar/Logo.vue index a27f0c4..fab1a4f 100644 --- a/apps/frontend/src/layout/components/Sidebar/Logo.vue +++ b/apps/frontend/src/layout/components/Sidebar/Logo.vue @@ -1,5 +1,4 @@ - - diff --git a/apps/frontend/src/views/log/system/index.vue b/apps/frontend/src/views/log/system/index.vue index c8e7a3d..98e3e8b 100644 --- a/apps/frontend/src/views/log/system/index.vue +++ b/apps/frontend/src/views/log/system/index.vue @@ -107,4 +107,3 @@ onMounted(() => { setRecords(); }); - diff --git a/apps/frontend/src/views/peer/list/index.vue b/apps/frontend/src/views/peer/list/index.vue index 8fd909a..b8956d2 100644 --- a/apps/frontend/src/views/peer/list/index.vue +++ b/apps/frontend/src/views/peer/list/index.vue @@ -8,13 +8,17 @@ - {{ $t("common.search") }} + {{ + $t("common.search") + }}
- {{ $t("common.add") }} + {{ + $t("common.add") + }} {{ $t("common.import") }} - {{ $t("common.export") }} + {{ + $t("common.export") + }}
@@ -37,42 +43,107 @@ - + - + - + - +