🐛 修复监控页面loading状态 - 在mounted中提前设置
- 将healthCheck.loading和systemLogs.loading初始值改回false - 在mounted中、checkLoginStatus之前,判断adminTab并设置loading - 确保在appReady变为true之前loading状态已正确设置 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -165,7 +165,7 @@ createApp({
|
|||||||
|
|
||||||
// 健康检测
|
// 健康检测
|
||||||
healthCheck: {
|
healthCheck: {
|
||||||
loading: localStorage.getItem('adminTab') === 'monitor', // 如果在监控页刷新,初始显示加载中
|
loading: false,
|
||||||
lastCheck: null,
|
lastCheck: null,
|
||||||
overallStatus: null, // healthy, warning, critical
|
overallStatus: null, // healthy, warning, critical
|
||||||
summary: { total: 0, pass: 0, warning: 0, fail: 0, info: 0 },
|
summary: { total: 0, pass: 0, warning: 0, fail: 0, info: 0 },
|
||||||
@@ -174,7 +174,7 @@ createApp({
|
|||||||
|
|
||||||
// 系统日志
|
// 系统日志
|
||||||
systemLogs: {
|
systemLogs: {
|
||||||
loading: localStorage.getItem('adminTab') === 'monitor', // 如果在监控页刷新,初始显示加载中
|
loading: false,
|
||||||
logs: [],
|
logs: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
page: 1,
|
page: 1,
|
||||||
@@ -2876,6 +2876,13 @@ handleDragLeave(e) {
|
|||||||
this.checkUrlParams();
|
this.checkUrlParams();
|
||||||
// 获取系统配置(上传限制等)
|
// 获取系统配置(上传限制等)
|
||||||
this.loadPublicConfig();
|
this.loadPublicConfig();
|
||||||
|
|
||||||
|
// 如果用户在监控页面刷新,提前设置loading状态(防止显示"无数据"闪烁)
|
||||||
|
if (this.adminTab === 'monitor') {
|
||||||
|
this.healthCheck.loading = true;
|
||||||
|
this.systemLogs.loading = true;
|
||||||
|
}
|
||||||
|
|
||||||
// 检查登录状态
|
// 检查登录状态
|
||||||
this.checkLoginStatus();
|
this.checkLoginStatus();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user