From ef948bca760d569d19d6d40a43d2904d24e7cd64 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Thu, 13 Jul 2023 14:11:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=A6=82=E8=A7=88?= =?UTF-8?q?=E9=A1=B5=E5=A4=9A=E7=A3=81=E7=9B=98=E5=88=B7=E6=96=B0=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#1640)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/home/index.vue | 6 ++++-- frontend/src/views/home/status/index.vue | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/home/index.vue b/frontend/src/views/home/index.vue index 54ca3938f..13d2cd034 100644 --- a/frontend/src/views/home/index.vue +++ b/frontend/src/views/home/index.vue @@ -239,6 +239,7 @@ const isSafety = ref(); const chartOption = ref('network'); let timer: NodeJS.Timer | null = null; let isInit = ref(true); +let isStatusInit = ref(true); let isActive = ref(true); const ioReadBytes = ref>([]); @@ -355,7 +356,8 @@ const onLoadBaseInfo = async (isInit: boolean, range: string) => { baseInfo.value = res.data; currentInfo.value = baseInfo.value.currentInfo; await onLoadCurrentInfo(); - statuRef.value.acceptParams(currentInfo.value, baseInfo.value); + isStatusInit.value = false; + statuRef.value.acceptParams(currentInfo.value, baseInfo.value, isStatusInit.value); appRef.value.acceptParams(); if (isInit) { timer = setInterval(async () => { @@ -421,7 +423,7 @@ const onLoadCurrentInfo = async () => { } loadData(); currentInfo.value = res.data; - statuRef.value.acceptParams(currentInfo.value, baseInfo.value); + statuRef.value.acceptParams(currentInfo.value, baseInfo.value, isStatusInit.value); }; function loadUpTime(uptime: number) { diff --git a/frontend/src/views/home/status/index.vue b/frontend/src/views/home/status/index.vue index 05d1ddb67..b22ac1cc1 100644 --- a/frontend/src/views/home/status/index.vue +++ b/frontend/src/views/home/status/index.vue @@ -201,7 +201,7 @@ const currentInfo = ref({ shotTime: new Date(), }); -const acceptParams = (current: Dashboard.CurrentInfo, base: Dashboard.BaseInfo): void => { +const acceptParams = (current: Dashboard.CurrentInfo, base: Dashboard.BaseInfo, isInit: boolean): void => { currentInfo.value = current; baseInfo.value = base; freshChart('cpu', 'CPU', formatNumber(currentInfo.value.cpuUsedPercent)); @@ -215,7 +215,7 @@ const acceptParams = (current: Dashboard.CurrentInfo, base: Dashboard.BaseInfo): freshChart('disk' + i, itemPath, formatNumber(currentInfo.value.diskData[i].usedPercent)); } if (currentInfo.value.diskData.length > 5) { - showMore.value = false; + showMore.value = isInit ? false : showMore.value || false; } }); };