mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac/fix: codeblock
This commit is contained in:
parent
c744ae0d63
commit
0e5320c39e
1 changed files with 8 additions and 12 deletions
|
|
@ -167,9 +167,9 @@
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stdout.startsWith(`${line}\n`)) {
|
if (stdout.includes(`${line}\n`)) {
|
||||||
stdout = stdout.replace(`${line}\n`, ``);
|
stdout = stdout.replace(`${line}\n`, ``);
|
||||||
} else if (stdout.startsWith(`${line}`)) {
|
} else if (stdout.includes(`${line}`)) {
|
||||||
stdout = stdout.replace(`${line}`, ``);
|
stdout = stdout.replace(`${line}`, ``);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -196,9 +196,9 @@
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.startsWith(`${line}\n`)) {
|
if (result.includes(`${line}\n`)) {
|
||||||
result = result.replace(`${line}\n`, ``);
|
result = result.replace(`${line}\n`, ``);
|
||||||
} else if (result.startsWith(`${line}`)) {
|
} else if (result.includes(`${line}`)) {
|
||||||
result = result.replace(`${line}`, ``);
|
result = result.replace(`${line}`, ``);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -275,9 +275,9 @@
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stdout.startsWith(`${line}\n`)) {
|
if (stdout.includes(`${line}\n`)) {
|
||||||
stdout = stdout.replace(`${line}\n`, ``);
|
stdout = stdout.replace(`${line}\n`, ``);
|
||||||
} else if (stdout.startsWith(`${line}`)) {
|
} else if (stdout.includes(`${line}`)) {
|
||||||
stdout = stdout.replace(`${line}`, ``);
|
stdout = stdout.replace(`${line}`, ``);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -454,7 +454,7 @@
|
||||||
|
|
||||||
{#if ($config?.features?.enable_code_execution ?? true) && (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}
|
{#if executing}
|
||||||
<div class="run-code-button bg-none border-none p-1 cursor-not-allowed">
|
<div class="run-code-button bg-none border-none p-0.5 cursor-not-allowed">
|
||||||
{$i18n.t('Running')}
|
{$i18n.t('Running')}
|
||||||
</div>
|
</div>
|
||||||
{:else if run}
|
{:else if run}
|
||||||
|
|
@ -466,10 +466,6 @@
|
||||||
executePython(code);
|
executePython(code);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div class=" -translate-y-[0.5px]">
|
|
||||||
<CommandLine className="size-3" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{$i18n.t('Run')}
|
{$i18n.t('Run')}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -541,7 +537,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
<div
|
<div
|
||||||
class="bg-gray-50 dark:bg-black dark:text-white rounded-b-3xl! pb-3 px-4 flex flex-col gap-2 text-xs"
|
class="bg-white dark:bg-black dark:text-white rounded-b-3xl! pb-3 px-4 flex flex-col gap-2 text-xs"
|
||||||
>
|
>
|
||||||
<span class="text-gray-500 italic">
|
<span class="text-gray-500 italic">
|
||||||
{$i18n.t('{{COUNT}} hidden lines', {
|
{$i18n.t('{{COUNT}} hidden lines', {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue