feat: add localization and site settings

This commit is contained in:
rucky
2026-05-12 09:58:25 +08:00
parent 9dc6c0dcce
commit fa7aedb8e7
67 changed files with 5221 additions and 888 deletions

View File

@@ -86,35 +86,35 @@ export default async function AdminSoftwarePage() {
</Button>
</div>
<div className="grid gap-4 md:grid-cols-3">
<Card>
<CardHeader className="pb-2">
<CardDescription></CardDescription>
</CardHeader>
<CardContent>
<p className="text-2xl font-bold">
{item.latestVersion
? `v${item.latestVersion.version}`
: "未发布"}
</p>
</CardContent>
</Card>
<Card>
<CardHeader className="pb-2">
<CardDescription></CardDescription>
</CardHeader>
<CardContent>
<p className="text-2xl font-bold">{item.versions.length}</p>
</CardContent>
</Card>
<Card>
<CardHeader className="pb-2">
<CardDescription></CardDescription>
</CardHeader>
<CardContent>
<p className="text-2xl font-bold">{item.totalDownloads}</p>
</CardContent>
</Card>
<div className="grid gap-4 md:grid-cols-2">
{(["1.18", "1.17"] as const).map((wv) => {
const latest = item.versions.find(
(v) => v.isLatest && v.wowVersion === wv
);
const total = item.versions.filter(
(v) => v.wowVersion === wv
).length;
const downloads = item.versions
.filter((v) => v.wowVersion === wv)
.reduce((s, v) => s + v.downloadCount, 0);
return (
<Card key={wv} className="border-amber-500/20">
<CardHeader className="pb-2">
<CardDescription className="flex items-center gap-2">
<span>WoW {wv}</span>
<span className="text-xs text-muted-foreground/70">
({total} · {downloads} )
</span>
</CardDescription>
</CardHeader>
<CardContent>
<p className="text-2xl font-bold">
{latest ? `v${latest.version}` : "未发布"}
</p>
</CardContent>
</Card>
);
})}
</div>
<Card>