mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-10 08:07:03 +00:00
* Improve UI of script record * Improve UI for scripts * Remove Result & Logs loading container while flow not finised * Improve Graph view * Add click on a step mention * Fix spacing when empty * Fix step duration disappearing in recorded flows * Modernize timeline tab * Improve Script recording result UI * feat: externalize recording player controls for fake-window embedding Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: reorder FlowViewer tab sync effects for clarity Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: eliminate tab sync effects in FlowViewer, use selectedTab directly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: remove unnecessary untrack in FlowViewer tab init Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: skip tab auto-selection when selectedTab is controlled externally Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: export recording types from package Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: non-null assertion for recording.flow in FlowGraphViewer Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: replace banned $bindable(default_value) pattern and simplify tab sync Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use svelte 5 onclick syntax on replay page Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: skip db clock endpoint during replay mode Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove line numbers from script recording code display Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: hugocasa <hugo@casademont.ch> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
71 lines
1.7 KiB
Svelte
71 lines
1.7 KiB
Svelte
<script lang="ts">
|
|
import { msToSec } from '$lib/utils'
|
|
import { base } from '$lib/base'
|
|
import { ExternalLink } from 'lucide-svelte'
|
|
import Popover from './Popover.svelte'
|
|
|
|
interface Props {
|
|
position?: 'center' | 'left' | 'right'
|
|
total: number
|
|
min: number | undefined
|
|
started_at: number | undefined
|
|
len: number
|
|
id: string
|
|
running: boolean
|
|
concat?: boolean
|
|
gray?: boolean
|
|
spacerClass?: string
|
|
}
|
|
|
|
let {
|
|
position = 'center',
|
|
total,
|
|
min,
|
|
started_at,
|
|
len,
|
|
id,
|
|
running,
|
|
concat = false,
|
|
gray = false,
|
|
spacerClass = ''
|
|
}: Props = $props()
|
|
</script>
|
|
|
|
{#if min && started_at != undefined}
|
|
{#if !concat}
|
|
<div style="width: {((started_at - min) / total) * 100}%" class="h-5 {spacerClass}"></div>
|
|
{/if}
|
|
<Popover
|
|
style="width: {(len / total) * 100}%"
|
|
class="h-5 relative {gray
|
|
? 'bg-gray-300 dark:bg-gray-600'
|
|
: running
|
|
? 'bg-blue-400/90'
|
|
: 'bg-blue-500/90'} {position == 'left'
|
|
? 'rounded-l-md'
|
|
: position == 'right'
|
|
? 'rounded-r-md'
|
|
: 'rounded-md'} center-center text-white text-2xs whitespace-nowrap hover:outline outline-1 outline-black"
|
|
>
|
|
{#snippet text()}
|
|
<a href="{base}/run/{id}" class="inline-flex items-center gap-1" target="_blank"
|
|
>{id} <ExternalLink size={14} /></a
|
|
>
|
|
{/snippet}
|
|
{#if len > 0}
|
|
{@const narrow = len / total < 0.09}
|
|
{@const endPos =
|
|
started_at != undefined && min != undefined ? (started_at - min + len) / total : 1}
|
|
{@const nearStart = endPos < 0.15}
|
|
<span
|
|
class={narrow
|
|
? nearStart
|
|
? 'absolute left-full ml-2 text-primary font-mono'
|
|
: 'absolute right-full mr-1 text-primary font-mono'
|
|
: 'font-mono'}
|
|
>{#if len}{msToSec(len, 1)}s{/if}</span
|
|
>
|
|
{/if}
|
|
</Popover>
|
|
{/if}
|