feat: add localization and site settings
This commit is contained in:
@@ -14,6 +14,7 @@ export function SoftwareVersionForm({ softwareId }: { softwareId: string }) {
|
||||
const router = useRouter();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [downloadType, setDownloadType] = useState("local");
|
||||
const [wowVersion, setWowVersion] = useState<"1.18" | "1.17">("1.18");
|
||||
const [uploadedFilePath, setUploadedFilePath] = useState("");
|
||||
const [fileSize, setFileSize] = useState(0);
|
||||
const [uploading, setUploading] = useState(false);
|
||||
@@ -57,12 +58,14 @@ export function SoftwareVersionForm({ softwareId }: { softwareId: string }) {
|
||||
version: fd.get("version"),
|
||||
versionCode: Number(fd.get("versionCode")),
|
||||
changelog: fd.get("changelog"),
|
||||
changelogEn: fd.get("changelogEn"),
|
||||
downloadType,
|
||||
filePath: downloadType === "local" ? uploadedFilePath : null,
|
||||
externalUrl: downloadType === "url" ? fd.get("externalUrl") : null,
|
||||
fileSize,
|
||||
forceUpdate: fd.get("forceUpdate") === "on",
|
||||
minVersion: fd.get("minVersion") || null,
|
||||
wowVersion,
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -82,7 +85,7 @@ export function SoftwareVersionForm({ softwareId }: { softwareId: string }) {
|
||||
<CardHeader><CardTitle>版本信息</CardTitle></CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={handleSubmit} className="space-y-6">
|
||||
<div className="grid gap-4 md:grid-cols-2">
|
||||
<div className="grid gap-4 md:grid-cols-3">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="version">版本号 *</Label>
|
||||
<Input id="version" name="version" required placeholder="1.0.0" />
|
||||
@@ -91,6 +94,28 @@ export function SoftwareVersionForm({ softwareId }: { softwareId: string }) {
|
||||
<Label htmlFor="versionCode">版本代码 (整数) *</Label>
|
||||
<Input id="versionCode" name="versionCode" type="number" required placeholder="100" />
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label>WoW 版本 *</Label>
|
||||
<div className="inline-flex w-full rounded-md border bg-muted/40 p-0.5">
|
||||
{(["1.18", "1.17"] as const).map((v) => (
|
||||
<button
|
||||
key={v}
|
||||
type="button"
|
||||
onClick={() => setWowVersion(v)}
|
||||
className={`flex-1 rounded px-3 py-1.5 text-sm font-medium transition-colors ${
|
||||
v === wowVersion
|
||||
? "bg-background shadow-sm"
|
||||
: "text-muted-foreground hover:text-foreground"
|
||||
}`}
|
||||
>
|
||||
{v}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
同一启动器的两个 WoW 客户端发行渠道独立维护
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
@@ -98,9 +123,28 @@ export function SoftwareVersionForm({ softwareId }: { softwareId: string }) {
|
||||
<Input id="minVersion" name="minVersion" placeholder="0.9.0(可选,低于此版本需升级)" />
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="changelog">更新日志</Label>
|
||||
<Textarea id="changelog" name="changelog" rows={6} placeholder="- 新增xxx功能 - 修复xxx问题" />
|
||||
<div className="grid gap-4 md:grid-cols-2">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="changelog">更新日志(中文)</Label>
|
||||
<Textarea
|
||||
id="changelog"
|
||||
name="changelog"
|
||||
rows={6}
|
||||
placeholder="- 新增xxx功能 - 修复xxx问题"
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="changelogEn">Changelog (English)</Label>
|
||||
<Textarea
|
||||
id="changelogEn"
|
||||
name="changelogEn"
|
||||
rows={6}
|
||||
placeholder="- Added xxx feature - Fixed xxx issue"
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
英文用户访问时显示;为空则回退到中文。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="space-y-4">
|
||||
|
||||
Reference in New Issue
Block a user