diff --git a/astrbot/dashboard/routes/stat.py b/astrbot/dashboard/routes/stat.py
index 337e544af..b216d3d14 100644
--- a/astrbot/dashboard/routes/stat.py
+++ b/astrbot/dashboard/routes/stat.py
@@ -8,6 +8,7 @@ from quart import request
from astrbot.core.core_lifecycle import AstrBotCoreLifecycle
from astrbot.core.db import BaseDatabase
from astrbot.core.config import VERSION
+from astrbot.core.utils.io import get_dashboard_version
from astrbot.core import DEMO_MODE
@@ -46,7 +47,10 @@ class StatRoute(Route):
return f"{h}小时{m}分{s}秒"
async def get_version(self):
- return Response().ok({"version": VERSION}).__dict__
+ return Response().ok({
+ "version": VERSION,
+ "dashboard_version": await get_dashboard_version(),
+ }).__dict__
async def get_start_time(self):
return Response().ok({"start_time": self.core_lifecycle.start_time}).__dict__
diff --git a/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue b/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue
index f9c22f18d..2a871485e 100644
--- a/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue
+++ b/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue
@@ -78,6 +78,17 @@ function accountEdit() {
});
}
+function getVersion() {
+ axios.get('/api/stat/version')
+ .then((res) => {
+ botCurrVersion.value = "v" + res.data.data.version;
+ dashboardCurrentVersion.value = res.data.data?.dashboard_version;
+ })
+ .catch((err) => {
+ console.log(err);
+ });
+}
+
function checkUpdate() {
updateStatus.value = '正在检查更新...';
axios.get('/api/update/check')
@@ -90,8 +101,6 @@ function checkUpdate() {
} 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;
})
.catch((err) => {
@@ -181,6 +190,7 @@ function updateDashboard() {
});
}
+getVersion();
checkUpdate();
const commonStore = useCommonStore();
@@ -208,23 +218,29 @@ if (localStorage.getItem('change_pwd_hint') != null && localStorage.getItem('cha
-