[fix] update setup

This commit is contained in:
2025-11-08 23:57:26 +08:00
parent cd19faba47
commit 5e663dc79e
20 changed files with 1064 additions and 626 deletions

View File

@@ -24,78 +24,77 @@ export default function Page() {
return (
<section className="flex flex-col gap-4 overflow-hidden">
<div className="flex flex-col items-start gap-4 pt-2 pb-1">
<div className="space-y-2">
<div className="flex items-center gap-2">
<p className="text-sm">{app.state.version}</p>
{app.state.hasUpdate && app.state.latestVersion && (
<Chip size="sm" color="success" variant="flat">
{app.state.latestVersion}
</Chip>
)}
<div className="space-y-2">
<div className="flex items-center gap-2">
<p className="text-sm">{app.state.version}</p>
{app.state.hasUpdate && app.state.latestVersion && (
<Chip size="sm" color="success" variant="flat">
{app.state.latestVersion}
</Chip>
)}
</div>
{/* <p className="text-sm">是否有更新:{app.state.hasUpdate ? "有" : "无"}</p> */}
{/* <p className="text-sm">是否使用镜像源:{app.state.useMirror ? "是" : "否"}</p> */}
</div>
{/* <p className="text-sm">是否有更新:{app.state.hasUpdate ? "有" : "无"}</p> */}
{/* <p className="text-sm">是否使用镜像源:{app.state.useMirror ? "是" : "否"}</p> */}
</div>
<div className="w-full pt-4 border-t border-zinc-200 dark:border-zinc-800">
<h3 className="mb-3 text-sm font-semibold"></h3>
<div className="mb-3 space-y-3">
{/* <Switch
<div className="w-full pt-4 border-t border-zinc-200 dark:border-zinc-800">
<h3 className="mb-3 text-sm font-semibold"></h3>
<div className="mb-3 space-y-3">
{/* <Switch
isSelected={app.state.useMirror}
size="sm"
onChange={(e) => app.setUseMirror(e.target.checked)}
>
使用镜像源
</Switch> */}
{/* <p className="text-xs text-zinc-500">
{/* <p className="text-xs text-zinc-500">
{app.state.useMirror
? "使用自建更新服务检查更新"
: "使用 GitHub Release 检查更新"}
</p> */}
<Switch
isSelected={app.state.includePrerelease}
size="sm"
onChange={(e) => app.setIncludePrerelease(e.target.checked)}
>
</Switch>
<p className="text-xs text-zinc-500">
{app.state.includePrerelease
? "检查更新时会包含预发布版本beta、alpha等"
: "仅检查正式版本"}
</p>
<Switch
isSelected={app.state.includePrerelease}
size="sm"
onChange={(e) => app.setIncludePrerelease(e.target.checked)}
>
</Switch>
<p className="text-xs text-zinc-500">
{app.state.includePrerelease
? "检查更新时会包含预发布版本beta、alpha等"
: "仅检查正式版本"}
</p>
</div>
<UpdateChecker
customEndpoint={customEndpoint || undefined}
includePrerelease={app.state.includePrerelease}
/>
</div>
<UpdateChecker
useMirror={app.state.useMirror}
customEndpoint={customEndpoint || undefined}
includePrerelease={app.state.includePrerelease}
/>
</div>
<div className="flex flex-col w-full pt-4 space-y-3 border-t border-zinc-200 dark:border-zinc-800">
<h3 className="mb-3 text-sm font-semibold"></h3>
<Switch
isSelected={app.state.autoStart}
size="sm"
onChange={(e) => app.setAutoStart(e.target.checked)}
>
</Switch>
<Switch
isSelected={app.state.startHidden}
size="sm"
onChange={(e) => app.setStartHidden(e.target.checked)}
>
</Switch>
<Switch
isSelected={app.state.hiddenOnClose}
size="sm"
onChange={(e) => app.setHiddenOnClose(e.target.checked)}
>
</Switch>
</div>
<div className="flex flex-col w-full pt-4 space-y-3 border-t border-zinc-200 dark:border-zinc-800">
<h3 className="mb-3 text-sm font-semibold"></h3>
<Switch
isSelected={app.state.autoStart}
size="sm"
onChange={(e) => app.setAutoStart(e.target.checked)}
>
</Switch>
<Switch
isSelected={app.state.startHidden}
size="sm"
onChange={(e) => app.setStartHidden(e.target.checked)}
>
</Switch>
<Switch
isSelected={app.state.hiddenOnClose}
size="sm"
onChange={(e) => app.setHiddenOnClose(e.target.checked)}
>
</Switch>
</div>
</div>
</section>
)