Files
windmill/frontend/src/lib/components/FieldHeader.svelte
T
01c6f84520 feat: captures (#4807)
* feat: captures

* flow UI and improvements

* fix: build

* fix sqlx

* Move Capture WIP

* Add capture to webhook and websocket

* Move connection status viewer in the head

* change trigger section label

* Add popover capture picker using melt ui

* Add shortcut to triggers capture from input form

* remove capture tab in input

* Allways show capture

* remove useless logs

* Add email capture

* Add kafka capture into triggers

* Add edit option in capture table

* use light header for arg input

* Add prefilled group id

* Change button label

* fix logic

* Open resource drawer if prototype has fields

* fix default completion

* Change name Prototype

* Dissociate Editor Mode for triggers

* Fix bug for script

* Fix apply args

* fix apply schema

* Add capture table to script

* fix apply args

* Add capture button for script

* Delete capture tab

* Set capture on when opening triggers capture

* fix connection indicator

* fix minor issues

* Add preprocessor logic

* Use slot in log Panel for captures

* handle capture refresh in script

* Delete capture tab from script editor

* reset kafka resource on toggle static

* fix minor issue

* Allow resource in kafka capture

* use simple capture button in flow

* Remove capture panel

* Polish route trigger editor

* Fix resource saving

* Remove excessive padding

* merge nits

* add workflow_dispatch to build

* add workflow_dispatch to build

* better capture UI

* fix sqlx

* fix build

* fix build

* build

* make initial_messages optional in line with db

* fix npm check

* better handle args for capture webhook and http

* improve migration + http capture fixes

* fix sqlx

* update ee ref

---------

Co-authored-by: Guilhem <guilhemlemouel@gmail.com>
Co-authored-by: Ruben Fiszel <ruben@rubenfiszel.com>
Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
2025-01-06 12:07:09 +01:00

61 lines
1.5 KiB
Svelte

<script lang="ts">
import { twMerge } from 'tailwind-merge'
import Required from './Required.svelte'
import Tooltip from '$lib/components/Tooltip.svelte'
import { capitalize, emptyString } from '$lib/utils'
export let label: string
export let format: string = ''
export let contentEncoding = ''
export let type: string | undefined = undefined
export let disabled: boolean = false
export let required = false
export let displayType: boolean = true
export let labelClass: string = ''
export let prettify = false
export let simpleTooltip: string | undefined = undefined
export let lightHeader = false
</script>
<div class="inline-flex flex-row items-baseline truncated">
<span
class={twMerge(
disabled ? 'text-tertiary' : '',
'font-semibold',
lightHeader ? 'text-secondary text-sm font-normal' : '',
labelClass
)}
>
{#if prettify}
{label.replace(/_/g, ' ').split(' ').map(capitalize).join(' ')}
{:else}
{label}
{/if}
</span>
{#if !disabled}
<Required {required} class="!ml-0" />
{/if}
{#if displayType}
{#if format && !format.startsWith('resource')}
<span class="text-xs italic ml-2 text-tertiary dark:text-indigo-400">
{format}
</span>
{:else}
<span class="text-xs italic ml-2 text-tertiary dark:text-indigo-400">
{type ?? 'any'}{contentEncoding && contentEncoding != ''
? `, encoding: ${contentEncoding}`
: ''}
</span>
{/if}
{/if}
{#if !emptyString(simpleTooltip)}
<Tooltip class="ml-2">
<span class="text-xs">
{simpleTooltip}
</span>
</Tooltip>
{/if}
</div>