Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -728,6 +728,10 @@
content: "\F0A66";
}

.mdi-qrcode::before {
content: "\F0432";
}

.mdi-refresh::before {
content: "\F0450";
}
Expand Down
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions dashboard/src/i18n/locales/en-US/core/header.json
Original file line number Diff line number Diff line change
Expand Up @@ -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?",
Expand Down
11 changes: 9 additions & 2 deletions dashboard/src/i18n/locales/ru-RU/core/header.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"logoTitle": "Панель управления AstrBot",
"version": {
"hasNewVersion": "Доступна новая версия AstrBot!",
Expand Down Expand Up @@ -47,6 +47,13 @@
"releaseNotes": {
"title": "Журнал изменений"
},
"commitHash": {
"title": "Обновление через Commit Hash",
"description": "Введите 40-значный хеш фиксации из репозитория GitHub, чтобы установить невыпущенные исправления и функции.",
"label": "Введите хеш фиксации",
"install": "Установить",
"invalidFormat": "Введите действительный 40-значный шестнадцатеричный хеш фиксации"
},
"redirectConfirm": {
"title": "Переход по ссылке",
"message": "Вы будете перенаправлены на страницу GitHub Releases. Продолжить?",
Expand Down Expand Up @@ -105,4 +112,4 @@
"updateFailed": "Ошибка обновления, попробуйте еще раз"
}
}
}
}
7 changes: 7 additions & 0 deletions dashboard/src/i18n/locales/zh-CN/core/header.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 页面,是否继续?",
Expand Down
44 changes: 44 additions & 0 deletions dashboard/src/layouts/full/vertical-header/VerticalHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down Expand Up @@ -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(() => [
Expand Down Expand Up @@ -729,6 +737,33 @@ onMounted(async () => {
</v-data-table>
</div>

<v-divider class="mt-4 mb-4"></v-divider>
<div class="my-4">
<h3 class="mb-2">{{ t('core.header.updateDialog.commitHash.title') }}</h3>
<small class="mb-3 d-block">{{ t('core.header.updateDialog.commitHash.description') }}</small>
<div class="d-flex align-center ga-3">
<v-text-field
v-model.trim="commitHashInput"
:label="t('core.header.updateDialog.commitHash.label')"
:rules="commitHashRules"
density="compact"
variant="outlined"
hide-details="auto"
maxlength="40"
class="commit-hash-input"
/>
<v-btn
color="primary"
class="commit-hash-btn"
:disabled="!isCommitHashValid"
:loading="installLoading"
@click="switchVersion(commitHashInput)"
>
{{ t('core.header.updateDialog.commitHash.install') }}
</v-btn>
</div>
</div>

<v-divider class="mt-4 mb-4"></v-divider>
<div style="margin-top: 16px;">
<h3 class="mb-4">{{ t('core.header.updateDialog.dashboardUpdate.title') }}</h3>
Expand Down Expand Up @@ -1078,4 +1113,13 @@ onMounted(async () => {
font-size: 16px;
}
}

.commit-hash-input {
max-width: 420px;
font-family: monospace;
}

.commit-hash-btn {
border-radius: 10px;
}
</style>
Loading