{ // console.log('submit'); await setDefaultModels(localStorage.token, defaultModelId); await updateUserPermissions(localStorage.token, permissions); await updateModelFilterConfig(localStorage.token, whitelistEnabled, whitelistModels); saveHandler(); await config.set(await getBackendConfig()); }} >
{$i18n.t('User Permissions')}
{$i18n.t('Allow Chat Deletion')}
{ permissions.chat.deletion = !(permissions?.chat?.deletion ?? true); }} type="button" > {#if permissions?.chat?.deletion ?? true}
{$i18n.t('Allow')}
{:else}
{$i18n.t("Don't Allow")}
{/if}
{$i18n.t('Manage Models')}
{$i18n.t('Default Model')}
{$i18n.t('Select a model')}
{#each $models.filter((model) => model.id) as model}
{model.name}
{/each}
{$i18n.t('Model Whitelisting')}
{#if whitelistEnabled}
{#each whitelistModels as modelId, modelIdx}
{$i18n.t('Select a model')}
{#each $models.filter((model) => model.id) as model}
{model.name}
{/each}
{#if modelIdx === 0}
{ if (whitelistModels.at(-1) !== '') { whitelistModels = [...whitelistModels, '']; } }} >
{:else}
{ whitelistModels.splice(modelIdx, 1); whitelistModels = whitelistModels; }} >
{/if}
{/each}
{whitelistModels.length} {$i18n.t('Model(s) Whitelisted')}
{/if}
{$i18n.t('Save')}