From 6f3f5ff9224d304cfe7865b11072f8bf22b74927 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 13 Oct 2024 04:36:27 -0700 Subject: [PATCH] refac: styling --- .../components/admin/Settings/Users.svelte | 135 +++--------------- 1 file changed, 22 insertions(+), 113 deletions(-) diff --git a/src/lib/components/admin/Settings/Users.svelte b/src/lib/components/admin/Settings/Users.svelte index b23705c8a..e806ea757 100644 --- a/src/lib/components/admin/Settings/Users.svelte +++ b/src/lib/components/admin/Settings/Users.svelte @@ -24,9 +24,17 @@ } }; + let chatDeletion = true; + let chatEdit = true; + let chatTemporary = true; + onMount(async () => { permissions = await getUserPermissions(localStorage.token); + chatDeletion = permissions?.chat?.deletion ?? true; + chatEdit = permissions?.chat?.editing ?? true; + chatTemporary = permissions?.chat?.temporary ?? true; + const res = await getModelFilterConfig(localStorage.token); if (res) { whitelistEnabled = res.enabled; @@ -43,7 +51,13 @@ // console.log('submit'); await setDefaultModels(localStorage.token, defaultModelId); - await updateUserPermissions(localStorage.token, permissions); + await updateUserPermissions(localStorage.token, { + chat: { + deletion: chatDeletion, + editing: chatEdit, + temporary: chatTemporary + } + }); await updateModelFilterConfig(localStorage.token, whitelistEnabled, whitelistModels); saveHandler(); @@ -54,127 +68,22 @@
{$i18n.t('User Permissions')}
-
+
{$i18n.t('Allow Chat Deletion')}
- +
-
+
{$i18n.t('Allow Chat Editing')}
- +
-
+
{$i18n.t('Allow Temporary Chat')}
- +
@@ -210,7 +119,7 @@
-
+
{$i18n.t('Model Whitelisting')}