enh: ENABLE_ADMIN_ANALYTICS
This commit is contained in:
@@ -275,6 +275,7 @@ type Config = {
|
||||
enable_image_generation: boolean;
|
||||
enable_admin_export: boolean;
|
||||
enable_admin_chat_access: boolean;
|
||||
enable_admin_analytics: boolean;
|
||||
enable_community_sharing: boolean;
|
||||
enable_memories: boolean;
|
||||
enable_autocomplete_generation: boolean;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { onMount, getContext } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
import { WEBUI_NAME, mobile, showSidebar, user } from '$lib/stores';
|
||||
import { WEBUI_NAME, config, mobile, showSidebar, user } from '$lib/stores';
|
||||
import { page } from '$app/stores';
|
||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||
|
||||
@@ -66,12 +66,14 @@
|
||||
href="/admin">{$i18n.t('Users')}</a
|
||||
>
|
||||
|
||||
{#if $config?.features.enable_admin_analytics ?? true}
|
||||
<a
|
||||
class="min-w-fit p-1.5 {$page.url.pathname.includes('/admin/analytics')
|
||||
? ''
|
||||
: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'} transition"
|
||||
href="/admin/analytics">{$i18n.t('Analytics')}</a
|
||||
>
|
||||
{/if}
|
||||
|
||||
<a
|
||||
class="min-w-fit p-1.5 {$page.url.pathname.includes('/admin/evaluations')
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { config } from '$lib/stores';
|
||||
import Analytics from '$lib/components/admin/Analytics.svelte';
|
||||
|
||||
onMount(() => {
|
||||
if (!($config?.features.enable_admin_analytics ?? true)) {
|
||||
goto('/admin');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<Analytics />
|
||||
{#if $config?.features.enable_admin_analytics ?? true}
|
||||
<Analytics />
|
||||
{/if}
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { config } from '$lib/stores';
|
||||
import Analytics from '$lib/components/admin/Analytics.svelte';
|
||||
|
||||
onMount(() => {
|
||||
if (!($config?.features.enable_admin_analytics ?? true)) {
|
||||
goto('/admin');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<Analytics />
|
||||
{#if $config?.features.enable_admin_analytics ?? true}
|
||||
<Analytics />
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user