From a3a1e1784989dce86a596c4906ac53d83cf7f30b Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 21 Mar 2023 18:48:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=8E=A7=E4=BB=B6=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8=E7=9A=84=E9=97=AE=E9=A2=98=20(#348)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: 解决监控时间控件显示不全的问题 --- backend/cron/job/monitor.go | 3 +++ frontend/src/views/host/monitor/index.vue | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/cron/job/monitor.go b/backend/cron/job/monitor.go index be27e9cb4..e91a8b054 100644 --- a/backend/cron/job/monitor.go +++ b/backend/cron/job/monitor.go @@ -118,6 +118,9 @@ func loadNetIO() { netStatAll2, _ := net.IOCounters(false) for _, net2 := range netStatAll2 { for _, net1 := range netStatAll { + if net1.BytesSent == 0 || net1.BytesRecv == 0 { + continue + } if net2.Name == net1.Name { var itemNet model.MonitorNetwork itemNet.Name = net1.Name diff --git a/frontend/src/views/host/monitor/index.vue b/frontend/src/views/host/monitor/index.vue index 899b87d79..64ce9f9e4 100644 --- a/frontend/src/views/host/monitor/index.vue +++ b/frontend/src/views/host/monitor/index.vue @@ -21,7 +21,7 @@ :start-placeholder="$t('commons.search.timeStart')" :end-placeholder="$t('commons.search.timeEnd')" :shortcuts="shortcuts" - style="float: right; width: 330px" + style="float: right; width: 360px" >
@@ -41,7 +41,7 @@ :start-placeholder="$t('commons.search.timeStart')" :end-placeholder="$t('commons.search.timeEnd')" :shortcuts="shortcuts" - style="float: right; width: 330px" + style="float: right; width: 360px" > @@ -59,7 +59,7 @@ :start-placeholder="$t('commons.search.timeStart')" :end-placeholder="$t('commons.search.timeEnd')" :shortcuts="shortcuts" - style="float: right; width: 330px" + style="float: right; width: 360px" > @@ -79,7 +79,7 @@ :start-placeholder="$t('commons.search.timeStart')" :end-placeholder="$t('commons.search.timeEnd')" :shortcuts="shortcuts" - style="float: right; width: 330px" + style="float: right; width: 360px" > @@ -114,7 +114,7 @@ :start-placeholder="$t('commons.search.timeStart')" :end-placeholder="$t('commons.search.timeEnd')" :shortcuts="shortcuts" - style="float: right; width: 330px" + style="float: right; width: 360px" >