feat: improve debug runs wrt to frontend scripts

This commit is contained in:
Ruben Fiszel
2023-07-04 23:50:43 +02:00
parent 198b3543e3
commit 40a147ebfc
3 changed files with 20 additions and 4 deletions

View File

@@ -181,6 +181,8 @@
await setResult(r, undefined)
$state = $state
const job = generateNextFrontendJobId()
$jobs = [{ job, component: id, result: r }, ...$jobs]
} catch (e) {
sendUserToast(`Error running frontend script ${id}: ` + e.message, true)

View File

@@ -26,6 +26,7 @@
} from '@fortawesome/free-solid-svg-icons'
import {
AlignHorizontalSpaceAround,
BellOff,
Bug,
Expand,
Laptop2,
@@ -545,7 +546,9 @@
<DrawerContent
noPadding
title="Debug Runs"
on:close={() => ($jobsDrawerOpen = false)}
on:close={() => {
$jobsDrawerOpen = false
}}
tooltip="Look at latests runs to spot potential bugs."
documentationLink="https://www.windmill.dev/docs/apps/app_debugging"
>
@@ -602,7 +605,7 @@
</pre>
</Pane>
</Splitpanes>
{:else if jobResult?.result !== undefined}
{:else if jobResult !== undefined}
<Splitpanes horizontal class="grow border w-full">
<Pane size={50} minSize={10}>
<LogViewer
@@ -795,7 +798,18 @@
>
<div class="flex flex-row gap-1 items-center">
<Bug size={14} />
<div> Debug runs </div>
<div> Debug runs</div>
<div class="text-2xs text-gray-500">({$jobs?.length ?? 0})</div>
{#if hasErrors}
<Button
size="xs"
btnClasses="-my-2 !px-1 !py-0"
color="light"
variant="border"
on:click={() => errorByComponent.set({})}
><BellOff size={12} />
</Button>
{/if}
</div>
</Button>
</div>

View File

@@ -17,7 +17,7 @@ import type {
export const BG_PREFIX = 'bg_'
export function migrateApp(app: App) {
app.hiddenInlineScripts.forEach((x) => {
app?.hiddenInlineScripts.forEach((x) => {
if (x.type == undefined) {
//@ts-ignore
x.type = 'runnableByName'