feat: show uptime hours

This commit is contained in:
hamster1963 2024-12-15 01:45:18 +08:00
parent 61553f4b8c
commit bdfbcaba65
4 changed files with 6 additions and 1 deletions

View File

@ -117,7 +117,9 @@ export default function ServerCardInline({
<div className={"flex w-20 flex-col"}>
<p className="text-xs text-muted-foreground">{t("serverCard.uptime")}</p>
<div className="flex items-center text-xs font-semibold">
{(uptime / 86400).toFixed(0)} {t("serverCard.days")}
{uptime / 86400 >= 1
? `${(uptime / 86400).toFixed(0)} ${t("serverCard.days")}`
: `${(uptime / 3600).toFixed(0)} ${t("serverCard.hours")}`}
</div>
</div>
<div className={"flex w-14 flex-col"}>

View File

@ -27,6 +27,7 @@
"mem": "MEM",
"stg": "STG",
"days": "Days",
"hours": "Hours",
"upload": "Upload",
"download": "Download",
"system": "System",

View File

@ -27,6 +27,7 @@
"mem": "内存",
"stg": "存储",
"days": "天",
"hours": "小时",
"upload": "上传",
"download": "下载",
"system": "系统",

View File

@ -27,6 +27,7 @@
"mem": "內存",
"stg": "存儲",
"days": "天",
"hours": "小時",
"upload": "上傳",
"download": "下載",
"system": "系統",