fix: Fix dashboard refresh exception issue (#9455)

This commit is contained in:
ssongliu 2025-07-08 12:15:53 +08:00 committed by GitHub
parent 29a304e2c8
commit 2e8bcc09e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 24 additions and 6 deletions

View file

@ -489,7 +489,7 @@ var AddPbootCMSPHPExtensions = &gormigrate.Migration{
var DeleteV2Openresty = &gormigrate.Migration{
ID: "20250701-delete-v2-openresty",
Migrate: func(tx *gorm.DB) error {
return tx.Delete(&model.AppDetail{}).Where("version = '1.27.1.2-0-1-focal'").Error
return tx.Where("version = '1.27.1.2-0-1-focal'").Delete(&model.AppDetail{}).Error
},
}

View file

@ -333,6 +333,7 @@ const message = {
ssl: 'Certificate | Certificates',
database: 'Database | Databases',
ai_tools: 'AI',
mcp: 'MCP',
container: 'Container | Containers',
cronjob: 'Cron Job | Cron Jobs',
host: 'Host | Hosts',

View file

@ -333,6 +333,7 @@ const message = {
ssl: '証明書|証明書',
database: 'データベース|データベース',
ai_tools: 'AI',
mcp: 'MCP',
container: 'コンテナ|コンテナ',
cronjob: 'クロンジョブ|クロンの仕事',
host: 'ホスト|ホスト',

View file

@ -334,6 +334,7 @@ const message = {
ssl: '인증서 | 인증서들',
database: '데이터베이스 | 데이터베이스들',
ai_tools: 'AI',
mcp: 'MCP',
container: '컨테이너 | 컨테이너들',
cronjob: '크론 작업 | 크론 작업들',
host: '호스트 | 호스트들',

View file

@ -340,6 +340,7 @@ const message = {
ssl: 'Certificate | Certificates',
database: 'Database | Databases',
ai_tools: 'AI',
mcp: 'MCP',
container: 'Container | Containers',
cronjob: 'Cron Job | Cron Jobs',
host: 'Host | Hosts',

View file

@ -338,6 +338,7 @@ const message = {
ssl: 'Certificado | Certificados',
database: 'Banco de Dados | Bancos de Dados',
ai_tools: 'AI',
mcp: 'MCP',
container: 'Container | Containers',
cronjob: 'Tarefa Cron | Tarefas Cron',
host: 'Host | Hosts',

View file

@ -334,6 +334,7 @@ const message = {
ssl: 'Сертификат | Сертификаты',
database: 'База данных | Базы данных',
ai_tools: 'AI',
mcp: 'MCP',
container: 'Контейнер | Контейнеры',
cronjob: 'Cron | Задачи Cron',
host: 'Хост | Хосты',

View file

@ -327,6 +327,7 @@ const message = {
ssl: '證書',
database: '資料庫',
ai_tools: 'AI',
mcp: 'MCP',
container: '容器',
cronjob: '計劃任務',
host: '主機',

View file

@ -326,6 +326,7 @@ const message = {
ssl: '证书',
database: '数据库',
ai_tools: 'AI',
mcp: 'MCP',
container: '容器',
cronjob: '计划任务',
host: '主机',

View file

@ -289,6 +289,7 @@ const chartOption = ref('network');
let timer: NodeJS.Timer | null = null;
let isInit = ref<boolean>(true);
let isActive = ref(true);
let isCurrentActive = ref(true);
const ioReadBytes = ref<Array<number>>([]);
const ioWriteBytes = ref<Array<number>>([]);
@ -426,12 +427,20 @@ const onLoadBaseInfo = async (isInit: boolean, range: string) => {
currentInfo.value.uptime = resData.uptime;
loadAppCurrentInfo();
statusRef.value.acceptParams(currentInfo.value, baseInfo.value);
appRef.value.acceptParams();
statusRef.value?.acceptParams(currentInfo.value, baseInfo.value);
appRef.value?.acceptParams();
if (isInit) {
timer = setInterval(async () => {
if (isActive.value && !globalStore.isOnRestart) {
loadAppCurrentInfo();
try {
if (!isCurrentActive.value) {
throw new Error('jump out');
}
if (isActive.value && !globalStore.isOnRestart) {
await loadAppCurrentInfo();
}
} catch {
clearInterval(Number(timer));
timer = null;
}
}, 3000);
}
@ -439,7 +448,7 @@ const onLoadBaseInfo = async (isInit: boolean, range: string) => {
const loadAppCurrentInfo = async () => {
await Promise.all([onLoadCurrentInfo('gpu'), onLoadCurrentInfo('basic'), onLoadCurrentInfo('ioNet')]);
statusRef.value.acceptParams(currentInfo.value, baseInfo.value);
statusRef.value?.acceptParams(currentInfo.value, baseInfo.value);
};
const onLoadCurrentInfo = async (scope: string) => {
@ -661,6 +670,7 @@ onMounted(() => {
onBeforeUnmount(() => {
window.removeEventListener('focus', onFocus);
window.removeEventListener('blur', onBlur);
isCurrentActive.value = false;
clearInterval(Number(timer));
timer = null;
});