feat: add localization and site settings
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user