From 3cd10117dd1879fe8198ebb7364643644b626cb9 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Wed, 26 Mar 2025 14:13:57 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20perf:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC=E6=97=B6=E7=9A=84=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/zip_updator.py | 2 +- .../full/vertical-header/VerticalHeader.vue | 51 ++++++++++++++++--- 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/astrbot/core/zip_updator.py b/astrbot/core/zip_updator.py index 4622b47cd..23ff3ba76 100644 --- a/astrbot/core/zip_updator.py +++ b/astrbot/core/zip_updator.py @@ -23,7 +23,7 @@ class ReleaseInfo: self.body = body def __str__(self) -> str: - return f"新版本: {self.version}, 发布于: {self.published_at}, 详细内容: {self.body}" + return f"\n{self.body}\n\n版本: {self.version} | 发布于: {self.published_at}" class RepoZipUpdator: diff --git a/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue b/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue index 3d08c9cd6..014191945 100644 --- a/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue +++ b/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue @@ -5,6 +5,7 @@ import axios from 'axios'; import { md5 } from 'js-md5'; import { useAuthStore } from '@/stores/auth'; import { useCommonStore } from '@/stores/common'; +import { marked } from 'marked'; const customizer = useCustomizerStore(); let dialog = ref(false); @@ -15,6 +16,7 @@ let newPassword = ref(''); let newUsername = ref(''); let status = ref(''); let updateStatus = ref('') +let releaseMessage = ref(''); let hasNewVersion = ref(false); let botCurrVersion = ref(''); let dashboardHasNewVersion = ref(false); @@ -81,7 +83,13 @@ function checkUpdate() { axios.get('/api/update/check') .then((res) => { hasNewVersion.value = res.data.data.has_new_version; - updateStatus.value = res.data.message; + + if (res.data.data.has_new_version) { + releaseMessage.value = res.data.message; + updateStatus.value = '有新版本!'; + } else { + updateStatus.value = res.data.message; + } botCurrVersion.value = res.data.data.version; dashboardCurrentVersion.value = res.data.data.dashboard_version; dashboardHasNewVersion.value = res.data.data.dashboard_has_new_version; @@ -226,15 +234,23 @@ if (localStorage.getItem('change_pwd_hint') != null && localStorage.getItem('cha - +

{{ botCurrVersion }}

{{ updateStatus }}
+
+ +
+
- 💡 TIP: 跳到旧版本或者切换到某个版本不会重新下载管理面板文件,这可能会造成部分数据显示错误。您可在 此处 - 找到对应的面板文件 dist.zip,解压后替换 data/dist 文件夹即可。当然,前端源代码在 dashboard 目录下,你也可以自己使用 npm install 和 npm build 构建。 + 💡 TIP: 跳到旧版本或者切换到某个版本不会重新下载管理面板文件,这可能会造成部分数据显示错误。您可在 此处 + 找到对应的面板文件 dist.zip,解压后替换 data/dist 文件夹即可。当然,前端源代码在 dashboard 目录下,你也可以自己使用 npm install 和 npm build + 构建。
@@ -269,7 +285,7 @@ if (localStorage.getItem('change_pwd_hint') != null && localStorage.getItem('cha - +
@@ -319,7 +335,8 @@ if (localStorage.getItem('change_pwd_hint') != null && localStorage.getItem('cha

- + 下载并更新 @@ -379,4 +396,24 @@ if (localStorage.getItem('change_pwd_hint') != null && localStorage.getItem('cha - \ No newline at end of file + + + \ No newline at end of file