enh: channels enable/disable option

This commit is contained in:
Timothy Jaeryang Baek
2024-12-22 21:02:14 -07:00
parent 0d29f31846
commit cb3e01de8a
5 changed files with 27 additions and 3 deletions

View File

@@ -112,7 +112,7 @@
</div>
</div>
<div class=" flex w-full justify-between pr-2">
<div class=" flex w-full justify-between pr-2">
<div class=" self-center text-xs font-medium">{$i18n.t('Enable API Key Auth')}</div>
<Switch bind:state={adminConfig.ENABLE_API_KEY} />
@@ -180,6 +180,16 @@
/>
</div>
</div>
<hr class=" border-gray-50 dark:border-gray-850 my-2" />
<div class="pt-1 flex w-full justify-between pr-2">
<div class=" self-center text-sm font-medium">
{$i18n.t('Channels')} ({$i18n.t('Beta')})
</div>
<Switch bind:state={adminConfig.ENABLE_CHANNELS} />
</div>
</div>
{/if}

View File

@@ -18,7 +18,8 @@
currentChatPage,
temporaryChatEnabled,
channels,
socket
socket,
config
} from '$lib/stores';
import { onMount, getContext, tick, onDestroy } from 'svelte';
@@ -628,7 +629,7 @@
</div>
{/if}
{#if ($user.role === 'admin' || $channels.length > 0) && !search}
{#if $config?.features?.enable_channels && ($user.role === 'admin' || $channels.length > 0) && !search}
<Folder
className="px-2 mt-0.5"
name={$i18n.t('Channels')}