feat(setttings): support auto launch config (#415)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Haze <hazeone@users.noreply.github.com>
This commit is contained in:
Haze
2026-03-11 18:41:18 +08:00
committed by GitHub
Unverified
parent baa551b30c
commit 53a51642ce
14 changed files with 275 additions and 7 deletions

View File

@@ -2,13 +2,15 @@
"title": "Settings",
"subtitle": "Configure your ClawX experience",
"appearance": {
"title": "Appearance",
"title": "General",
"description": "Customize the look and feel",
"theme": "Theme",
"light": "Light",
"dark": "Dark",
"system": "System",
"language": "Language"
"language": "Language",
"launchAtStartup": "Launch at system startup",
"launchAtStartupDesc": "Automatically launch ClawX when you log in"
},
"aiProviders": {
"title": "AI Providers",

View File

@@ -2,13 +2,15 @@
"title": "設定",
"subtitle": "ClawX の体験をカスタマイズ",
"appearance": {
"title": "外観",
"title": "通用",
"description": "外観とスタイルをカスタマイズ",
"theme": "テーマ",
"light": "ライト",
"dark": "ダーク",
"system": "システム",
"language": "言語"
"language": "言語",
"launchAtStartup": "システム起動時に自動起動",
"launchAtStartupDesc": "ログイン時に ClawX を自動的に起動します"
},
"aiProviders": {
"title": "AI プロバイダー",

View File

@@ -2,13 +2,15 @@
"title": "设置",
"subtitle": "配置您的 ClawX 体验",
"appearance": {
"title": "外观",
"title": "通用",
"description": "自定义外观和风格",
"theme": "主题",
"light": "浅色",
"dark": "深色",
"system": "跟随系统",
"language": "语言"
"language": "语言",
"launchAtStartup": "开机自动启动",
"launchAtStartupDesc": "登录系统后自动启动 ClawX"
},
"aiProviders": {
"title": "AI 模型提供商",

View File

@@ -53,6 +53,8 @@ export function Settings() {
setTheme,
language,
setLanguage,
launchAtStartup,
setLaunchAtStartup,
gatewayAutoStart,
setGatewayAutoStart,
proxyEnabled,
@@ -435,6 +437,18 @@ export function Settings() {
))}
</div>
</div>
<div className="flex items-center justify-between">
<div>
<Label className="text-[15px] font-medium text-foreground/80">{t('appearance.launchAtStartup')}</Label>
<p className="text-[13px] text-muted-foreground mt-1">
{t('appearance.launchAtStartupDesc')}
</p>
</div>
<Switch
checked={launchAtStartup}
onCheckedChange={setLaunchAtStartup}
/>
</div>
</div>
</div>

View File

@@ -119,7 +119,13 @@ export const useSettingsStore = create<SettingsState>()(
}).catch(() => { });
},
setStartMinimized: (startMinimized) => set({ startMinimized }),
setLaunchAtStartup: (launchAtStartup) => set({ launchAtStartup }),
setLaunchAtStartup: (launchAtStartup) => {
set({ launchAtStartup });
void hostApiFetch('/api/settings/launchAtStartup', {
method: 'PUT',
body: JSON.stringify({ value: launchAtStartup }),
}).catch(() => { });
},
setTelemetryEnabled: (telemetryEnabled) => {
set({ telemetryEnabled });
void hostApiFetch('/api/settings/telemetryEnabled', {