diff --git a/dashboard/src/assets/mdi-subset/materialdesignicons-subset.css b/dashboard/src/assets/mdi-subset/materialdesignicons-subset.css index 52a052cfa1..0e7df67891 100644 --- a/dashboard/src/assets/mdi-subset/materialdesignicons-subset.css +++ b/dashboard/src/assets/mdi-subset/materialdesignicons-subset.css @@ -1,4 +1,4 @@ -/* Auto-generated MDI subset – 231 icons */ +/* Auto-generated MDI subset – 232 icons */ /* Do not edit manually. Run: pnpm run subset-icons */ @font-face { @@ -728,6 +728,10 @@ content: "\F0A66"; } +.mdi-qrcode::before { + content: "\F0432"; +} + .mdi-refresh::before { content: "\F0450"; } diff --git a/dashboard/src/assets/mdi-subset/materialdesignicons-webfont-subset.woff b/dashboard/src/assets/mdi-subset/materialdesignicons-webfont-subset.woff index 85c2ed9fdf..fed2ed2450 100644 Binary files a/dashboard/src/assets/mdi-subset/materialdesignicons-webfont-subset.woff and b/dashboard/src/assets/mdi-subset/materialdesignicons-webfont-subset.woff differ diff --git a/dashboard/src/assets/mdi-subset/materialdesignicons-webfont-subset.woff2 b/dashboard/src/assets/mdi-subset/materialdesignicons-webfont-subset.woff2 index 376e47ce72..41c2b79842 100644 Binary files a/dashboard/src/assets/mdi-subset/materialdesignicons-webfont-subset.woff2 and b/dashboard/src/assets/mdi-subset/materialdesignicons-webfont-subset.woff2 differ diff --git a/dashboard/src/i18n/locales/en-US/core/header.json b/dashboard/src/i18n/locales/en-US/core/header.json index 4da98b8dd8..a0921d0d04 100644 --- a/dashboard/src/i18n/locales/en-US/core/header.json +++ b/dashboard/src/i18n/locales/en-US/core/header.json @@ -47,6 +47,13 @@ "releaseNotes": { "title": "Release Notes" }, + "commitHash": { + "title": "Update via Commit Hash", + "description": "Enter a 40-character commit hash from the GitHub repository to install unreleased fixes and features.", + "label": "Enter commit hash", + "install": "Install", + "invalidFormat": "Please enter a valid 40-character hexadecimal commit hash" + }, "redirectConfirm": { "title": "Leaving AstrBot", "message": "You are about to open the GitHub Releases page. Continue?", diff --git a/dashboard/src/i18n/locales/ru-RU/core/header.json b/dashboard/src/i18n/locales/ru-RU/core/header.json index a23f3dfd33..58b019a6af 100644 --- a/dashboard/src/i18n/locales/ru-RU/core/header.json +++ b/dashboard/src/i18n/locales/ru-RU/core/header.json @@ -1,4 +1,4 @@ -{ +{ "logoTitle": "Панель управления AstrBot", "version": { "hasNewVersion": "Доступна новая версия AstrBot!", @@ -47,6 +47,13 @@ "releaseNotes": { "title": "Журнал изменений" }, + "commitHash": { + "title": "Обновление через Commit Hash", + "description": "Введите 40-значный хеш фиксации из репозитория GitHub, чтобы установить невыпущенные исправления и функции.", + "label": "Введите хеш фиксации", + "install": "Установить", + "invalidFormat": "Введите действительный 40-значный шестнадцатеричный хеш фиксации" + }, "redirectConfirm": { "title": "Переход по ссылке", "message": "Вы будете перенаправлены на страницу GitHub Releases. Продолжить?", @@ -105,4 +112,4 @@ "updateFailed": "Ошибка обновления, попробуйте еще раз" } } -} \ No newline at end of file +} diff --git a/dashboard/src/i18n/locales/zh-CN/core/header.json b/dashboard/src/i18n/locales/zh-CN/core/header.json index 3bb9850331..e3bdc83721 100644 --- a/dashboard/src/i18n/locales/zh-CN/core/header.json +++ b/dashboard/src/i18n/locales/zh-CN/core/header.json @@ -47,6 +47,13 @@ "releaseNotes": { "title": "更新日志" }, + "commitHash": { + "title": "通过 Commit Hash 更新", + "description": "输入 GitHub 仓库的 40 位 commit hash,可以安装尚未发布至正式版的修复和功能。", + "label": "输入 commit hash", + "install": "安装", + "invalidFormat": "请输入有效的 40 位十六进制 commit hash" + }, "redirectConfirm": { "title": "即将跳转", "message": "将跳转到 GitHub Releases 页面,是否继续?", diff --git a/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue b/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue index aa627baeaf..d9d33550ad 100644 --- a/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue +++ b/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue @@ -48,6 +48,7 @@ let version = ref(''); let releases = ref([]); let updatingDashboardLoading = ref(false); let installLoading = ref(false); +let commitHashInput = ref(''); const isDesktopReleaseMode = ref( typeof window !== 'undefined' && !!window.astrbotDesktop?.isDesktop ); @@ -93,6 +94,13 @@ const releasesHeader = computed(() => [ { title: t('core.header.updateDialog.table.sourceUrl'), key: 'zipball_url' }, { title: t('core.header.updateDialog.table.actions'), key: 'switch' } ]); + +const commitHashRegex = /^[0-9a-f]{40}$/i; +const isCommitHashValid = computed(() => commitHashRegex.test(commitHashInput.value)); + +const commitHashRules = computed(() => [ + (v: string) => !v || commitHashRegex.test(v) || t('core.header.updateDialog.commitHash.invalidFormat') +]); // Form validation const formValid = ref(true); const passwordRules = computed(() => [ @@ -729,6 +737,33 @@ onMounted(async () => { + +
+

{{ t('core.header.updateDialog.commitHash.title') }}

+ {{ t('core.header.updateDialog.commitHash.description') }} +
+ + + {{ t('core.header.updateDialog.commitHash.install') }} + +
+
+

{{ t('core.header.updateDialog.dashboardUpdate.title') }}

@@ -1078,4 +1113,13 @@ onMounted(async () => { font-size: 16px; } } + +.commit-hash-input { + max-width: 420px; + font-family: monospace; +} + +.commit-hash-btn { + border-radius: 10px; +}