refac
This commit is contained in:
@@ -740,6 +740,14 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="mb-2.5 flex w-full items-center justify-between pr-2">
|
||||
<div class=" self-center text-xs font-medium">
|
||||
{$i18n.t('Memories')} ({$i18n.t('Beta')})
|
||||
</div>
|
||||
|
||||
<Switch bind:state={adminConfig.ENABLE_MEMORIES} />
|
||||
</div>
|
||||
|
||||
<div class="mb-2.5 flex w-full items-center justify-between pr-2">
|
||||
<div class=" self-center text-xs font-medium">
|
||||
{$i18n.t('Notes')} ({$i18n.t('Beta')})
|
||||
@@ -758,7 +766,7 @@
|
||||
|
||||
<div class="mb-2.5 flex w-full items-center justify-between pr-2">
|
||||
<div class=" self-center text-xs font-medium">
|
||||
{$i18n.t('Calendar')} ({$i18n.t('Beta')})
|
||||
{$i18n.t('Calendar')}
|
||||
</div>
|
||||
|
||||
<Switch bind:state={adminConfig.ENABLE_CALENDAR} />
|
||||
@@ -766,10 +774,10 @@
|
||||
|
||||
<div class="mb-2.5 flex w-full items-center justify-between pr-2">
|
||||
<div class=" self-center text-xs font-medium">
|
||||
{$i18n.t('Memories')} ({$i18n.t('Beta')})
|
||||
{$i18n.t('Automations')}
|
||||
</div>
|
||||
|
||||
<Switch bind:state={adminConfig.ENABLE_MEMORIES} />
|
||||
<Switch bind:state={adminConfig.ENABLE_AUTOMATIONS} />
|
||||
</div>
|
||||
|
||||
<div class="mb-2.5 flex w-full items-center justify-between pr-2">
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
<div class=" self-center truncate">{$i18n.t('Settings')}</div>
|
||||
</button>
|
||||
|
||||
{#if $user?.role === 'admin' || $user?.permissions?.features?.automations}
|
||||
{#if $config?.features?.enable_automations && ($user?.role === 'admin' || $user?.permissions?.features?.automations)}
|
||||
<a
|
||||
href="/automations"
|
||||
draggable="false"
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
};
|
||||
|
||||
onMount(async () => {
|
||||
if ($user?.role !== 'admin' && !($user?.permissions?.features?.automations ?? false)) {
|
||||
if (!$config?.features?.enable_automations || ($user?.role !== 'admin' && !($user?.permissions?.features?.automations ?? false))) {
|
||||
goto('/');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { onMount, getContext } from 'svelte';
|
||||
|
||||
import { page } from '$app/stores';
|
||||
import { user, showSidebar } from '$lib/stores';
|
||||
import { user, showSidebar, config } from '$lib/stores';
|
||||
import { getAutomationById } from '$lib/apis/automations';
|
||||
|
||||
import AutomationEditor from '$lib/components/automations/AutomationEditor.svelte';
|
||||
@@ -18,7 +18,7 @@
|
||||
$: automationId = $page.params.id;
|
||||
|
||||
onMount(async () => {
|
||||
if ($user?.role !== 'admin' && !($user?.permissions?.features?.automations ?? false)) {
|
||||
if (!$config?.features?.enable_automations || ($user?.role !== 'admin' && !($user?.permissions?.features?.automations ?? false))) {
|
||||
goto('/');
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user