fix: remove result and args from list completed and list queue jobs

This commit is contained in:
Ruben Fiszel
2023-09-09 09:31:38 +02:00
parent 9a23bf7be1
commit bfe5aacea2
2 changed files with 24 additions and 14 deletions
+3 -3
View File
@@ -651,7 +651,7 @@ async fn list_queue_jobs(
"scheduled_for",
"script_hash",
"script_path",
"args",
"null as args",
"job_kind",
"schedule_path",
"permissioned_as",
@@ -2642,8 +2642,8 @@ async fn list_completed_jobs(
"success",
"script_hash",
"script_path",
"args",
"result",
"null as args",
"null as result",
"null as logs",
"deleted",
"canceled",
@@ -11,8 +11,6 @@
import DisplayResult from '../DisplayResult.svelte'
import TableCustom from '../TableCustom.svelte'
import Drawer from '../common/drawer/Drawer.svelte'
import { Highlight } from 'svelte-highlight'
import { json } from 'svelte-highlight/languages'
import DrawerContent from '../common/drawer/DrawerContent.svelte'
import HighlightCode from '../HighlightCode.svelte'
import LogViewer from '../LogViewer.svelte'
@@ -34,7 +32,7 @@
type DrawerContent = {
mode: 'json' | Preview.language | 'plain'
title: string
content: string
content: any
}
let selectedTab = 'logs'
@@ -57,12 +55,18 @@
<Drawer bind:open={drawerOpen} size="800px">
<DrawerContent title={drawerContent?.title} on:close={() => closeDrawer()}>
{#if drawerContent?.mode === 'json'}
<Highlight language={json} code={JSON.stringify(drawerContent.content, null, 4)} />
{#if drawerContent?.content == undefined}
<div class="p-2"> <Loader2 class="animate-spin" /> </div>
{:else if drawerContent?.mode === 'json'}
<DisplayResult
workspaceId={previewJob?.workspace_id}
jobId={previewJob?.id}
result={drawerContent.content}
/>
{:else if drawerContent?.mode === 'plain'}
<pre
class="overflow-x-auto break-words relative h-full m-2 text-xs bg-surface shadow-inner p-2">
{drawerContent?.content}
class="overflow-x-auto break-words relative h-full m-2 text-xs bg-surface shadow-inner p-2"
>{drawerContent?.content}
</pre>
{:else if drawerContent?.mode === 'deno' || drawerContent?.mode === 'python3' || drawerContent?.mode === 'go' || drawerContent?.mode === 'bash' || drawerContent?.mode === 'nativets'}
<HighlightCode language={drawerContent?.mode} code={drawerContent?.content} />
@@ -136,7 +140,7 @@
<th class="text-xs">Logs</th>
</tr>
<tbody slot="body">
{#each pastPreviews as { id, created_at, success, result }}
{#each pastPreviews as { id, created_at, success }}
<tr class="">
<td class="text-xs">
<a class="pr-3" href="/run/{id}?workspace={$workspaceStore}" target="_blank"
@@ -156,10 +160,16 @@
href="#result"
class="text-xs"
on:click={() => {
openDrawer({ mode: 'json', content: result, title: 'Result' })
openDrawer({ mode: 'json', content: undefined, title: 'Result' })
JobService.getCompletedJobResult({
workspace: $workspaceStore ?? 'NO_W',
id
}).then((res) => {
drawerContent && (drawerContent.content = res)
})
}}
>
{JSON.stringify(result).substring(0, 30)}...
See Result
</a>
</td>
<td class="text-xs">
@@ -195,7 +205,7 @@
id
})
).logs
openDrawer({ mode: 'plain', content: String(logs), title: `Code ${lang}` })
openDrawer({ mode: 'plain', content: String(logs), title: `Logs for ${id}` })
}}
>
View logs