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{ var DeleteV2Openresty = &gormigrate.Migration{
ID: "20250701-delete-v2-openresty", ID: "20250701-delete-v2-openresty",
Migrate: func(tx *gorm.DB) error { 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', ssl: 'Certificate | Certificates',
database: 'Database | Databases', database: 'Database | Databases',
ai_tools: 'AI', ai_tools: 'AI',
mcp: 'MCP',
container: 'Container | Containers', container: 'Container | Containers',
cronjob: 'Cron Job | Cron Jobs', cronjob: 'Cron Job | Cron Jobs',
host: 'Host | Hosts', host: 'Host | Hosts',

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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