Merge branch 'main' into cloudflare

This commit is contained in:
hamster1963 2024-10-09 14:37:17 +08:00
commit bd21867c2c
2 changed files with 11 additions and 16 deletions

View File

@ -1,12 +1,6 @@
import { BackIcon } from "@/components/Icon"; import { BackIcon } from "@/components/Icon";
import { Loader } from "@/components/loading/Loader"; import { Loader } from "@/components/loading/Loader";
import { import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
export default function NetworkChartLoading() { export default function NetworkChartLoading() {
return ( return (
@ -15,15 +9,16 @@ export default function NetworkChartLoading() {
<div className="flex flex-1 flex-col justify-center gap-1 px-6 py-5"> <div className="flex flex-1 flex-col justify-center gap-1 px-6 py-5">
<CardTitle className="flex items-center gap-0.5 text-xl"> <CardTitle className="flex items-center gap-0.5 text-xl">
<BackIcon /> <BackIcon />
<Loader visible={true} /> <div className="aspect-auto h-[20px] w-24 bg-muted"></div>
</CardTitle> </CardTitle>
<CardDescription className="text-xs opacity-0"> <div className="mt-[2px] aspect-auto h-[14px] w-32 bg-muted"></div>
loading... </div>
</CardDescription> <div className="hidden pr-4 pt-4 sm:block">
<Loader visible={true} />
</div> </div>
</CardHeader> </CardHeader>
<CardContent className="px-2 sm:p-6"> <CardContent className="px-2 sm:p-6">
<div className="aspect-auto h-[250px] w-full flex-col items-center justify-center"></div> <div className="aspect-auto h-[250px] w-full"></div>
</CardContent> </CardContent>
</Card> </Card>
); );

View File

@ -88,13 +88,13 @@ export function formatRelativeTime(timestamp: number): string {
if (hours > 24) { if (hours > 24) {
const days = Math.floor(hours / 24); const days = Math.floor(hours / 24);
return `${days}天前`; return `${days}d`;
} else if (hours > 0) { } else if (hours > 0) {
return `${hours}小时前`; return `${hours}h`;
} else if (minutes >= 0) { } else if (minutes >= 0) {
return `${minutes}分钟前`; return `${minutes}m`;
} else { } else {
return "刚刚"; return "just now";
} }
} }