mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-20 08:01:35 +00:00
app nits
This commit is contained in:
@@ -180,6 +180,26 @@
|
||||
componentSettings.item.data.componentInput = appInput
|
||||
}
|
||||
}
|
||||
|
||||
let templateChangeTimeout: NodeJS.Timeout | undefined = undefined
|
||||
function onTemplateChange(e: CustomEvent<{ code: string }>) {
|
||||
if (componentSettings?.item.data.componentInput?.type === 'templatev2') {
|
||||
if (templateChangeTimeout) {
|
||||
clearTimeout(templateChangeTimeout)
|
||||
}
|
||||
templateChangeTimeout = setTimeout(() => {
|
||||
if (componentSettings?.item.data.componentInput?.type === 'templatev2') {
|
||||
inferDeps(
|
||||
'`' + e.detail.code + '`',
|
||||
$worldStore.outputsById,
|
||||
componentSettings?.item.data.componentInput,
|
||||
app
|
||||
)
|
||||
console.log('inferred deps for', componentSettings?.item.data.id)
|
||||
}
|
||||
}, 200)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:window onkeydown={keydown} />
|
||||
@@ -284,16 +304,7 @@
|
||||
fontSize={12}
|
||||
bind:code={componentSettings.item.data.componentInput.eval}
|
||||
{extraLib}
|
||||
on:change={(e) => {
|
||||
if (componentSettings?.item.data.componentInput?.type === 'templatev2') {
|
||||
inferDeps(
|
||||
'`' + e.detail.code + '`',
|
||||
$worldStore.outputsById,
|
||||
componentSettings?.item.data.componentInput,
|
||||
app
|
||||
)
|
||||
}
|
||||
}}
|
||||
on:change={onTemplateChange}
|
||||
/>
|
||||
</div>
|
||||
{#if componentSettings.item.data?.componentInput?.type === 'templatev2'}
|
||||
|
||||
@@ -6,8 +6,12 @@
|
||||
|
||||
const { runnableComponents } = getContext<AppViewerContext>('AppViewerContext')
|
||||
|
||||
export let item: GridItem
|
||||
export let ownId: string
|
||||
interface Props {
|
||||
item: GridItem
|
||||
ownId: string
|
||||
}
|
||||
|
||||
let { item = $bindable(), ownId }: Props = $props()
|
||||
|
||||
const componentsWithEventHandler = [
|
||||
'modalcomponent',
|
||||
|
||||
+1
@@ -68,6 +68,7 @@
|
||||
}
|
||||
|
||||
function inferDepsFromCode(code: string) {
|
||||
console.log('inferDepsFromCode', id)
|
||||
if (componentInput) {
|
||||
inferDeps(code, $worldStore.outputsById, componentInput, app)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user