Skip to content

Commit

Permalink
feat: improve debug runs wrt to frontend scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Jul 4, 2023
1 parent 72ba8f4 commit dda9920
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 17 additions & 3 deletions frontend/src/lib/components/apps/editor/AppEditorHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
} from '@fortawesome/free-solid-svg-icons'
import {
AlignHorizontalSpaceAround,
BellOff,
Bug,
Expand,
Laptop2,
Expand Down Expand Up @@ -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"
>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/apps/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit dda9920

Please sign in to comment.