feat: net transfer badge

This commit is contained in:
hamster1963
2024-11-30 22:26:13 +08:00
parent 48b2d1493a
commit 3f0c2ed39d
8 changed files with 61 additions and 48 deletions

View File

@@ -6,6 +6,8 @@ import { NezhaServer } from "@/types/nezha-api";
import { Card } from "./ui/card";
import { useNavigate } from "react-router-dom";
import { useTranslation } from "react-i18next";
import { Badge } from "./ui/badge";
import { formatBytes } from "@/lib/format";
export default function ServerCard({
now,
@@ -101,6 +103,20 @@ export default function ServerCard({
</div>
</div>
</section>
<section className={"flex items-center justify-between gap-1"}>
<Badge
variant="secondary"
className="items-center flex-1 justify-center rounded-[8px] text-nowrap text-[11px] border-muted-50 shadow-md shadow-neutral-200/30 dark:shadow-none"
>
{t("Upload")}:{formatBytes(serverInfo.state.net_out_transfer)}
</Badge>
<Badge
variant="outline"
className="items-center flex-1 justify-center rounded-[8px] text-nowrap text-[11px] shadow-md shadow-neutral-200/30 dark:shadow-none"
>
{t("Download")}:{formatBytes(serverInfo.state.net_in_transfer)}
</Badge>
</section>
</div>
</Card>
</section>