diff --git a/frontend/src/lib/components/ScriptBuilder.svelte b/frontend/src/lib/components/ScriptBuilder.svelte
index 34cac291ec..46826bb94b 100644
--- a/frontend/src/lib/components/ScriptBuilder.svelte
+++ b/frontend/src/lib/components/ScriptBuilder.svelte
@@ -10,12 +10,24 @@
import ScriptEditor from './ScriptEditor.svelte'
import { dirtyStore } from './common/confirmationModal/dirtyStore'
import { Alert, Badge, Button, Drawer, Kbd, SecondsInput, Tab, TabContent, Tabs } from './common'
- import { faPlus, faSave } from '@fortawesome/free-solid-svg-icons'
+ import { faSave } from '@fortawesome/free-solid-svg-icons'
import LanguageIcon from './common/languageIcons/LanguageIcon.svelte'
import type { SupportedLanguage } from '$lib/common'
import Tooltip from './Tooltip.svelte'
import DrawerContent from './common/drawer/DrawerContent.svelte'
- import { Loader2, Pen, X } from 'lucide-svelte'
+ import ToggleButtonGroup from '$lib/components/common/toggleButton-v2/ToggleButtonGroup.svelte'
+ import ToggleButton from '$lib/components/common/toggleButton-v2/ToggleButton.svelte'
+ import {
+ Bug,
+ CheckCircle,
+ Code,
+ ExternalLink,
+ Loader2,
+ Pen,
+ Plus,
+ Rocket,
+ X
+ } from 'lucide-svelte'
import autosize from 'svelte-autosize'
import type Editor from './Editor.svelte'
import { SCRIPT_SHOW_BASH, SCRIPT_SHOW_GO } from '$lib/consts'
@@ -23,11 +35,11 @@
import { sendUserToast } from '$lib/toast'
import { isCloudHosted } from '$lib/cloud'
import Awareness from './Awareness.svelte'
- import { Icon } from 'svelte-awesome'
import { fade } from 'svelte/transition'
import Popover from './Popover.svelte'
import Toggle from './Toggle.svelte'
import ScriptSchema from './ScriptSchema.svelte'
+ import Section from './Section.svelte'
export let script: NewScript
export let initialPath: string = ''
@@ -77,33 +89,39 @@
langs.push(['Snowflake', Script.language.SNOWFLAKE])
langs.push(['GraphQL', Script.language.GRAPHQL])
langs.push(['PowerShell', Script.language.POWERSHELL])
+
const scriptKindOptions: {
value: Script.kind
title: string
+ Icon: any
desc?: string
documentationLink?: string
}[] = [
{
value: Script.kind.SCRIPT,
- title: 'Action'
+ title: 'Action',
+ Icon: Code
},
{
value: Script.kind.TRIGGER,
title: 'Trigger',
desc: 'First module of flows to trigger them based on external changes. These kind of scripts are usually running on a schedule to periodically look for changes.',
- documentationLink: 'https://www.windmill.dev/docs/flows/flow_trigger'
+ documentationLink: 'https://www.windmill.dev/docs/flows/flow_trigger',
+ Icon: Rocket
},
{
value: Script.kind.APPROVAL,
title: 'Approval',
desc: 'Send notifications externally to ask for approval to continue a flow.',
- documentationLink: 'https://www.windmill.dev/docs/flows/flow_approval'
+ documentationLink: 'https://www.windmill.dev/docs/flows/flow_approval',
+ Icon: CheckCircle
},
{
value: Script.kind.FAILURE,
title: 'Error Handler',
desc: 'Handle errors in flows after all retry attempts have been exhausted.',
- documentationLink: 'https://www.windmill.dev/docs/flows/flow_error_handler'
+ documentationLink: 'https://www.windmill.dev/docs/flows/flow_error_handler',
+ Icon: Bug
}
]
@@ -277,339 +295,353 @@
+
{#if !$userStore?.operator}
(metadataOpen = false)}>
MetadataRuntime
- Generated UI
+ Generated UI
+ The arguments are synced with the main signature but you may refine the parts that
- cannot be inferred from the type directly.
+ >
+ The arguments are synced with the main signature but you may refine the parts that
+ cannot be inferred from the type directly.
+
+
-
- As a forked script, the language '{script.language}' cannot be modified.
-
- {/if}
-
- {#each langs as [label, lang]}
- {@const isPicked = script.language == lang && template == 'script'}
-
+
+ {#if lockedLanguage}
+
+ As a forked script, the language '{script.language}' cannot be modified.
+
+ {/if}
+
+ {#each langs as [label, lang]}
+ {@const isPicked = script.language == lang && template == 'script'}
+
+
+ {label} is only available with an enterprise license
+
+ {/each}
- {label} is only available with an enterprise license
-
- {/each}
-
+
+
-
-
-
-
- Script kind
-
- Tag this script's purpose within flows such that it is available as the
- corresponding action.
-
-
Worker group tag The script will be executed on a worker configured to accept its worker group
- tag. For instance, you could setup an "highmem", or "gpu" worker group.
- No custom worker group defined on this instance. See documentation
+
+
+
-
- {/if}
- {:else}
-
- {/if}
+ The script will be executed on a worker configured to accept its worker group
+ tag. For instance, you could setup an "highmem", or "gpu" worker group.
+
+
-
Cache {
- if (script.cache_ttl && script.cache_ttl != undefined) {
- script.cache_ttl = undefined
- } else {
- script.cache_ttl = 300
- }
- }}
- options={{
- right: 'Cache the results for each possible inputs'
- }}
- />
Dedicated WorkersIn this mode, the script is meant to be run on dedicated workers that run the
- script at native speed. Can reach >1500rps per dedicated worker. Only available on
- enterprise edition and for the Bun language.
- {
- if (script.dedicated_worker) {
- script.dedicated_worker = undefined
- } else {
- script.dedicated_worker = true
- }
- }}
- options={{
- right: 'Script is run on dedicated workers'
- }}
- />
-
- {#if !isCloudHosted()}
-
- Custom env variables
-
- Additional static custom env variables to pass to the script.
-
-
-
- Format is: `{'='}`
- {#if Array.isArray(script.envs ?? [])}
- {#each script.envs ?? [] as v, i}
-
-
-
-
-
-
- {/if}
+ options={{
+ right: 'Script is run on dedicated workers'
+ }}
+ />
+
+
+ In this mode, the script is meant to be run on dedicated workers that run the
+ script at native speed. Can reach >1500rps per dedicated worker. Only
+ available on enterprise edition and for the Bun language.
+
+
+ {#if !isCloudHosted()}
+
+
+
+ Additional static custom env variables to pass to the script.
+
+
+ {#if script.envs && script.envs.length > 0}
+
+ Static envs variables are not passed in preview but solely on deployed
+ scripts.
+
+ {/if}
+
+ Format is: `{'='}`
+ {#if Array.isArray(script.envs ?? [])}
+ {#each script.envs ?? [] as v, i}
+