调整保存时间

This commit is contained in:
2025-10-11 16:52:22 +08:00
parent 25db9ed1f3
commit cc6ae4bfed
3 changed files with 12 additions and 34 deletions

View File

@@ -658,37 +658,19 @@ export const Settings: React.FC<SettingsProps> = ({
{/* Cleanup Period */}
<div className="space-y-2">
<Label htmlFor="cleanup">{t('settings.generalOptions.chatRetention')}</Label>
<div className="flex items-center gap-3">
<Input
id="cleanup"
type="number"
min="1"
placeholder="30"
value={settings?.cleanupPeriodDays === -1 ? "" : (settings?.cleanupPeriodDays || "")}
value={settings?.cleanupPeriodDays || ""}
onChange={(e) => {
const value = e.target.value ? parseInt(e.target.value) : undefined;
updateSetting("cleanupPeriodDays", value);
}}
disabled={settings?.cleanupPeriodDays === -1}
className="flex-1"
/>
<div className="flex items-center gap-2">
<Switch
id="permanent-retention"
checked={settings?.cleanupPeriodDays === -1}
onCheckedChange={(checked) => {
updateSetting("cleanupPeriodDays", checked ? -1 : undefined);
}}
/>
<Label htmlFor="permanent-retention" className="text-sm cursor-pointer">
{t('settings.generalOptions.permanentRetention')}
</Label>
</div>
</div>
<p className="text-xs text-muted-foreground">
{settings?.cleanupPeriodDays === -1
? t('settings.generalOptions.chatRetentionPermanent')
: t('settings.generalOptions.chatRetentionDesc')}
{t('settings.generalOptions.chatRetentionDesc')}
</p>
</div>

View File

@@ -426,8 +426,6 @@
"verboseOutputDesc": "Show full bash and command outputs",
"chatRetention": "Chat Transcript Retention (days)",
"chatRetentionDesc": "How long to retain chat transcripts locally (default: 30 days)",
"chatRetentionPermanent": "Permanent retention enabled, chat records will not be automatically deleted",
"permanentRetention": "Permanent Retention",
"claudeCodeInstallation": "Claude Code Installation",
"choosePreferredInstallation": "Choose your preferred Claude Code installation.",
"loadingAvailableInstallations": "Loading available installations...",

View File

@@ -413,8 +413,6 @@
"verboseOutputDesc": "显示完整的 bash 和命令输出",
"chatRetention": "聊天记录保留期 (天)",
"chatRetentionDesc": "本地保留聊天记录的时长默认30 天)",
"chatRetentionPermanent": "已启用永久保存,聊天记录将不会被自动删除",
"permanentRetention": "永久保存",
"claudeCodeInstallation": "Claude Code 安装",
"choosePreferredInstallation": "选择您偏好的 Claude Code 安装。",
"loadingAvailableInstallations": "正在加载可用安装...",