From 0df9573caae260cea22604cd153b1c50760e5c50 Mon Sep 17 00:00:00 2001 From: xpltd Date: Thu, 19 Mar 2026 06:19:46 -0500 Subject: [PATCH] Settings page: single Save, clean flow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One Save Settings button covers all configuration: - Welcome message - Default output formats (video/audio) - Privacy mode toggle + retention hours Below the save area, separated by dividers: - Manual Purge (immediate action, Sure? gate) - Change Password (immediate action, own button) Settings fields have subtle bottom borders for visual rhythm. No section headings — the flow reads naturally top-to-bottom. Removed redundant privacySaved ref and savePrivacy function. --- frontend/src/components/AdminPanel.vue | 211 ++++++++++++------------- 1 file changed, 100 insertions(+), 111 deletions(-) diff --git a/frontend/src/components/AdminPanel.vue b/frontend/src/components/AdminPanel.vue index ca673db..11d925e 100644 --- a/frontend/src/components/AdminPanel.vue +++ b/frontend/src/components/AdminPanel.vue @@ -23,7 +23,6 @@ const defaultAudioFormat = ref('auto') const settingsSaved = ref(false) const privacyMode = ref(false) const privacyRetentionHours = ref(24) -const privacySaved = ref(false) const purgeConfirming = ref(false) let purgeConfirmTimer: ReturnType | null = null @@ -67,30 +66,19 @@ async function switchTab(tab: typeof activeTab.value) { } } -async function saveSettings() { +async function saveAllSettings() { settingsSaved.value = false const ok = await store.updateSettings({ welcome_message: welcomeMessage.value, default_video_format: defaultVideoFormat.value, default_audio_format: defaultAudioFormat.value, - }) - if (ok) { - await configStore.loadConfig() - settingsSaved.value = true - setTimeout(() => { settingsSaved.value = false }, 3000) - } -} - -async function savePrivacy() { - privacySaved.value = false - const ok = await store.updateSettings({ privacy_mode: privacyMode.value, privacy_retention_hours: privacyRetentionHours.value, }) if (ok) { await configStore.loadConfig() - privacySaved.value = true - setTimeout(() => { privacySaved.value = false }, 3000) + settingsSaved.value = true + setTimeout(() => { settingsSaved.value = false }, 3000) } } @@ -271,10 +259,8 @@ function formatFilesize(bytes: number | null): string {
- -
-

Appearance & Defaults

- + +

Displayed above the URL input on the main page. Leave empty to hide.

@@ -287,7 +273,7 @@ function formatFilesize(bytes: number | null): string { >
-
+

When "Auto" is selected, files are converted to these formats instead of the native container.

@@ -313,20 +299,6 @@ function formatFilesize(bytes: number | null): string {
-
- - ✓ Saved -
-
- -
- - -
-

Privacy & Data

-
-
- - ✓ Saved + ✓ Saved
+

+ Settings are applied immediately but reset on server restart. +

+
-
- -

- Immediately clear all completed and failed downloads — removes - database records, files from disk, and orphaned sessions. - Active downloads are never affected. -

- -
-

{{ store.purgeResult.rows_deleted }} jobs removed

-

{{ store.purgeResult.files_deleted }} files deleted

-

{{ store.purgeResult.sessions_deleted }} sessions cleared

-

{{ store.purgeResult.active_skipped }} active jobs skipped

-
+
+ + +
+ +

+ Immediately clear all completed and failed downloads — removes + database records, files from disk, and orphaned sessions. + Active downloads are never affected. +

+ +
+

{{ store.purgeResult.rows_deleted }} jobs removed

+

{{ store.purgeResult.files_deleted }} files deleted

+

{{ store.purgeResult.sessions_deleted }} sessions cleared

+

{{ store.purgeResult.active_skipped }} active jobs skipped


- -
-

Security

- -
- -

Update the admin password. Takes effect immediately but resets on server restart.

-
- - - - - Passwords don't match - -
-
- - ✓ Password changed - {{ passwordError }} -
+
+ +

Takes effect immediately but resets on server restart.

+
+ + + + + Passwords don't match + +
+
+ + ✓ Password changed + {{ passwordError }}
- -

- All settings are applied immediately but reset on server restart. -

@@ -592,6 +561,26 @@ h3 { margin-bottom: var(--space-sm); } +.settings-form { + display: flex; + flex-direction: column; + gap: var(--space-lg); +} + +.settings-form .settings-field { + padding-bottom: var(--space-md); + border-bottom: 1px solid var(--color-border); +} + +.settings-form .settings-field:last-of-type { + border-bottom: none; + padding-bottom: 0; +} + +.settings-save-row { + padding-top: var(--space-sm); +} + .section-heading { font-size: var(--font-size-md); font-weight: 600;