diff --git a/cptr/frontend/src/app.css b/cptr/frontend/src/app.css index 64a0846..10a7843 100644 --- a/cptr/frontend/src/app.css +++ b/cptr/frontend/src/app.css @@ -90,6 +90,13 @@ display: none; } +.scrollbar-hover::-webkit-scrollbar-thumb { + visibility: hidden; +} +.scrollbar-hover:hover::-webkit-scrollbar-thumb { + visibility: visible; +} + /* CodeMirror - match Open WebUI */ .cm-editor { height: 100%; diff --git a/cptr/frontend/src/lib/components/Settings/General.svelte b/cptr/frontend/src/lib/components/Settings/General.svelte index 9c9d3eb..6634def 100644 --- a/cptr/frontend/src/lib/components/Settings/General.svelte +++ b/cptr/frontend/src/lib/components/Settings/General.svelte @@ -16,27 +16,33 @@ // ── Webhook URL ───────────────────────────────────────────── let webhookUrl = $state(''); - let webhookLoading = $state(false); + let webhookUrlOriginal = $state(''); + let saving = $state(false); + + let dirty = $derived(webhookUrl.trim() !== webhookUrlOriginal); onMount(async () => { try { const data = await fetchJSON<{ config: Record }>('/api/admin/config/notifications'); - webhookUrl = data.config?.['notifications.webhook_url'] || ''; + const url = data.config?.['notifications.webhook_url'] || ''; + webhookUrl = url; + webhookUrlOriginal = url; } catch {} }); - async function saveWebhookUrl() { - webhookLoading = true; + async function save() { + saving = true; try { await fetchJSON('/api/admin/config', { method: 'PUT', body: JSON.stringify({ config: { 'notifications.webhook_url': webhookUrl.trim() || null } }) }); - toast.success($t('general.webhookUrlSaved')); + webhookUrlOriginal = webhookUrl.trim(); + toast.success($t('settings.saved')); } catch { toast.error($t('general.webhookUrlSaveFailed')); } finally { - webhookLoading = false; + saving = false; } } @@ -57,117 +63,114 @@ } -
-

{$t('general.title')}

+
+
+

{$t('general.title')}

-

{$t('general.theme')}

-
- {#each [{ value: 'light' as Theme, label: $t('general.light'), icon: 'sun-light' }, { value: 'dark' as Theme, label: $t('general.dark'), icon: 'half-moon' }, { value: 'system' as Theme, label: $t('general.system'), icon: 'monitor' }] as opt} - - {/each} -
+

{$t('general.theme')}

+
+ {#each [{ value: 'light' as Theme, label: $t('general.light'), icon: 'sun-light' }, { value: 'dark' as Theme, label: $t('general.dark'), icon: 'half-moon' }, { value: 'system' as Theme, label: $t('general.system'), icon: 'monitor' }] as opt} + + {/each} +
-

{$t('general.language')}

- +

{$t('general.language')}

+ - -

{$t('general.notifications')}

+ +

{$t('general.notifications')}

-
- - -

- {$t('general.browserNotificationsDesc')} -

- - - - - -
-