From 557fb162c33ddc8f15cf4d32a7291e333ddcf5d7 Mon Sep 17 00:00:00 2001 From: rouggy Date: Fri, 24 Jul 2026 18:30:05 +0200 Subject: [PATCH] =?UTF-8?q?ui:=20tidy=20Database=20panel=20=E2=80=94=20set?= =?UTF-8?q?tings=20shows=20only=20Open-folder;=20DB=20actions=20on=20logbo?= =?UTF-8?q?ok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per feedback: New/Open/Rename/Save-copy/Reset made no sense under the settings database — moved the meaningful DB actions to the logbook (New database / Open existing / Rename-relocate). The settings section now shows just its path + Open folder. Also fixed the "Logbook switched…" confirmation rendering twice (dropped the duplicate render in the SQLite block; kept the shared one). The unused settings-db handlers/bindings stay for a later re-add. --- frontend/src/components/SettingsModal.tsx | 43 +++++++++-------------- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/frontend/src/components/SettingsModal.tsx b/frontend/src/components/SettingsModal.tsx index 23ca27e..77dcd5e 100644 --- a/frontend/src/components/SettingsModal.tsx +++ b/frontend/src/components/SettingsModal.tsx @@ -4326,9 +4326,10 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan .then(async () => { setMysqlField({ enabled: false, sqlite_path: '' }); setRestartMsg(t('db.switchedSqlite')); await refreshBackend(); }) .catch((e: any) => setErr(String(e?.message ?? e))); } - // Route THIS profile's logbook to its own SQLite file (config stays in - // opslog.db). db.Open creates+migrates the file if it's new. Pick a name/place. - async function pickSeparateSqlite() { + // Point THIS profile's logbook at a SQLite file (settings stay in the + // settings db). A NEW name is created + migrated empty; an existing file is + // opened with its QSOs. + async function newLogbook() { try { const p = await PickSaveDatabase(); if (!p) return; @@ -4338,6 +4339,16 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan await refreshBackend(); } catch (e: any) { setErr(String(e?.message ?? e)); } } + async function openLogbook() { + try { + const p = await PickOpenDatabase(); + if (!p) return; + await SaveMySQLSettings({ ...mysqlCfg, enabled: false, sqlite_path: p } as any); + setMysqlField({ enabled: false, sqlite_path: p }); + setRestartMsg(t('db.switchedSqliteFile')); + await refreshBackend(); + } catch (e: any) { setErr(String(e?.message ?? e)); } + } function connectMysql() { SaveMySQLSettings(mysqlCfg as any) .then(async () => { setRestartMsg(t('db.switchedMysql')); await refreshBackend(); }) @@ -4360,29 +4371,7 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan

{t('db.appDbHint')}

- - - - - {dbSettings.is_custom && }
- {dbMsg && ( -
-
- -
-
{t('db.savedRestart')}
-
{dbMsg}
-
-
-
- - {t('db.restartHint')} -
-
- )} {/* Logbook (QSOs) — this profile: default SQLite file, a dedicated file, or MySQL. */} @@ -4433,11 +4422,11 @@ export function SettingsModal({ onClose, onSaved, initialSection, onMainPaneChan

{t('db.logbookFileHint')}

- + + {mysqlCfg.sqlite_path && }
- {restartMsg &&
{restartMsg}
} )}