refactor: 优化到期信息显示

This commit is contained in:
Montia37
2025-08-13 18:32:16 +08:00
parent f9209b9ecf
commit 874418ac47
3 changed files with 24 additions and 22 deletions

View File

@@ -35,7 +35,7 @@ export const NodeCard = ({ node }: NodeCardProps) => {
swapUsage,
diskUsage,
load,
daysLeft,
expired_at,
} = useNodeCommons(node);
const getProgressBarClass = (percentage: number) => {
@@ -166,13 +166,7 @@ export const NodeCard = ({ node }: NodeCardProps) => {
<div className="flex justify-between text-xs">
<div className="flex justify-between w-full">
<span className="text-secondary-foreground"></span>
<div className="flex items-center gap-1">
{daysLeft !== null && daysLeft > 36500
? "长期"
: node.expired_at
? new Date(node.expired_at).toLocaleDateString()
: "N/A"}
</div>
<div className="flex items-center gap-1">{expired_at}</div>
</div>
<div className="border-l border-border/60 mx-2"></div>
<div className="flex justify-between w-full">

View File

@@ -20,7 +20,7 @@ export const NodeListItem = ({ node }: NodeListItemProps) => {
swapUsage,
diskUsage,
load,
daysLeft,
expired_at,
} = useNodeCommons(node);
return (
@@ -40,13 +40,7 @@ export const NodeListItem = ({ node }: NodeListItemProps) => {
<div className="flex text-xs">
<div className="flex">
<span className="text-secondary-foreground"></span>
<div className="flex items-center gap-1">
{daysLeft !== null && daysLeft > 36500
? "长期"
: node.expired_at
? new Date(node.expired_at).toLocaleDateString()
: "N/A"}
</div>
<div className="flex items-center gap-1">{expired_at}</div>
</div>
<div className="border-l border-border/60 mx-2"></div>
<div className="flex">