From e5d85e402b2e3c88c0918fc47d838aeb9dc3e10d Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Fri, 27 Feb 2026 23:06:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/.gitignore | 4 +- .../i18n/locales/en-US/features/settings.json | 41 +- .../i18n/locales/en-US/features/welcome.json | 2 + .../i18n/locales/zh-CN/features/settings.json | 41 +- .../i18n/locales/zh-CN/features/welcome.json | 2 + dashboard/src/views/Settings.vue | 26 +- dashboard/src/views/WelcomePage.vue | 456 +++++++++++++----- 7 files changed, 422 insertions(+), 150 deletions(-) diff --git a/dashboard/.gitignore b/dashboard/.gitignore index 6e03962af..f17c69129 100644 --- a/dashboard/.gitignore +++ b/dashboard/.gitignore @@ -1,3 +1,5 @@ node_modules/ .DS_Store -dist/ \ No newline at end of file +dist/ +bun.lock +pmpm-lock.yaml diff --git a/dashboard/src/i18n/locales/en-US/features/settings.json b/dashboard/src/i18n/locales/en-US/features/settings.json index 0c616c3d0..6216a2675 100644 --- a/dashboard/src/i18n/locales/en-US/features/settings.json +++ b/dashboard/src/i18n/locales/en-US/features/settings.json @@ -1,13 +1,23 @@ { "network": { "title": "Network", + "proxy": { + "title": "Proxy", + "subtitle": "Configure proxy for network requests" + }, "server": { "title": "Server Address", "subtitle": "Configure backend API URL", "label": "API Base URL", "placeholder": "e.g. http://localhost:6185", "hint": "Empty for default (relative path)", - "save": "Save & Reload" + "save": "Save & Reload", + "presets": "Presets", + "preset": { + "add": "Add Preset", + "name": "Name", + "url": "URL" + } }, "githubProxy": { "title": "GitHub Proxy Address", @@ -34,6 +44,20 @@ "reset": "Reset to Default" } }, + "style": { + "title": "Theme", + "color": { + "title": "Theme Colors", + "subtitle": "Customize theme primary and secondary colors. Changes apply immediately and are stored locally in your browser.", + "primary": "Primary Color", + "secondary": "Secondary Color" + } + }, + "reset": { + "title": "Reset to Default", + "subtitle": "Reset theme colors to default settings", + "button": "Reset" + }, "system": { "title": "System", "restart": { @@ -63,6 +87,10 @@ } }, "backup": { + "title": "Backup", + "subtitle": "Manage data backups", + "operate": "Backup Operations", + "open": "Open Backup Manager", "dialog": { "title": "Backup Manager" }, @@ -143,11 +171,12 @@ "subtitle": "Create API keys for external developers to call open HTTP APIs.", "name": "Key Name", "expiresInDays": "Expiration", - "expiryOptions": { - "day1": "1 day", - "day7": "7 days", - "day30": "30 days", - "day90": "90 days", + "expiry": { + "7days": "7 days", + "30days": "30 days", + "90days": "90 days", + "180days": "180 days", + "365days": "365 days", "permanent": "Permanent" }, "permanentWarning": "Permanent API keys are high risk. Store them securely and use only when necessary.", diff --git a/dashboard/src/i18n/locales/en-US/features/welcome.json b/dashboard/src/i18n/locales/en-US/features/welcome.json index 670d0a66d..6f5a8f00d 100644 --- a/dashboard/src/i18n/locales/en-US/features/welcome.json +++ b/dashboard/src/i18n/locales/en-US/features/welcome.json @@ -12,6 +12,8 @@ "onboard": { "title": "Quick Onboarding", "subtitle": "Complete initialization directly on the welcome page.", + "step0Title": "Configure Backend URL", + "step0Desc": "Configure the backend API URL for AstrBot.", "step1Title": "Configure Platform Bot", "step1Desc": "Connect AstrBot to IM platforms like QQ, Lark, Slack, Telegram, etc.", "step2Title": "Configure AI Model", diff --git a/dashboard/src/i18n/locales/zh-CN/features/settings.json b/dashboard/src/i18n/locales/zh-CN/features/settings.json index f9a703f7e..c9745569f 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/settings.json +++ b/dashboard/src/i18n/locales/zh-CN/features/settings.json @@ -1,13 +1,23 @@ { "network": { "title": "网络", + "proxy": { + "title": "代理设置", + "subtitle": "配置网络请求代理" + }, "server": { "title": "服务器地址", "subtitle": "配置后端 API 地址", "label": "API 基础地址", "placeholder": "例如:http://localhost:6185", "hint": "留空以使用默认设置(相对路径)", - "save": "保存并刷新" + "save": "保存并刷新", + "presets": "预设列表", + "preset": { + "add": "添加预设", + "name": "名称", + "url": "URL" + } }, "githubProxy": { "title": "GitHub 加速地址", @@ -34,6 +44,20 @@ "reset": "恢复默认" } }, + "style": { + "title": "主题", + "color": { + "title": "主题颜色", + "subtitle": "自定义主题主色与辅助色。修改后立即生效,并保存在浏览器本地。", + "primary": "主色", + "secondary": "辅助色" + } + }, + "reset": { + "title": "恢复默认", + "subtitle": "恢复主题颜色为默认设置", + "button": "恢复默认" + }, "system": { "title": "系统", "restart": { @@ -63,6 +87,10 @@ } }, "backup": { + "title": "备份", + "subtitle": "管理数据备份", + "operate": "备份操作", + "open": "打开备份管理", "dialog": { "title": "备份管理" }, @@ -143,11 +171,12 @@ "subtitle": "为外部开发者创建 API Key,用于调用开放 HTTP API。", "name": "Key 名称", "expiresInDays": "有效期", - "expiryOptions": { - "day1": "1 天", - "day7": "7 天", - "day30": "30 天", - "day90": "90 天", + "expiry": { + "7days": "7 天", + "30days": "30 天", + "90days": "90 天", + "180days": "180 天", + "365days": "365 天", "permanent": "永久" }, "permanentWarning": "永久有效的 API Key 风险较高,请妥善保存并建议仅在必要场景使用。", diff --git a/dashboard/src/i18n/locales/zh-CN/features/welcome.json b/dashboard/src/i18n/locales/zh-CN/features/welcome.json index 1eb23d7ca..7ddac7d25 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/welcome.json +++ b/dashboard/src/i18n/locales/zh-CN/features/welcome.json @@ -12,6 +12,8 @@ "onboard": { "title": "快速引导", "subtitle": "欢迎页可直接完成初始化。", + "step0Title": "配置后端地址", + "step0Desc": "配置 AstrBot 的后端 API 地址。", "step1Title": "配置平台机器人", "step1Desc": "将 AstrBot 连接到 QQ、飞书、企业微信、Telegram 等 IM 平台。", "step2Title": "配置 AI 模型", diff --git a/dashboard/src/views/Settings.vue b/dashboard/src/views/Settings.vue index 027effc34..6d20b8d17 100644 --- a/dashboard/src/views/Settings.vue +++ b/dashboard/src/views/Settings.vue @@ -46,7 +46,7 @@ prepend-icon="mdi-plus" @click="showAddPreset = !showAddPreset" > - Add Preset + {{ tm("network.server.preset.add") }} @@ -57,7 +57,7 @@ > Add Preset{{ tm("network.server.preset.add") }} @@ -374,7 +374,7 @@ mdi-palette - {{ tm("common.save") }} + {{ t("core.common.save") }} @@ -439,16 +439,17 @@ import { useTheme } from "vuetify"; import { useCustomizerStore } from "@/stores/customizer"; import { useCommonStore } from "@/stores/common"; import { useApiStore } from "@/stores/api"; -import ProxySelector from "@/components/settings/ProxySelector.vue"; -import SidebarCustomizer from "@/components/settings/SidebarCustomizer.vue"; -import WaitingForRestart from "@/components/settings/WaitingForRestart.vue"; -import MigrationDialog from "@/components/settings/MigrationDialog.vue"; -import BackupDialog from "@/components/settings/BackupDialog.vue"; +import ProxySelector from "@/components/shared/ProxySelector.vue"; +import SidebarCustomizer from "@/components/shared/SidebarCustomizer.vue"; +import WaitingForRestart from "@/components/shared/WaitingForRestart.vue"; +import MigrationDialog from "@/components/shared/MigrationDialog.vue"; +import BackupDialog from "@/components/shared/BackupDialog.vue"; import axios from "axios"; -import { useI18n } from "@/i18n/composables"; +import { useI18n, useModuleI18n } from "@/i18n/composables"; import { useToast } from "@/utils/toast"; -const { tm } = useI18n(); +const { t } = useI18n(); +const { tm } = useModuleI18n("features/settings"); const toastStore = useToast(); /* const i18n = { @@ -471,7 +472,6 @@ const toastStore = useToast(); } } */ -const { t } = useI18n(); const theme = useTheme(); const apiStore = useApiStore(); diff --git a/dashboard/src/views/WelcomePage.vue b/dashboard/src/views/WelcomePage.vue index 5cabdc66a..e75b85ca6 100644 --- a/dashboard/src/views/WelcomePage.vue +++ b/dashboard/src/views/WelcomePage.vue @@ -7,7 +7,7 @@ {{ greetingText }} {{ greetingEmoji }}

- {{ tm('subtitle') }} + {{ tm("subtitle") }}

@@ -16,50 +16,160 @@
- {{ tm('onboard.title') }} + {{ tm("onboard.title") }}
- - + +
-
{{ tm('onboard.step1Title') }}
-

{{ tm('onboard.step1Desc') }}

+
+ {{ tm("onboard.step0Title") || "配置后端地址" }} +
+

+ {{ + tm("onboard.step0Desc") || + "配置 AstrBot 的后端 API 地址。" + }} +

- - {{ tm('onboard.configure') }} +
+ +
+ + {{ t("core.common.save") }} -
- {{ tm('onboard.completed') }} +
+ {{ tm("onboard.completed") }}
- +
-
{{ tm('onboard.step2Title') - }} +
+ {{ tm("onboard.step1Title") }}
-

{{ tm('onboard.step2Desc') }}

+

+ {{ tm("onboard.step1Desc") }} +

- - {{ tm('onboard.configure') }} + + {{ tm("onboard.configure") }} -
- {{ tm('onboard.completed') }} +
+ {{ tm("onboard.completed") }} +
+
+
+ + + +
+
+ {{ tm("onboard.step2Title") }} +
+

+ {{ tm("onboard.step2Desc") }} +

+
+ + {{ tm("onboard.configure") }} + +
+ {{ tm("onboard.completed") }}
- @@ -67,51 +177,68 @@
- {{ tm('resources.title') }} + {{ tm("resources.title") }}
- +
mdi-github GitHub

- {{ tm('resources.githubDesc') }} + {{ tm("resources.githubDesc") }}

- +
- mdi-book-open-variant - {{ tm('resources.docsTitle') }} + mdi-book-open-variant + {{ + tm("resources.docsTitle") + }}

- {{ tm('resources.docsDesc') }} + {{ tm("resources.docsDesc") }}

- +
mdi-hand-heart - {{ tm('resources.afdianTitle') }} + {{ + tm("resources.afdianTitle") + }}

- {{ tm('resources.afdianDesc') }} + {{ tm("resources.afdianDesc") }}

-
@@ -121,7 +248,7 @@
- {{ tm('announcement.title') }} + {{ tm("announcement.title") }}
- +