fix: net badge error

This commit is contained in:
hamster1963 2024-10-11 13:20:48 +08:00
parent f8f7b5190a
commit dd15612d15

View File

@ -107,19 +107,19 @@ export default function ServerCard({
variant="secondary" variant="secondary"
className="items-center justify-center rounded-[8px] text-nowrap text-[11px] border-muted-50 shadow-md shadow-neutral-200/30 dark:shadow-none" className="items-center justify-center rounded-[8px] text-nowrap text-[11px] border-muted-50 shadow-md shadow-neutral-200/30 dark:shadow-none"
style={{ style={{
width: `${(serverInfo.status.NetInTransfer / (serverInfo.status.NetInTransfer + serverInfo.status.NetOutTransfer)) * 100}%`, width: `${(serverInfo.status.NetOutTransfer / (serverInfo.status.NetInTransfer + serverInfo.status.NetOutTransfer)) * 100}%`,
}} }}
> >
{t("Upload")}:{formatBytes(serverInfo.status.NetInTransfer)} {t("Upload")}:{formatBytes(serverInfo.status.NetOutTransfer)}
</Badge> </Badge>
<Badge <Badge
variant="outline" variant="outline"
className="items-center justify-center rounded-[8px] text-nowrap text-[11px] shadow-md shadow-neutral-200/30 dark:shadow-none" className="items-center justify-center rounded-[8px] text-nowrap text-[11px] shadow-md shadow-neutral-200/30 dark:shadow-none"
style={{ style={{
width: `${(serverInfo.status.NetOutTransfer / (serverInfo.status.NetInTransfer + serverInfo.status.NetOutTransfer)) * 100}%`, width: `${(serverInfo.status.NetInTransfer / (serverInfo.status.NetInTransfer + serverInfo.status.NetOutTransfer)) * 100}%`,
}} }}
> >
{t("Download")}:{formatBytes(serverInfo.status.NetOutTransfer)} {t("Download")}:{formatBytes(serverInfo.status.NetInTransfer)}
</Badge> </Badge>
</section> </section>
)} )}