|
@@ -5,24 +5,25 @@
|
|
const i18n = getContext('i18n');
|
|
const i18n = getContext('i18n');
|
|
|
|
|
|
export let show = false;
|
|
export let show = false;
|
|
- export let code_execution = null;
|
|
|
|
|
|
+ export let codeExecution = null;
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<Modal size="lg" bind:show>
|
|
<Modal size="lg" bind:show>
|
|
<div>
|
|
<div>
|
|
<div class="flex justify-between dark:text-gray-300 px-5 pt-4 pb-2">
|
|
<div class="flex justify-between dark:text-gray-300 px-5 pt-4 pb-2">
|
|
<div class="text-lg font-medium self-center capitalize">
|
|
<div class="text-lg font-medium self-center capitalize">
|
|
- {#if code_execution?.status == 'OK'}
|
|
|
|
|
|
+ {#if codeExecution?.status == 'OK'}
|
|
✅ <!-- Checkmark -->
|
|
✅ <!-- Checkmark -->
|
|
- {:else if code_execution?.status == 'ERROR'}
|
|
|
|
|
|
+ {:else if codeExecution?.status == 'ERROR'}
|
|
❌ <!-- X mark -->
|
|
❌ <!-- X mark -->
|
|
- {:else if code_execution?.status == 'PENDING'}
|
|
|
|
|
|
+ {:else if codeExecution?.status == 'PENDING'}
|
|
⏳ <!-- Hourglass -->
|
|
⏳ <!-- Hourglass -->
|
|
{:else}
|
|
{:else}
|
|
⁉️ <!-- Interrobang -->
|
|
⁉️ <!-- Interrobang -->
|
|
{/if}
|
|
{/if}
|
|
- {#if code_execution?.name}
|
|
|
|
- {$i18n.t('Code execution')}: {code_execution?.name}
|
|
|
|
|
|
+
|
|
|
|
+ {#if codeExecution?.name}
|
|
|
|
+ {$i18n.t('Code execution')}: {codeExecution?.name}
|
|
{:else}
|
|
{:else}
|
|
{$i18n.t('Code execution')}
|
|
{$i18n.t('Code execution')}
|
|
{/if}
|
|
{/if}
|
|
@@ -31,7 +32,7 @@
|
|
class="self-center"
|
|
class="self-center"
|
|
on:click={() => {
|
|
on:click={() => {
|
|
show = false;
|
|
show = false;
|
|
- code_execution = null;
|
|
|
|
|
|
+ codeExecution = null;
|
|
}}
|
|
}}
|
|
>
|
|
>
|
|
<svg
|
|
<svg
|
|
@@ -57,13 +58,13 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<CodeBlock
|
|
<CodeBlock
|
|
- id="codeexec-{code_execution?.id}-code"
|
|
|
|
- lang={code_execution?.language}
|
|
|
|
- code={code_execution?.code}
|
|
|
|
|
|
+ id="codeexec-{codeExecution?.id}-code"
|
|
|
|
+ lang={codeExecution?.language}
|
|
|
|
+ code={codeExecution?.code}
|
|
allow_execution={false}
|
|
allow_execution={false}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
- {#if code_execution?.error}
|
|
|
|
|
|
+ {#if codeExecution?.error}
|
|
<div class="flex flex-col w-full">
|
|
<div class="flex flex-col w-full">
|
|
<hr class=" dark:border-gray-850 my-3" />
|
|
<hr class=" dark:border-gray-850 my-3" />
|
|
<div class="text-sm dark:text-gray-400">
|
|
<div class="text-sm dark:text-gray-400">
|
|
@@ -71,14 +72,14 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<CodeBlock
|
|
<CodeBlock
|
|
- id="codeexec-{code_execution?.id}-error"
|
|
|
|
|
|
+ id="codeexec-{codeExecution?.id}-error"
|
|
lang=""
|
|
lang=""
|
|
- code={code_execution?.error}
|
|
|
|
|
|
+ code={codeExecution?.error}
|
|
allow_execution={false}
|
|
allow_execution={false}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
{/if}
|
|
- {#if code_execution?.output}
|
|
|
|
|
|
+ {#if codeExecution?.output}
|
|
<div class="flex flex-col w-full">
|
|
<div class="flex flex-col w-full">
|
|
<hr class=" dark:border-gray-850 my-3" />
|
|
<hr class=" dark:border-gray-850 my-3" />
|
|
<div class="text-sm dark:text-gray-400">
|
|
<div class="text-sm dark:text-gray-400">
|
|
@@ -86,21 +87,21 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<CodeBlock
|
|
<CodeBlock
|
|
- id="codeexec-{code_execution?.id}-output"
|
|
|
|
|
|
+ id="codeexec-{codeExecution?.id}-output"
|
|
lang=""
|
|
lang=""
|
|
- code={code_execution?.output}
|
|
|
|
|
|
+ code={codeExecution?.output}
|
|
allow_execution={false}
|
|
allow_execution={false}
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
{/if}
|
|
- {#if code_execution?.files && code_execution?.files.length > 0}
|
|
|
|
|
|
+ {#if codeExecution?.files && codeExecution?.files.length > 0}
|
|
<div class="flex flex-col w-full">
|
|
<div class="flex flex-col w-full">
|
|
<hr class=" dark:border-gray-850 my-3" />
|
|
<hr class=" dark:border-gray-850 my-3" />
|
|
<div class=" text-sm font-medium dark:text-gray-300">
|
|
<div class=" text-sm font-medium dark:text-gray-300">
|
|
{$i18n.t('Files')}
|
|
{$i18n.t('Files')}
|
|
</div>
|
|
</div>
|
|
<ul class="mt-1 list-disc pl-4 text-xs">
|
|
<ul class="mt-1 list-disc pl-4 text-xs">
|
|
- {#each code_execution?.files as file}
|
|
|
|
|
|
+ {#each codeExecution?.files as file}
|
|
<li>
|
|
<li>
|
|
💾 <!-- Floppy disk -->
|
|
💾 <!-- Floppy disk -->
|
|
<a href={file.url} target="_blank">{file.name}</a>
|
|
<a href={file.url} target="_blank">{file.name}</a>
|