From e460b411da32724259fd607f198c6d0513273ea1 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Sun, 7 Dec 2025 15:23:30 +0800 Subject: [PATCH] chore: remove dev version from webui (#3951) * chore: remove dev version * chore: remove development version references from header localization files --- .../src/i18n/locales/en-US/core/header.json | 13 +-- .../src/i18n/locales/zh-CN/core/header.json | 13 +-- .../full/vertical-header/VerticalHeader.vue | 92 +------------------ 3 files changed, 6 insertions(+), 112 deletions(-) diff --git a/dashboard/src/i18n/locales/en-US/core/header.json b/dashboard/src/i18n/locales/en-US/core/header.json index 718cc60e6..698fc9741 100644 --- a/dashboard/src/i18n/locales/en-US/core/header.json +++ b/dashboard/src/i18n/locales/en-US/core/header.json @@ -21,8 +21,7 @@ "updating": "Updating..." }, "tabs": { - "release": "😊 Release", - "dev": "🧐 Development (master branch)" + "release": "😊 Release" }, "updateToLatest": "Update to Latest Version", "preRelease": "Pre-release", @@ -42,19 +41,9 @@ "content": "Content", "sourceUrl": "Source URL", "actions": "Actions", - "sha": "SHA", - "date": "Date", - "message": "Message", "view": "View", "switch": "Switch" }, - "manualInput": { - "title": "Manual Input Version or Commit SHA", - "placeholder": "Enter version number or commit hash from master branch.", - "hint": "e.g. v3.3.16 (without SHA) or 42e5ec5d80b93b6bfe8b566754d45ffac4c3fe0b", - "linkText": "View master branch commit history (click copy on the right to copy)", - "confirm": "Confirm Switch" - }, "releaseNotes": { "title": "Release Notes" }, diff --git a/dashboard/src/i18n/locales/zh-CN/core/header.json b/dashboard/src/i18n/locales/zh-CN/core/header.json index 5f828176b..88edef0f5 100644 --- a/dashboard/src/i18n/locales/zh-CN/core/header.json +++ b/dashboard/src/i18n/locales/zh-CN/core/header.json @@ -21,8 +21,7 @@ "updating": "正在更新..." }, "tabs": { - "release": "😊 正式版", - "dev": "🧐 开发版(master 分支)" + "release": "😊 正式版" }, "updateToLatest": "更新到最新版本", "preRelease": "预发布", @@ -42,19 +41,9 @@ "content": "内容", "sourceUrl": "源码地址", "actions": "操作", - "sha": "SHA", - "date": "日期", - "message": "信息", "view": "查看", "switch": "切换" }, - "manualInput": { - "title": "手动输入版本号或 Commit SHA", - "placeholder": "输入版本号或 master 分支下的 commit hash。", - "hint": "如 v3.3.16 (不带 SHA) 或 42e5ec5d80b93b6bfe8b566754d45ffac4c3fe0b", - "linkText": "查看 master 分支提交记录(点击右边的 copy 即可复制)", - "confirm": "确定切换" - }, "releaseNotes": { "title": "更新日志" }, diff --git a/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue b/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue index b1d076fca..03f2145c4 100644 --- a/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue +++ b/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue @@ -39,7 +39,6 @@ let dashboardHasNewVersion = ref(false); let dashboardCurrentVersion = ref(''); let version = ref(''); let releases = ref([]); -let devCommits = ref<{ sha: string; date: string; message: string }[]>([]); let updatingDashboardLoading = ref(false); let installLoading = ref(false); @@ -48,8 +47,6 @@ let releaseNotesDialog = ref(false); let selectedReleaseNotes = ref(''); let selectedReleaseTag = ref(''); -let tab = ref(0); - const releasesHeader = computed(() => [ { title: t('core.header.updateDialog.table.tag'), key: 'tag_name' }, { title: t('core.header.updateDialog.table.publishDate'), key: 'published_at' }, @@ -196,48 +193,7 @@ function getReleases() { }); } -function getDevCommits() { - let proxy = localStorage.getItem('selectedGitHubProxy') || ''; - const originalUrl = "https://api.github.com/repos/AstrBotDevs/AstrBot/commits"; - let commits_url = originalUrl; - if (proxy !== '') { - proxy = proxy.endsWith('/') ? proxy : proxy + '/'; - commits_url = proxy + originalUrl; - } - function fetchCommits(url: string, onError?: () => void) { - fetch(url, { - headers: { - 'Host': 'api.github.com', - 'Referer': 'https://api.github.com' - } - }) - .then(response => response.json()) - .then(data => { - devCommits.value = Array.isArray(data) - ? data.map((commit: any) => ({ - sha: commit.sha, - date: new Date(commit.commit.author.date).toLocaleString(), - message: commit.commit.message - })) - : []; - }) - .catch(err => { - if (onError) { - onError(); - } else { - console.log('获取开发版提交信息失败:', err); - } - }); - } - - fetchCommits(commits_url, () => { - if (proxy !== '' && commits_url !== originalUrl) { - console.log('使用代理请求失败,尝试直接请求'); - fetchCommits(originalUrl); - } - }); -} function switchVersion(version: string) { updateStatus.value = t('core.header.updateDialog.status.switching'); @@ -357,7 +313,7 @@ commonStore.getStartTime();