From 5b989fab0f4e129fa411432c1dc288faf72e528c Mon Sep 17 00:00:00 2001 From: yangsy Date: Fri, 19 Dec 2025 12:46:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20DeviceHardwareCard=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../current-diag/device-hardware-card.vue | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/device/device-card/components/current-diag/device-hardware-card.vue b/src/components/device/device-card/components/current-diag/device-hardware-card.vue index dc3d64e..dc0fb01 100644 --- a/src/components/device/device-card/components/current-diag/device-hardware-card.vue +++ b/src/components/device/device-card/components/current-diag/device-hardware-card.vue @@ -8,12 +8,16 @@ const props = defineProps<{ memUsage?: string; diskUsage?: string; runningTime?: string; + cpuUsageLabel?: string; + memUsageLabel?: string; + diskUsageLabel?: string; + runningTimeLabel?: string; }>(); -const { cpuUsage, memUsage, diskUsage, runningTime } = toRefs(props); +const { cpuUsage, memUsage, diskUsage, runningTime, cpuUsageLabel, memUsageLabel, diskUsageLabel, runningTimeLabel } = toRefs(props); const showCard = computed(() => { - return Object.values(props).some((value) => !!value); + return Object.values({ cpuUsage, memUsage, diskUsage, runningTime }).some((value) => !!value); }); const cpuPercent = computed(() => { @@ -51,22 +55,22 @@ const getProgressStatus = (percent: number): ProgressStatus => { - CPU + {{ cpuUsageLabel || 'CPU' }} {{ cpuPercent }}% - 内存 + {{ memUsageLabel || '内存' }} {{ memPercent }}% - 磁盘 + {{ diskUsageLabel || '磁盘' }} {{ diskPercent }}% - 系统运行时间 + {{ runningTimeLabel || '运行时间' }} {{ formattedRunningTime }}