From db96d8507087a5899228080ed6eba5e45efce0d7 Mon Sep 17 00:00:00 2001 From: wood chen Date: Sat, 19 Apr 2025 14:48:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20ServerCard=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E4=BC=98=E5=8C=96=E5=86=85=E5=AD=98=E5=92=8C?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E5=A4=A7=E5=B0=8F=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E4=B8=BA=20"-"=20=E7=9A=84=E5=A4=84=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E5=8D=87=E4=BF=A1=E6=81=AF=E5=B1=95=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E6=B8=85=E6=99=B0=E5=BA=A6=E5=92=8C=E5=8F=AF=E8=AF=BB=E6=80=A7?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ServerCard.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/ServerCard.tsx b/src/components/ServerCard.tsx index 06e9add..c7fa6e6 100644 --- a/src/components/ServerCard.tsx +++ b/src/components/ServerCard.tsx @@ -445,7 +445,7 @@ export default function ServerCard({ now, serverInfo, cycleStats }: ServerCardPr {cpu_info[0].includes("Physical") ? "pCPU: " : "vCPU: "} - {cpu_info[0].match(/(\d+)\s+(?:Physical|Virtual)\s+Core/)?.[1] || "?"} + {cpu_info[0].match(/(\d+)\s+(?:Physical|Virtual)\s+Core/)?.[1] || "-"} @@ -456,16 +456,24 @@ export default function ServerCard({ now, serverInfo, cycleStats }: ServerCardPr )} {/* 内存大小 */} - {mem_total > 0 && ( + {mem_total > 0 ? ( - {t("serverCard.mem")}: {formatBytes(mem_total)} + RAM: {formatBytes(mem_total)} + + ) : ( + + RAM: - )} {/* 存储大小 */} - {disk_total > 0 && ( + {disk_total > 0 ? ( - {t("serverCard.stg")}: {formatBytes(disk_total)} + DISK: {formatBytes(disk_total)} + + ) : ( + + DISK: - )}