From 7179b13d0349fdda3ba1e20f5ff2c886df07de40 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Thu, 13 Jul 2023 12:02:03 +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?= 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 f454d1b430a9..f001149579d4 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 05d1ddb67e3b..b22ac1cc1f54 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; } }); };