From bf4d90308392f92f6b065a1d80f793dbce091cb0 Mon Sep 17 00:00:00 2001 From: Henri Courdent <122811744+hcourdent@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:07:29 +0100 Subject: [PATCH] Trigger panels texts + doclinks (#4796) * Trigger panels texts + doclinks * create description component * Description module workspace settings * Delete package-lock.json --------- Co-authored-by: Guilhem --- .../src/lib/components/Description.svelte | 10 ++ .../lib/components/RunPageSchedules.svelte | 21 ++- .../details/EmailTriggerPanel.svelte | 6 + .../triggers/KafkaTriggersPanel.svelte | 117 +++++++------- .../components/triggers/RoutesPanel.svelte | 7 +- .../triggers/ScheduledPollPanel.svelte | 12 +- .../components/triggers/WebhooksPanel.svelte | 27 ++-- .../triggers/WebsocketTriggersPanel.svelte | 107 +++++++------ .../(logged)/workspace_settings/+page.svelte | 149 ++++++------------ 9 files changed, 219 insertions(+), 237 deletions(-) create mode 100644 frontend/src/lib/components/Description.svelte diff --git a/frontend/src/lib/components/Description.svelte b/frontend/src/lib/components/Description.svelte new file mode 100644 index 0000000000..59e233aaa8 --- /dev/null +++ b/frontend/src/lib/components/Description.svelte @@ -0,0 +1,10 @@ + + +
+ + {#if link} + Learn more + {/if} +
diff --git a/frontend/src/lib/components/RunPageSchedules.svelte b/frontend/src/lib/components/RunPageSchedules.svelte index e7d5e68f79..f953d160a5 100644 --- a/frontend/src/lib/components/RunPageSchedules.svelte +++ b/frontend/src/lib/components/RunPageSchedules.svelte @@ -14,6 +14,7 @@ import Toggle from './Toggle.svelte' import { loadSchedules, saveSchedule } from './flows/scheduleUtils' import { type Writable, writable } from 'svelte/store' + import Description from '$lib/components/Description.svelte' export let schema: any export let isFlow: boolean @@ -48,14 +49,18 @@ } - { - updateSchedules(true) - }} - bind:this={scheduleEditor} -/> -
+ + Run scripts and flows automatically on a recurring basis using cron expressions. Each script or + flow can have multiple schedules, with one designated as primary. + + { + updateSchedules(true) + }} + bind:this={scheduleEditor} + /> + {#if $primarySchedule == undefined} {:else if $primarySchedule} @@ -163,7 +168,7 @@ }} variant="contained" color="dark" - size="md" + size="sm" startIcon={{ icon: Calendar }} > Set Primary Schedule diff --git a/frontend/src/lib/components/details/EmailTriggerPanel.svelte b/frontend/src/lib/components/details/EmailTriggerPanel.svelte index fca824946f..0eb69d12bb 100644 --- a/frontend/src/lib/components/details/EmailTriggerPanel.svelte +++ b/frontend/src/lib/components/details/EmailTriggerPanel.svelte @@ -17,6 +17,7 @@ import Label from '$lib/components/Label.svelte' import TriggerTokens from '../triggers/TriggerTokens.svelte' let userSettings: UserSettings + import Description from '$lib/components/Description.svelte' export let token: string export let scopes: string[] = [] @@ -79,6 +80,11 @@ />
+ + Email triggers execute scripts and flows when emails are sent to specific addresses. Each + trigger has its own unique email address that can be used to invoke the script or flow. + + {#if loading} {:else} diff --git a/frontend/src/lib/components/triggers/KafkaTriggersPanel.svelte b/frontend/src/lib/components/triggers/KafkaTriggersPanel.svelte index fa52e2b72e..e4d247d084 100644 --- a/frontend/src/lib/components/triggers/KafkaTriggersPanel.svelte +++ b/frontend/src/lib/components/triggers/KafkaTriggersPanel.svelte @@ -10,6 +10,7 @@ import KafkaTriggerEditor from './KafkaTriggerEditor.svelte' import { isCloudHosted } from '$lib/cloud' import KafkaIcon from '../icons/KafkaIcon.svelte' + import Description from '$lib/components/Description.svelte' export let isFlow: boolean export let path: string @@ -47,60 +48,66 @@ bind:this={kafkaTriggerEditor} /> -{#if !$enterpriseLicense} - - Kafka triggers are an enterprise only feature. - -{:else if isCloudHosted()} - - Kafka triggers are disabled in the multi-tenant cloud. - -{:else} -
- {#if newItem} - - Deploy the {isFlow ? 'flow' : 'script'} to add kafka triggers. - - {:else} - - {#if kafkaTriggers} - {#if kafkaTriggers.length == 0} -
No kafka triggers
- {:else} -
- {#each kafkaTriggers as kafkaTrigger (kafkaTrigger.path)} -
-
{kafkaTrigger.path}
-
- {kafkaTrigger.kafka_resource_path} -
-
- -
-
- {/each} -
- {/if} +
+ + Kafka triggers execute scripts and flows in response to messages published to Kafka topics. + + + {#if !$enterpriseLicense} + + Kafka triggers are an enterprise only feature. + + {:else if isCloudHosted()} + + Kafka triggers are disabled in the multi-tenant cloud. + + {:else} +
+ {#if newItem} + + Deploy the {isFlow ? 'flow' : 'script'} to add kafka triggers. + {:else} - + + {#if kafkaTriggers} + {#if kafkaTriggers.length == 0} +
No kafka triggers
+ {:else} +
+ {#each kafkaTriggers as kafkaTrigger (kafkaTrigger.path)} +
+
{kafkaTrigger.path}
+
+ {kafkaTrigger.kafka_resource_path} +
+
+ +
+
+ {/each} +
+ {/if} + {:else} + + {/if} {/if} - {/if} -
-{/if} +
+ {/if} +
diff --git a/frontend/src/lib/components/triggers/RoutesPanel.svelte b/frontend/src/lib/components/triggers/RoutesPanel.svelte index 12feac5bd8..425b9dd9c7 100644 --- a/frontend/src/lib/components/triggers/RoutesPanel.svelte +++ b/frontend/src/lib/components/triggers/RoutesPanel.svelte @@ -10,7 +10,7 @@ import Alert from '../common/alert/Alert.svelte' import type { TriggerContext } from '../triggers' import { getContext } from 'svelte' - + import Description from '$lib/components/Description.svelte' export let isFlow: boolean export let path: string export let newItem: boolean = false @@ -48,6 +48,11 @@ />
+ + Routes expose your scripts and flows as HTTP endpoints. Each route can be configured with a + specific HTTP method and path. + + {#if !newItem} {#if $userStore?.is_admin || $userStore?.is_super_admin} - {#if wsTriggers.length == 0} -
No WS triggers
+
+ + Websocket triggers allow real-time bidirectional communication between your scripts/flows and + external systems. Each trigger creates a unique websocket endpoint. + + + {#if isCloudHosted()} + + Websocket triggers are disabled in the multi-tenant cloud. + + {:else} +
+ {#if newItem} + + Deploy the {isFlow ? 'flow' : 'script'} to add WS triggers. + + {:else if wsTriggers} + + {#if wsTriggers.length == 0} +
No WS triggers
+ {:else} +
+ {#each wsTriggers as wsTriggers (wsTriggers.path)} +
+
{wsTriggers.path}
+
+ {wsTriggers.url} +
+
+ +
+
+ {/each} +
+ {/if} {:else} -
- {#each wsTriggers as wsTriggers (wsTriggers.path)} -
-
{wsTriggers.path}
-
- {wsTriggers.url} -
-
- -
-
- {/each} -
+ {/if} - {:else} - - {/if} -
-{/if} +
+ {/if} +
diff --git a/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte b/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte index 6e9ba1d116..36bfda9a2d 100644 --- a/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte @@ -66,6 +66,7 @@ import ToggleButtonGroup from '$lib/components/common/toggleButton-v2/ToggleButtonGroup.svelte' import ToggleButton from '$lib/components/common/toggleButton-v2/ToggleButton.svelte' import type { AiProviderTypes } from '$lib/components/copilot/lib' + import Description from '$lib/components/Description.svelte' type GitSyncTypeMap = { scripts: boolean @@ -693,18 +694,12 @@ {:else if tab == 'deploy_to'}
-
+
Link this workspace to another Staging / Prod workspace
-
- Connecting this workspace with another staging/production workspace enables web-based - deployment to that workspace. - Learn more. -
+ + Connecting this workspace with another staging/production workspace enables web-based deployment to that workspace. +
{#if $enterpriseLicense} @@ -722,15 +717,10 @@
Connect workspace to Slack
-
+ Connect your Windmill workspace to your Slack workspace to trigger a script or a flow with a '/windmill' command or to configure Slack error handlers. - Learn more. -
+
{#if team_name} @@ -891,15 +881,10 @@
Workspace Webhook
-
+ Connect your Windmill workspace to an external service to sync or get notified about any change. - Learn more. -
+
@@ -926,20 +911,15 @@ {/if}
-
Workspace Error Handler
-
+
Workspace Error Handler
+ Define a script or flow to be executed automatically in case of error in the workspace. - Learn more. -
+
-
+
Script or flow to run as error handler
@@ -1001,16 +981,10 @@
-
Workspace Critical Alerts
-
- Critical alerts within the scope of a workspace are sent to the workspace admins through - a UI notification. - Learn more. -
+
Workspace Critical Alerts
+ + Critical alerts within the scope of a workspace are sent to the workspace admins through a UI notification. +
{ aiResourceInitialPath = '' + aiResourceInitialProvider = '' }} > @@ -1091,18 +1061,10 @@ {:else if tab == 'windmill_lfs'}
-
Workspace object storage (S3/Azure Blob)
-
- Connect your Windmill workspace to your S3 bucket or your Azure Blob storage to enable - users to read and write from S3 without having to have access to the credentials. - Learn more. -
+
Workspace object storage (S3/Azure Blob)
+ + Connect your Windmill workspace to your S3 bucket or your Azure Blob storage to enable users to read and write from S3 without having to have access to the credentials. +
{#if !$enterpriseLicense} @@ -1278,16 +1240,10 @@ {:else if tab == 'git_sync'}
-
Git Sync
-
- Connect the Windmill workspace to a Git repository to automatically commit and push - scripts, flows, and apps to the repository on each deploy. - Learn more. -
+
Git Sync
+ + Connect the Windmill workspace to a Git repository to automatically commit and push scripts, flows, and apps to the repository on each deploy. +
{#if !$enterpriseLicense} @@ -1732,20 +1688,13 @@ git push
-
Workspace default app
-
- If configured, users who are operators in this workspace will be redirected to this app - automatically when logging into this workspace. -
-
- Make sure the default app is shared with all the operators of this workspace before - turning this feature on. - Learn more. -
+
Workspace default app
+ + If configured, users who are operators in this workspace will be redirected to this app automatically when logging into this workspace. + + + Make sure the default app is shared with all the operators of this workspace before turning this feature on. +
{#if !$enterpriseLicense} @@ -1771,21 +1720,13 @@ git push
-
Workspace secret encryption
-
- When updating the encryption key of a workspace, all secrets will be re-encrypted with - the new key and the previous key will be replaced by the new one. -
-
- If you're manually updating the key to match another workspace key from another Windmill - instance, make sure not to use the 'SECRET_SALT' environment variable or, if you're - using it, make sure it the salt matches across both instances. - Learn more. -
+
Workspace secret encryption
+ + When updating the encryption key of a workspace, all secrets will be re-encrypted with the new key and the previous key will be replaced by the new one. + + + If you're manually updating the key to match another workspace key from another Windmill instance, make sure not to use the 'SECRET_SALT' environment variable or, if you're using it, make sure it the salt matches across both instances. +