[feat] auto start feature
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
"use client"
|
||||
import { useAppStore } from "@/store/app"
|
||||
import { Switch } from "@heroui/react"
|
||||
import { enable, isEnabled, disable } from "@tauri-apps/plugin-autostart"
|
||||
|
||||
export default function Page() {
|
||||
const app = useAppStore()
|
||||
@@ -8,9 +10,20 @@ export default function Page() {
|
||||
<div className="flex flex-col items-start gap-3 pt-2 pb-1">
|
||||
<p>版本号:{app.state.version}</p>
|
||||
<p>是否有更新:{app.state.hasUpdate ? "有" : "无"}</p>
|
||||
<p>初始化:{app.state.inited ? "是" : "否"}</p>
|
||||
<p>公告:{app.state.notice}</p>
|
||||
<p>是否使用镜像源:{app.state.useMirror ? "是" : "否"}</p>
|
||||
<Switch
|
||||
// checked={() => isEnabled()}
|
||||
size="sm"
|
||||
onChange={(e) => {
|
||||
if (e.target.checked) {
|
||||
enable()
|
||||
} else {
|
||||
disable()
|
||||
}
|
||||
}}
|
||||
>
|
||||
开机自启动
|
||||
</Switch>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -43,10 +43,11 @@ const SteamUsers = ({ className }: { className?: string }) => {
|
||||
src={user.avatar ? `data:image/png;base64,${user.avatar}` : "/logo_square.png"}
|
||||
alt="avatar"
|
||||
className="w-20 h-20 rounded-l-lg"
|
||||
draggable="false"
|
||||
/>
|
||||
<div className="flex flex-col flex-grow justify-center gap-2 p-0.5">
|
||||
<h3 className="text-xl font-semibold">{user.persona_name}</h3>
|
||||
<div className="flex gap-3">
|
||||
<div className="flex gap-2">
|
||||
<Chip size="sm" className="bg-zinc-200 dark:bg-zinc-800">
|
||||
{user.account_name}
|
||||
</Chip>
|
||||
|
||||
Reference in New Issue
Block a user