fix: 修复在线状态显示和负载单位

This commit is contained in:
Montia37
2025-09-05 17:07:03 +08:00
parent 62c0a07858
commit 4cb0fe3e46
3 changed files with 15 additions and 11 deletions

View File

@@ -181,14 +181,16 @@ export const NodeCard = ({ node, enableSwap }: NodeCardProps) => {
</div> </div>
<div className="flex justify-between text-xs"> <div className="flex justify-between text-xs">
<div className="flex justify-start w-full"> <div className="flex justify-start w-full">
<span className="text-secondary-foreground"></span> <span className="text-secondary-foreground">
<div className="flex items-center gap-1">{expired_at}</div> {expired_at}
</span>
</div> </div>
<div className="border-l border-border/60 mx-2"></div> <div className="border-l border-border/60 mx-2"></div>
<div className="flex justify-end w-full"> <div className="flex justify-end w-full">
<span className="text-secondary-foreground">线</span> <span className="text-secondary-foreground">
<span> {isOnline && stats
{isOnline && stats ? formatUptime(stats.uptime) : "离线"} ? `在线:${formatUptime(stats.uptime)}`
: "离线"}
</span> </span>
</div> </div>
</div> </div>

View File

@@ -42,13 +42,15 @@ export const NodeListItem = ({ node, enableSwap }: NodeListItemProps) => {
<div className="text-base font-bold">{node.name}</div> <div className="text-base font-bold">{node.name}</div>
<Tag className="text-xs" tags={tagList} /> <Tag className="text-xs" tags={tagList} />
<div className="flex text-xs"> <div className="flex text-xs">
<span className="text-secondary-foreground"></span> <span className="text-secondary-foreground">
<div className="flex items-center gap-1">{expired_at}</div> {expired_at}
</span>
</div> </div>
<div className="flex text-xs"> <div className="flex text-xs">
<span className="text-secondary-foreground">线</span> <span className="text-secondary-foreground">
<span> {isOnline && stats
{isOnline && stats ? formatUptime(stats.uptime) : "离线"} ? `在线:${formatUptime(stats.uptime)}`
: "离线"}
</span> </span>
</div> </div>
</div> </div>

View File

@@ -48,7 +48,7 @@ export const CustomTooltip = ({
if (series?.tooltipFormatter) { if (series?.tooltipFormatter) {
value = series.tooltipFormatter(value, item.payload); value = series.tooltipFormatter(value, item.payload);
} else if (typeof value === "number") { } else if (typeof value === "number") {
value = `${value.toFixed(0)}ms`; value = `${value.toFixed(0)}`;
} else { } else {
value = value?.toString() || "-"; value = value?.toString() || "-";
} }