diff --git a/frontend/src/lib/consts.ts b/frontend/src/lib/consts.ts new file mode 100644 index 0000000000..9cb292f1e9 --- /dev/null +++ b/frontend/src/lib/consts.ts @@ -0,0 +1 @@ +export const DEFAULT_WEBHOOK_TYPE: 'async' | 'sync' = 'async' \ No newline at end of file diff --git a/frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte b/frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte index 48108377f9..8e0a1995aa 100644 --- a/frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/scripts/get/[...hash]/+page.svelte @@ -55,6 +55,7 @@ import { Loader2 } from 'lucide-svelte' import { slide } from 'svelte/transition' import MoveDrawer from '$lib/components/MoveDrawer.svelte' + import { DEFAULT_WEBHOOK_TYPE } from '$lib/consts' let userSettings: UserSettings let script: Script | undefined @@ -75,11 +76,11 @@ loadScript($page.params.hash) } $: webhooks = { - uuid: { + async: { hash: `${$page.url.hostname}/api/w/${$workspaceStore}/jobs/run/h/${script?.hash}`, path: `${$page.url.hostname}/api/w/${$workspaceStore}/jobs/run/p/${script?.path}` }, - result: { + sync: { hash: `${$page.url.hostname}/api/w/${$workspaceStore}/jobs/run_wait_result/h/${script?.hash}`, path: `${$page.url.hostname}/api/w/${$workspaceStore}/jobs/run_wait_result/p/${script?.path}` } @@ -456,9 +457,9 @@ - - UUID/Async - Result/Sync + + UUID/Async + Result/Sync {#each Object.keys(webhooks) as key}