diff --git a/frontend/src/lib/components/FolderEditor.svelte b/frontend/src/lib/components/FolderEditor.svelte index 99cf091850..15288f090b 100644 --- a/frontend/src/lib/components/FolderEditor.svelte +++ b/frontend/src/lib/components/FolderEditor.svelte @@ -137,7 +137,7 @@ {#if perms} - user + user/group diff --git a/frontend/src/lib/components/UserSettings.svelte b/frontend/src/lib/components/UserSettings.svelte index de1d978b31..ee9baea587 100644 --- a/frontend/src/lib/components/UserSettings.svelte +++ b/frontend/src/lib/components/UserSettings.svelte @@ -15,7 +15,7 @@ let tokens: TruncatedToken[] let newToken: string | undefined let newTokenLabel: string | undefined - let newTokenExpiration: string | undefined + let newTokenExpiration: number | undefined let displayCreateToken = false let login_type = 'none' @@ -57,12 +57,13 @@ async function createToken(): Promise { newToken = undefined - let expirationISO: Date | undefined + let date: Date | undefined if (newTokenExpiration) { - expirationISO = new Date(newTokenExpiration) + date = new Date() + date.setDate(date.getDate() + newTokenExpiration) } newToken = await UserService.createToken({ - requestBody: { label: newTokenLabel, expiration: expirationISO?.toISOString() } as NewToken + requestBody: { label: newTokenLabel, expiration: date?.toISOString() } as NewToken }) listTokens() displayCreateToken = false @@ -87,7 +88,7 @@ Windmill {version} -

User info

+

User info

{#if passwordError}
{passwordError}
@@ -164,7 +165,7 @@ >{truncate(newToken ?? '', 10, '****')}
-
+
Make sure to copy your personal access token now. You won’t be able to see it again!
@@ -185,29 +186,17 @@
- +
- +
diff --git a/frontend/src/lib/components/flows/content/CapturePayload.svelte b/frontend/src/lib/components/flows/content/CapturePayload.svelte index 7efb70313f..5fcf172003 100644 --- a/frontend/src/lib/components/flows/content/CapturePayload.svelte +++ b/frontend/src/lib/components/flows/content/CapturePayload.svelte @@ -115,11 +115,11 @@ Copy as flow inputs and test args -

Derived schema

+

Derived schema

-

Test args

- +

Test args

+ diff --git a/frontend/src/routes/(root)/(logged)/flows/get/[...path]/+page.svelte b/frontend/src/routes/(root)/(logged)/flows/get/[...path]/+page.svelte index 834cf641c6..dcf1bdae41 100644 --- a/frontend/src/routes/(root)/(logged)/flows/get/[...path]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/flows/get/[...path]/+page.svelte @@ -19,7 +19,9 @@ faShare, faGlobe, faCodeFork, - faClipboard + faClipboard, + faChevronUp, + faChevronDown } from '@fortawesome/free-solid-svg-icons' import Tooltip from '$lib/components/Tooltip.svelte' @@ -36,6 +38,7 @@ import RunForm from '$lib/components/RunForm.svelte' import { goto } from '$app/navigation' import ScheduleEditor from '$lib/components/ScheduleEditor.svelte' + import { slide } from 'svelte/transition' let userSettings: UserSettings @@ -117,6 +120,15 @@ await goto('/run/' + run + '?workspace=' + $workspaceStore) } let scheduleEditor: ScheduleEditor + + let viewWebhookCommand = false + + let args = undefined + $: curlCommand = `curl -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" -X POST -d '${JSON.stringify( + args + )}' ${$page.url.protocol}//${$page.url.hostname}/api/w/${$workspaceStore}/jobs/run/f/${ + flow?.path + }` loadSchedule()} bind:this={scheduleEditor} /> @@ -236,7 +248,6 @@
-

Preview

{#if !emptyString(flow.description)} @@ -257,11 +269,9 @@

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`. Webhook + Pass the input as a json payload, the token as a Bearer token or as query arg + `?token=XXX` and pass as header: 'Content-Type: application/json See docs

Create token
+ +
+
+ +
+ {#if viewWebhookCommand} +
+
{curlCommand}  copyToClipboard(curlCommand)}
+									class="cursor-pointer ml-2">
+
+ {/if} +
{#if schedule}

Webhooks - To 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`. + Pass the input as a json payload, the token as a Bearer token or as query arg + `?token=XXX` and pass as header: 'Content-Type: application/json' See docs