fix(settings): restore the settings-database buttons and unstack the backup options
The Settings -> Database panel had lost every action on the settings database except "Open folder", which launches Windows Explorer — where a .db cannot be selected at all, so double-clicking it only asks which program should open it. The handlers were still there, just no longer rendered; New / Open existing / Save a copy / Rename / Reset are back, along with the restart banner (the DB pointer is only read at startup). The backup block put the rotation field and three checkboxes on one flex row inside max-w-xl. That fitted until "keep every backup" arrived with its two-line hint, after which every label wrapped into an unreadable sliver. The options are stacked now, and keep-all sits under the option it depends on.
This commit is contained in:
@@ -4311,7 +4311,7 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
title={t('sec.backup')}
|
||||
hint={mysqlCfg.enabled ? t('bk.hintMysql') : t('bk.hint')}
|
||||
/>
|
||||
<div className="space-y-4 max-w-xl">
|
||||
<div className="space-y-5 max-w-2xl">
|
||||
<label className="flex items-center gap-2 text-sm cursor-pointer">
|
||||
<Checkbox
|
||||
checked={!!backupCfg.enabled}
|
||||
@@ -4352,7 +4352,6 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-end gap-3">
|
||||
<div className="space-y-1.5">
|
||||
<Label className="text-xs text-muted-foreground">{t('bk.rotation')}</Label>
|
||||
<Input
|
||||
@@ -4367,6 +4366,12 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Stacked, not one flex row: these labels are full sentences and the
|
||||
"keep every backup" hint is two lines — side by side they wrapped
|
||||
into unreadable slivers. It also puts keep-all under the option it
|
||||
depends on rather than beside it. */}
|
||||
<div className="space-y-2.5">
|
||||
<label className="flex items-center gap-2 text-sm cursor-pointer">
|
||||
<Checkbox
|
||||
checked={!!backupCfg.zip}
|
||||
@@ -4382,7 +4387,7 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
<span>{t('bk.everyExit')}</span>
|
||||
</label>
|
||||
{!!(backupCfg as any).every_exit && (
|
||||
<label className="flex items-start gap-2 text-sm cursor-pointer pl-6 pb-2">
|
||||
<label className="flex items-start gap-2 text-sm cursor-pointer pl-6">
|
||||
<Checkbox
|
||||
className="mt-0.5"
|
||||
checked={!!(backupCfg as any).keep_all}
|
||||
@@ -4390,7 +4395,7 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
/>
|
||||
<span>
|
||||
{t('bk.keepAll')}
|
||||
<span className="block text-xs text-muted-foreground mt-0.5">{t('bk.keepAllHint')}</span>
|
||||
<span className="block text-xs text-muted-foreground mt-0.5 leading-relaxed">{t('bk.keepAllHint')}</span>
|
||||
</span>
|
||||
</label>
|
||||
)}
|
||||
@@ -5205,8 +5210,23 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan
|
||||
</div>
|
||||
<p className="text-[11px] text-muted-foreground">{t('db.appDbHint')}</p>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Button variant="outline" size="sm" onClick={createNew}><Plus className="size-3.5" /> {t('db.newDb')}</Button>
|
||||
<Button variant="outline" size="sm" onClick={openExisting}><Database className="size-3.5" /> {t('db.openExisting')}</Button>
|
||||
<Button variant="outline" size="sm" onClick={saveCopy}><Copy className="size-3.5" /> {t('db.saveCopy')}</Button>
|
||||
<Button variant="outline" size="sm" onClick={renameDb} title={t('db.renameTip')}><Pencil className="size-3.5" /> {t('db.rename')}</Button>
|
||||
<Button variant="outline" size="sm" onClick={revealFolder}><FolderOpen className="size-3.5" /> {t('db.openFolder')}</Button>
|
||||
{dbSettings.is_custom && <Button variant="ghost" size="sm" onClick={resetDefault}>{t('db.resetDefault')}</Button>}
|
||||
</div>
|
||||
{/* The DB pointer is only read at startup, so offer the restart inline. */}
|
||||
{dbMsg && (
|
||||
<div className="text-[11px] text-success space-y-1 pt-1">
|
||||
<div>{t('db.savedRestart')} <span className="font-mono break-all">{dbMsg}</span></div>
|
||||
<Button size="sm" className="h-7" onClick={() => RestartApp().catch((e: any) => setErr(String(e?.message ?? e)))}>
|
||||
<Power className="size-3.5" /> {t('db.restartNow')}
|
||||
</Button>
|
||||
<span className="ml-2 text-muted-foreground">{t('db.restartHint')}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Logbook (QSOs) — this profile: default SQLite file, a dedicated file, or MySQL. */}
|
||||
|
||||
Reference in New Issue
Block a user