* improve capture picker * improve historic input viewer * open object viewer on open * Add test page * fix performance * fix perf * handle object with no properties in schema diff * remove click outside behavior for input editor * fix * all * catch critical alerts errors * critical alerts modal reactivity * prevent one from removing himself in folders * nits * add standalone bundle support on CE * fix codebase & bundles on EE * local codebase in home * feat(frontend): global recompute helper function (#5408) * feat(frontend): global recompute helper function * fixes * remove unused import * filteredIds -> excludeIds * get(recomputeAllContext)? * deal with circulare recomputes * consistent naming * sqlx update script on mac (#5420) * fix(python): windows worker fails to install 3.10 (#5409) ``` execution error:\nFind python error: error: Failed to inspect Python interpreter from managed installations at `C:\\tmp\\windmill\\cache\\py_runtime\\cpython-3.10.16-windows-x86_64-none\\python.exe`\n Caused by: Querying Python at `C:\\tmp\\windmill\\cache\\py_runtime\\cpython-3.10.16-windows-x86_64-none\\python.exe` failed with exit status exit code: 1\n\n[stderr]\nFatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python\nPython runtime state: preinitialized\n" ``` * feat: more controls on setting token duration (#5421) * allow setting max session length * more options for expiration * sqlx * option to invalidate all old sessions on new session * sqlx update script on mac * order * add audit log --------- Co-authored-by: Ruben Fiszel <ruben@windmill.dev> * fix: do not depend on public schema anymore * feat: add template script for all triggers (#5424) * nits: add/update create from template for trigger * fix: remove kafka folder * chore(main): release 1.474.0 (#5423) * chore(main): release 1.474.0 * Apply automatic changes --------- Co-authored-by: rubenfiszel <275584+rubenfiszel@users.noreply.github.com> * allow ce to run codebase bundles preview * allow ce to run codebase bundles preview * feat(frontend): improve flow suspend status display (#5425) * feat(backend): option to invalidate all sessions on logout (#5419) * feat(backend): option to invalidate all sessions on logout * lazy static * Update backend/.sqlx/query-8cccb31aa56af16af675c692bf4e14b297d2caeafd1c4e4b1584f3bc9ff4c563.json Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * sqlx * sqlx * all -> invalidate-all * add audit log * rename env var --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * feat: MQTT triggers (#5277) * first commit * update migration mqtt * chore: update dependencies * add cli support and update schema for mqtt * update: casing style * update: rename get_resource function and moving to resource.rs * feat: * feat: refactored * feat: add ready endpoints for workers to enterprise * feat: handle connection to server * fix: main.rs * feat: added support v5 * feat: 🚧 updated .github, handle more case for v5 and handle v3 * feat: handled client, update script helper * update .sqlx * refactor: added generic implement and trait to remove redundant code, misses client impleme * feat: remove optinal property update test function * feat: done * handle client certificate * minor fix * fix: tls and mtls * fix: min topic len in frontend * Update frontend/src/lib/components/triggers/mqtt/MqttEditorConfigSection.svelte Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Update backend/windmill-api/openapi.yaml Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * Update backend/windmill-api/src/mqtt_triggers.rs Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * update openapi, and script_helper.ts * fix: toggle button and update mqtt migration * nits: remove postgres type and only relies on serde * fix: timeout connection * fix typo and captures * fix: capture table reactivity * handle more mqtt v5 option * nits: remove clone method * update: better naming * nits: display tooltip qos * fix: hanle tls connection with natively * update: add documentation links for qos and topics * fix tooltip and add default value * update: shoz preprocessor only if selected in capture table * nits: show mqtt icon in resource related componenets * update hub link and repo ref * fix: unused var * update ee ref * fix: give good reference id for script hub --------- Co-authored-by: Ruben Fiszel <ruben@windmill.dev> Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Clement Zhang <clement.zhang2@gmail.com> * accept otel parameters from envs * nit improvements for CLI * fix(cli): fix wmill user create-token with email and password * Add utility function to check object size * Add disabled option for Button dropdown * handle big inputs * clean code * restore test page * revert unwanted changes * lazyload picker viewer * fix guilhem code * fix menu --------- Co-authored-by: Ruben Fiszel <ruben@windmill.dev> Co-authored-by: Alexander Petric <alpetric@users.noreply.github.com> Co-authored-by: pyranota <92104930+pyranota@users.noreply.github.com> Co-authored-by: dieriba <dieriba.pro@gmail.com> Co-authored-by: rubenfiszel <275584+rubenfiszel@users.noreply.github.com> Co-authored-by: HugoCasa <hugo@casademont.ch> Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Clement Zhang <clement.zhang2@gmail.com> Co-authored-by: Ruben Fiszel <ruben@rubenfiszel.com>
119 lines
3.2 KiB
Svelte
119 lines
3.2 KiB
Svelte
<script lang="ts">
|
|
import { createEventDispatcher, onDestroy, getContext } from 'svelte'
|
|
import { getFirstStepSchema } from '$lib/components/flows/flowStore'
|
|
import type { FlowEditorContext } from '$lib/components/flows/types'
|
|
import { twMerge } from 'tailwind-merge'
|
|
import { Alert } from '$lib/components/common'
|
|
import FlowModuleSchemaItemViewer from '$lib/components/flows/map/FlowModuleSchemaItemViewer.svelte'
|
|
import LanguageIcon from '$lib/components/common/languageIcons/LanguageIcon.svelte'
|
|
import { prettyLanguage } from '$lib/common'
|
|
import IconedResourceType from '$lib/components/IconedResourceType.svelte'
|
|
import { Building } from 'lucide-svelte'
|
|
|
|
const { flowStore, flowStateStore } = getContext<FlowEditorContext>('FlowEditorContext')
|
|
|
|
const dispatch = createEventDispatcher()
|
|
let schema: Record<string, any> | undefined = undefined
|
|
|
|
let error: string | undefined = undefined
|
|
let mod: any | undefined = undefined
|
|
async function loadSchema() {
|
|
try {
|
|
const res = await getFirstStepSchema($flowStateStore, flowStore)
|
|
schema = res.schema
|
|
mod = res.mod
|
|
dispatch('connectFirstNode', { connectFirstNode: res.connectFirstNode })
|
|
} catch (e) {
|
|
error = e
|
|
}
|
|
}
|
|
$: $flowStore && $flowStateStore && loadSchema()
|
|
|
|
function handleClick() {
|
|
selected = !selected
|
|
dispatch('select', selected ? schema : undefined)
|
|
}
|
|
|
|
onDestroy(() => {
|
|
selected = false
|
|
dispatch('select', undefined)
|
|
})
|
|
|
|
let selected: boolean = false
|
|
|
|
function handleKeydown(event: KeyboardEvent) {
|
|
if (event.key === 'Escape' && selected) {
|
|
selected = false
|
|
dispatch('select', undefined)
|
|
event.stopPropagation()
|
|
event.preventDefault()
|
|
}
|
|
}
|
|
|
|
let firstUpdate = true
|
|
$: if (schema && !selected && firstUpdate) {
|
|
firstUpdate = false
|
|
setTimeout(() => {
|
|
selected = true
|
|
dispatch('select', schema)
|
|
}, 200)
|
|
}
|
|
|
|
export function resetSelected(dispatchEvent?: boolean) {
|
|
selected = false
|
|
if (dispatchEvent) {
|
|
dispatch('select', undefined)
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<svelte:window on:keydown={handleKeydown} />
|
|
|
|
<div class="h-full">
|
|
{#if schema && mod}
|
|
<button
|
|
class={twMerge(
|
|
'w-full shadow-md rounded-sm',
|
|
selected ? 'bg-surface-selected' : 'hover:bg-surface-hover'
|
|
)}
|
|
disabled={!schema}
|
|
on:click={handleClick}
|
|
>
|
|
<FlowModuleSchemaItemViewer
|
|
on:click={handleClick}
|
|
deletable={false}
|
|
id={mod.id}
|
|
label={mod.summary ||
|
|
(`path` in mod.value ? mod.value.path : undefined) ||
|
|
(mod.value.type === 'rawscript'
|
|
? `Inline ${prettyLanguage(mod.value.language)}`
|
|
: 'To be defined')}
|
|
path={`path` in mod.value && mod.summary ? mod.value.path : ''}
|
|
>
|
|
<div slot="icon">
|
|
{#if mod.value.type === 'rawscript'}
|
|
<LanguageIcon lang={mod.value.language} width={16} height={16} />
|
|
{:else if mod.value.type === 'script'}
|
|
{#if mod.value.path.startsWith('hub/')}
|
|
<div>
|
|
<IconedResourceType
|
|
width="20px"
|
|
height="20px"
|
|
name={mod.value.path.split('/')[2]}
|
|
silent={true}
|
|
/>
|
|
</div>
|
|
{:else}
|
|
<Building size={14} />
|
|
{/if}
|
|
{/if}
|
|
</div>
|
|
</FlowModuleSchemaItemViewer>
|
|
</button>
|
|
{:else}
|
|
<Alert type="warning" title="Cannot load first step's inputs" size="xs">
|
|
{error}
|
|
</Alert>
|
|
{/if}
|
|
</div>
|