diff --git a/frontend/src/lib/components/ArgInfo.svelte b/frontend/src/lib/components/ArgInfo.svelte index d2a6f3d097..b47e2ab0ea 100644 --- a/frontend/src/lib/components/ArgInfo.svelte +++ b/frontend/src/lib/components/ArgInfo.svelte @@ -7,6 +7,7 @@ import { workspaceStore } from '$lib/stores' import Drawer from './common/drawer/Drawer.svelte' import { DrawerContent } from './common' + import ObjectViewer from './propertyPicker/ObjectViewer.svelte' export let value: any let jsonViewer: Drawer @@ -20,11 +21,9 @@ jsonViewerContent = (await ResourceService.getResource({ workspace: $workspaceStore!, path })) .value } - - $: asJson = JSON.stringify(value, null, 4) - + @@ -42,14 +41,29 @@ await getResource(value.substring('$res:'.length)) jsonViewer.toggleDrawer() }}>{value}{:else if asJson.length > 40} - {truncate(asJson, 40)} { - jsonViewerContent = value - jsonViewer.toggleDrawer() - }}>(+) +{:else if typeof value !== 'object'} + {truncate(value, 40)} + {#if JSON.stringify(value).length > 40} + + {/if} {:else} - {asJson} +
+ +
+ {#if JSON.stringify(value).length > 120} + + {/if} {/if} diff --git a/frontend/src/lib/components/JobArgs.svelte b/frontend/src/lib/components/JobArgs.svelte index 32c0b9d5b4..93a06049d5 100644 --- a/frontend/src/lib/components/JobArgs.svelte +++ b/frontend/src/lib/components/JobArgs.svelte @@ -16,8 +16,8 @@ {#if job && job.args && Object.keys(job.args).length > 0} {#each Object.entries(job.args) as [arg, value]} - {arg} - + {arg} + {/each} {:else if job} diff --git a/frontend/src/lib/components/jobs/JobDetail.svelte b/frontend/src/lib/components/jobs/JobDetail.svelte index 7cc797c55c..759f862dc1 100644 --- a/frontend/src/lib/components/jobs/JobDetail.svelte +++ b/frontend/src/lib/components/jobs/JobDetail.svelte @@ -21,6 +21,7 @@ } from '@fortawesome/free-solid-svg-icons' import Icon from 'svelte-awesome' import { check } from 'svelte-awesome/icons' + import { Badge } from '../common' const SMALL_ICON_SCALE = 0.7 @@ -95,19 +96,12 @@ {/if}
- {#if job.script_hash} - {truncateHash(job.script_hash ?? '')}{job.job_kind} {/if} - {#if 'job_kind' in job && job.job_kind != 'script'}{job.job_kind} - {:else if job.is_flow_step} - step of flow + {#if (job.is_flow_step && job.job_kind == 'script') || job.job_kind == 'preview'} + flow step {/if}
diff --git a/frontend/src/lib/components/propertyPicker/ObjectViewer.svelte b/frontend/src/lib/components/propertyPicker/ObjectViewer.svelte index cac55715e2..6e0b8c7cfb 100644 --- a/frontend/src/lib/components/propertyPicker/ObjectViewer.svelte +++ b/frontend/src/lib/components/propertyPicker/ObjectViewer.svelte @@ -14,6 +14,7 @@ export let pureViewer = false export let collapsed = level == 3 || Array.isArray(json) export let rawKey = false + export let topBrackets = false const collapsedSymbol = '...' let keys: string | any[] @@ -44,12 +45,13 @@ {#if level != 0} (-) {/if} + {#if level == 0 && topBrackets}{/if}
    {#each keys as key, index}
  • @@ -65,7 +67,9 @@ /> {:else}
  • {/each}
+ {#if level == 0 && topBrackets}{/if} + + Edited {displayDaysAgo(flow.edited_at ?? '')} by {flow.edited_by}

-

{flow.summary}

- -
- +
+

{flow.summary}

+
+ +
{#if schedule}
@@ -242,19 +252,38 @@
{/if}
- Webhook to run this flow: - Send a POST http request with a token as bearer token and the args respecting the - corresponding jsonschema as payload. To create a permanent token, go to your user setting - by clicking your username on the top-left. -
/api/w/{$workspaceStore}/jobs/run/f/{flow?.path}
WebhookTo trigger this script with a webhook, do a POST request to the endpoint below. Flows + are not public and can only be run by users with at least view rights on them. You will + need to pass a bearer token to authentify as a user. You can either pass it as a Bearer + token or as query arg `?token=XXX`. See docs +
+
+ + {url} + + +
+
+ +
+

Flow

diff --git a/frontend/src/routes/run/[...run].svelte b/frontend/src/routes/run/[...run].svelte index 2c0383ded6..3ceb3d69c5 100644 --- a/frontend/src/routes/run/[...run].svelte +++ b/frontend/src/routes/run/[...run].svelte @@ -37,6 +37,7 @@ import JobArgs from '$lib/components/JobArgs.svelte' import FlowProgressBar from '$lib/components/flows/FlowProgressBar.svelte' import Tabs from '$lib/components/common/tabs/Tabs.svelte' + import Badge from '$lib/components/common/badge/Badge.svelte' let workspace_id_query: string | undefined = $page.url.searchParams.get('workspace') ?? undefined let workspace_id: string | undefined @@ -206,14 +207,11 @@ {/if} {job.script_path ?? (job.job_kind == 'dependencies' ? 'lock dependencies' : 'No path')} {#if job.script_hash} - {truncateHash(job.script_hash)}{truncateHash(job.script_hash)} {/if} - {#if job && 'job_kind' in job}{job.job_kind} + {#if job && 'job_kind' in job}{job.job_kind} {/if} {/if}
@@ -255,9 +253,11 @@ Result Logs - {job?.job_kind == 'dependencies' ? 'Input Dependencies' : 'Code previewed'} + {#if job?.job_kind == 'dependencies'} + Dependencies + {:else if job?.job_kind == 'preview'} + Code + {/if} diff --git a/frontend/src/routes/runs/[...path].svelte b/frontend/src/routes/runs/[...path].svelte index 6d9bfaff13..55207972bc 100644 --- a/frontend/src/routes/runs/[...path].svelte +++ b/frontend/src/routes/runs/[...path].svelte @@ -19,7 +19,6 @@ import Tab from '$lib/components/common/tabs/Tab.svelte' import JobDetail from '$lib/components/jobs/JobDetail.svelte' import { Skeleton } from '$lib/components/common' - import Tooltip from '../../lib/components/Tooltip.svelte' import { goto } from '$app/navigation' import PageHeader from '$lib/components/PageHeader.svelte' diff --git a/frontend/src/routes/scripts/get/[...hash].svelte b/frontend/src/routes/scripts/get/[...hash].svelte index 957f134306..3c243a88ff 100644 --- a/frontend/src/routes/scripts/get/[...hash].svelte +++ b/frontend/src/routes/scripts/get/[...hash].svelte @@ -43,7 +43,9 @@ import HighlightCode from '$lib/components/HighlightCode.svelte' import { Badge, Tabs, Tab, TabContent, Button, ActionRow } from '$lib/components/common' import Skeleton from '../../../lib/components/common/skeleton/Skeleton.svelte' + import UserSettings from '$lib/components/UserSettings.svelte' + let userSettings: UserSettings let script: Script | undefined let topHash: string | undefined let can_write = false @@ -128,6 +130,8 @@ }) + + {#if script} @@ -326,7 +330,16 @@
-

Webhooks

+

WebhooksTo trigger this script with a webhook, do a POST request to the endpoints below. + Scripts are not public and can only be run by users with at least view rights on them. + You will need to pass a bearer token to authentify as a user. You can either pass it as + a Bearer token or as query arg `?token=XXX`. See docs

{#if script}
@@ -363,6 +376,9 @@ {/each} +
+ +
{/each}