enh: enable_code_execution toggle

Co-Authored-By: recrudesce <6450799+recrudesce@users.noreply.github.com>
This commit is contained in:
Timothy Jaeryang Baek
2025-03-05 19:06:28 -08:00
co-authored by recrudesce
parent dce24225e0
commit 5e78a5c510
6 changed files with 28 additions and 3 deletions
+1 -1
View File
@@ -1937,7 +1937,7 @@
<PaneGroup direction="horizontal" class="w-full h-full">
<Pane defaultSize={50} class="h-full flex w-full relative">
{#if ($banners.length > 0 && !history.currentId && !$chatId && selectedModels.length <= 1) || ($config?.license_metadata?.type ?? null) === 'trial' || (($config?.license_metadata?.seats ?? null) !== null && $config?.user_count > $config?.license_metadata?.seats)}
{#if !history.currentId && !$chatId && selectedModels.length <= 1 && ($banners.length > 0 || ($config?.license_metadata?.type ?? null) === 'trial' || (($config?.license_metadata?.seats ?? null) !== null && $config?.user_count > $config?.license_metadata?.seats))}
<div class="absolute top-12 left-0 right-0 w-full z-30">
<div class=" flex flex-col gap-1 w-full">
{#if ($config?.license_metadata?.type ?? null) === 'trial'}
@@ -439,7 +439,7 @@
</div>
</button>
{#if lang.toLowerCase() === 'python' || lang.toLowerCase() === 'py' || (lang === '' && checkPythonCode(code))}
{#if ($config?.features?.enable_code_execution ?? true) && (lang.toLowerCase() === 'python' || lang.toLowerCase() === 'py' || (lang === '' && checkPythonCode(code)))}
{#if executing}
<div class="run-code-button bg-none border-none p-1 cursor-not-allowed">Running</div>
{:else if run}