From a093b1dfdc272f6c8fdabd525359de3b8b56dbcf Mon Sep 17 00:00:00 2001 From: Miuss Date: Thu, 5 Dec 2024 17:20:25 +0800 Subject: [PATCH] update --- src/App.vue | 49 ++++++++++++++++++----- src/components/StatsCard.vue | 76 +++++++++++++++++++++++++++++------- src/utils/utils.js | 12 +++++- 3 files changed, 111 insertions(+), 26 deletions(-) diff --git a/src/App.vue b/src/App.vue index feb1364..b5bea93 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,5 @@ @@ -235,9 +259,9 @@ const handleClose = () => { {{item}} - +
-
+
@@ -262,6 +286,11 @@ const handleClose = () => {
{{(item.State.MemUsed / item.Host.MemTotal * 100).toFixed(2) + '%'}}
+
+
虚拟内存(Swap)
+
{{item.Host.SwapTotal === 0 ? (0).toFixed(2)+'%' : (item.State.SwapUsed / item.Host.SwapTotal * 100).toFixed(2) + '%'}}
+ +
网络速度(IN|OUT)
{{`${formatBytes(item.State.NetInSpeed)}/s | ${formatBytes(item.State.NetOutSpeed)}/s`}}
@@ -315,7 +344,7 @@ const handleClose = () => {
虚拟内存(Swap)
-
{{formatBytes(item.State.SwapUsed)}}
+
{{formatBytes(item.State.SwapUsed)}} / {{formatBytes(item.Host.SwapTotal)}}
网络速度(IN|OUT)
@@ -327,7 +356,7 @@ const handleClose = () => {
流量使用↑|↓
-
{{formatBytes(item.State.NetInTransfer)}} | {{formatBytes(item.State.NetOutTransfer)}}
+
{{formatBytes(item.State.NetOutTransfer)}} | {{formatBytes(item.State.NetInTransfer)}}
开机时间
diff --git a/src/components/StatsCard.vue b/src/components/StatsCard.vue index 195378f..0275e04 100644 --- a/src/components/StatsCard.vue +++ b/src/components/StatsCard.vue @@ -1,7 +1,26 @@