From 2dd6957ae90b35f8ce7ffb0a95f6d626f275d750 Mon Sep 17 00:00:00 2001 From: OrzMiku Date: Wed, 30 Jul 2025 23:09:15 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat(ui):=20=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要变化包括: - 实现了响应式主布局,带有可折叠的汉堡菜单,用于移动导航。 - 调整了仪表板、密钥管理和信息卡中的网格布局,使其在较小的屏幕上垂直堆叠内容。 - 使图表和数据表可水平滚动或使其元素换行,以防止溢出并保持可用性。 - 添加了 `@vueuse/core` 库,用于动态检测屏幕尺寸以实现响应式逻辑。 - 改进了各种组件(如按钮、字体和间距)的样式,以改善移动设备上的视觉层次结构。 --- web/package-lock.json | 45 +++++++++++++++ web/package.json | 10 +++- web/src/components/BaseInfoCard.vue | 10 ++-- web/src/components/GlobalTaskProgressBar.vue | 11 +++- web/src/components/Layout.vue | 50 +++++++++++++++-- web/src/components/LineChart.vue | 27 ++++++++- web/src/components/NavBar.vue | 59 +++++++++++++------- web/src/components/keys/GroupInfoCard.vue | 4 +- web/src/components/keys/KeyTable.vue | 21 ++++++- web/src/components/logs/LogTable.vue | 23 ++++++-- web/src/views/Dashboard.vue | 6 +- web/src/views/Keys.vue | 15 ++++- 12 files changed, 232 insertions(+), 49 deletions(-) diff --git a/web/package-lock.json b/web/package-lock.json index 9be1e35..f2b83f7 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -10,6 +10,7 @@ "license": "MIT", "dependencies": { "@vicons/ionicons5": "^0.13.0", + "@vueuse/core": "^13.6.0", "axios": "^1.9.0", "naive-ui": "^2.41.0", "vue": "^3.5.13", @@ -1122,6 +1123,12 @@ "undici-types": "~6.21.0" } }, + "node_modules/@types/web-bluetooth": { + "version": "0.0.21", + "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.21.tgz", + "integrity": "sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==", + "license": "MIT" + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.35.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.35.1.tgz", @@ -1590,6 +1597,44 @@ } } }, + "node_modules/@vueuse/core": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-13.6.0.tgz", + "integrity": "sha512-DJbD5fV86muVmBgS9QQPddVX7d9hWYswzlf4bIyUD2dj8GC46R1uNClZhVAmsdVts4xb2jwp1PbpuiA50Qee1A==", + "license": "MIT", + "dependencies": { + "@types/web-bluetooth": "^0.0.21", + "@vueuse/metadata": "13.6.0", + "@vueuse/shared": "13.6.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, + "node_modules/@vueuse/metadata": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-13.6.0.tgz", + "integrity": "sha512-rnIH7JvU7NjrpexTsl2Iwv0V0yAx9cw7+clymjKuLSXG0QMcLD0LDgdNmXic+qL0SGvgSVPEpM9IDO/wqo1vkQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-13.6.0.tgz", + "integrity": "sha512-pDykCSoS2T3fsQrYqf9SyF0QXWHmcGPQ+qiOVjlYSzlWd9dgppB2bFSM1GgKKkt7uzn0BBMV3IbJsUfHG2+BCg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, "node_modules/acorn": { "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", diff --git a/web/package.json b/web/package.json index ca71f75..ce7f98a 100644 --- a/web/package.json +++ b/web/package.json @@ -4,7 +4,14 @@ "version": "0.1.0", "description": "GPT Load Balancer Frontend - A modern Vue 3 frontend for GPT load balancing service", "type": "module", - "keywords": ["vue3", "typescript", "vite", "naive-ui", "gpt-load", "frontend"], + "keywords": [ + "vue3", + "typescript", + "vite", + "naive-ui", + "gpt-load", + "frontend" + ], "author": "tbphp", "license": "MIT", "repository": { @@ -32,6 +39,7 @@ }, "dependencies": { "@vicons/ionicons5": "^0.13.0", + "@vueuse/core": "^13.6.0", "axios": "^1.9.0", "naive-ui": "^2.41.0", "vue": "^3.5.13", diff --git a/web/src/components/BaseInfoCard.vue b/web/src/components/BaseInfoCard.vue index 82047ce..d51f577 100644 --- a/web/src/components/BaseInfoCard.vue +++ b/web/src/components/BaseInfoCard.vue @@ -59,7 +59,7 @@ onMounted(() => {