mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-10 16:05:58 +00:00
* improve arg layout * improve runs row (wip) * Add job badges * group filters in dropdown * improve runs row layout * Improve filter layout * use select for graph display * handle width modification * Remove useless headers * fix bad display when result is null * Display all jobs tags * Improve display for 'step of flow' jobs * Add empty message for JobAssetsViewer * Move job preview assets tab to flow result for flows * Only show tag in the tag column * Add job kind to rows * Add padding to the run preview * nit * move refresh on top of table * Move filters into header bar * move runs table topbar outside table * Simplify layout * Use toggle for kind for large screen * move sync job and add batch actions breakpoint * revert dropdown to toggle for conurrency/duration * handle run labels overflow * improve time display * fix flow preview with no path display * Add titles * Prevent tab shift for script and flow result * nit * Allow job deselect * Make job link more visible * Fix filtering for queued job * Fix filter not reseting after select from toggleMore * Allways show assets for flow status viewer * Update run chart to svelte 5 and fix reactivity issue * migrate concurrency chart to svelte 5 * Improve admmin workspace display and fix missing in add filter popover * nit * fix run table resize * Add breakpoint to hide tag in small screens * use a css file for gathering RunRow and RunTable classes * nit * nit * remove debug log * nit * fix typo * Have too icons for queued workers and suspended * add gap before auto-refresh * Replace min max to from to calendar picker * Add loading state for job preview * Move duration * Display kind full width when calendar not set * Only show 2 digits for jobs duration * Replace Scheduled for by a clock un the run row * Fix typpo in dropown select to dropdown select * Hide sync and previews in toggle more * Fix runs row padding * Change notification colors for queued jobs * use utils debounce function * fix typo * nit * use class instead of classNames * clean select filter side effects
129 lines
3.8 KiB
Svelte
129 lines
3.8 KiB
Svelte
<script lang="ts">
|
|
import { classNames } from '$lib/utils'
|
|
import { createEventDispatcher } from 'svelte'
|
|
import { twMerge } from 'tailwind-merge'
|
|
import Tooltip from './Tooltip.svelte'
|
|
import { AlertTriangle } from 'lucide-svelte'
|
|
import { triggerableByAI } from '$lib/actions/triggerableByAI.svelte'
|
|
|
|
export let options: {
|
|
left?: string
|
|
leftTooltip?: string
|
|
right?: string
|
|
rightTooltip?: string
|
|
rightDocumentationLink?: string
|
|
title?: string
|
|
} = {}
|
|
export let checked: boolean = false
|
|
export let disabled = false
|
|
export let textClass = ''
|
|
export let textStyle = ''
|
|
export let color: 'blue' | 'red' | 'nord' = 'blue'
|
|
export let id = (Math.random() + 1).toString(36).substring(10)
|
|
export let lightMode: boolean = false
|
|
export let eeOnly: boolean = false
|
|
export let aiId: string | undefined = undefined
|
|
export let aiDescription: string | undefined = undefined
|
|
|
|
export let size: 'sm' | 'xs' | '2xs' | '2sm' = 'sm'
|
|
|
|
const dispatch = createEventDispatcher<{ change: boolean }>()
|
|
const bothOptions = Boolean(options.left) && Boolean(options.right)
|
|
|
|
export let textDisabled = false
|
|
</script>
|
|
|
|
<label
|
|
for={id}
|
|
class="{$$props.class || ''} z-auto flex flex-row items-center duration-50 {disabled
|
|
? 'grayscale opacity-50'
|
|
: 'cursor-pointer'}"
|
|
title={options?.title}
|
|
>
|
|
{#if Boolean(options?.left)}
|
|
<span
|
|
class={twMerge(
|
|
'mr-2 font-medium duration-50 select-none',
|
|
bothOptions || textDisabled ? (checked ? 'text-disabled' : 'text-primary') : 'text-primary',
|
|
size === 'xs' || size === '2sm' ? 'text-xs' : size === '2xs' ? 'text-[0.5rem]' : 'text-sm',
|
|
textClass
|
|
)}
|
|
style={textStyle}
|
|
>
|
|
{options?.left}
|
|
{#if options?.leftTooltip}
|
|
<Tooltip light={lightMode}>{options?.leftTooltip}</Tooltip>
|
|
{/if}
|
|
</span>
|
|
{/if}
|
|
|
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
<div
|
|
class="relative"
|
|
on:click|stopPropagation
|
|
use:triggerableByAI={{
|
|
id: aiId,
|
|
description: aiDescription,
|
|
callback: () => {
|
|
checked = !checked
|
|
}
|
|
}}
|
|
>
|
|
<input
|
|
on:focus
|
|
on:click
|
|
{disabled}
|
|
type="checkbox"
|
|
{id}
|
|
class="sr-only peer"
|
|
bind:checked
|
|
on:change|stopPropagation={(e) => {
|
|
dispatch('change', checked)
|
|
}}
|
|
/>
|
|
<div
|
|
class={classNames(
|
|
"transition-all bg-surface-selected rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:bg-surface after:border-white after:border after:rounded-full after:transition-all items-center",
|
|
color == 'red'
|
|
? 'peer-checked:bg-red-600'
|
|
: color == 'blue'
|
|
? 'peer-checked:bg-blue-600 dark:peer-checked:bg-blue-500'
|
|
: 'peer-checked:bg-nord-950 dark:peer-checked:bg-nord-400',
|
|
size === 'sm'
|
|
? 'w-11 h-6 after:top-0.5 after:left-[2px] after:h-5 after:w-5'
|
|
: size === '2sm'
|
|
? 'w-9 h-5 after:top-0.5 after:left-[2px] after:h-4 after:w-4'
|
|
: size === '2xs'
|
|
? 'w-5 h-3 after:top-0.5 after:left-[2px] after:h-2 after:w-2'
|
|
: 'w-7 h-4 after:top-0.5 after:left-[2px] after:h-3 after:w-3'
|
|
)}
|
|
></div>
|
|
</div>
|
|
{#if Boolean(options?.right)}
|
|
<span
|
|
class={twMerge(
|
|
'ml-2 font-medium duration-50 select-none',
|
|
bothOptions || textDisabled ? (checked ? 'text-primary' : 'text-disabled') : 'text-primary',
|
|
size === 'xs' || size === '2sm' ? 'text-xs' : size === '2xs' ? 'text-xs' : 'text-sm',
|
|
textClass
|
|
)}
|
|
style={textStyle}
|
|
>
|
|
{options?.right}
|
|
{#if options?.rightTooltip}
|
|
<Tooltip documentationLink={options.rightDocumentationLink}>
|
|
{options.rightTooltip}
|
|
</Tooltip>
|
|
{/if}
|
|
</span>
|
|
{/if}
|
|
<slot name="right" />
|
|
</label>
|
|
{#if eeOnly && disabled}
|
|
<span class="inline-flex text-xs items-center gap-1 !text-yellow-500 whitespace-nowrap ml-8">
|
|
<AlertTriangle size={16} />
|
|
EE only <Tooltip>Enterprise Edition only feature</Tooltip>
|
|
</span>
|
|
{/if}
|