mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-07 08:02:40 +00:00
50 lines
1.2 KiB
Svelte
50 lines
1.2 KiB
Svelte
<script lang="ts">
|
|
import { JobService, type QueuedJob } from '$lib/gen'
|
|
import { workspaceStore } from '$lib/stores'
|
|
import { ExternalLink } from 'lucide-svelte'
|
|
import Skeleton from '../common/skeleton/Skeleton.svelte'
|
|
import { displayDate } from '$lib/utils'
|
|
|
|
let jobs: QueuedJob[] | undefined = undefined
|
|
export let allWorkspaces: boolean = false
|
|
|
|
getQueuedJobs()
|
|
async function getQueuedJobs() {
|
|
jobs = await JobService.listQueue({
|
|
workspace: $workspaceStore ?? '',
|
|
scheduledForBeforeNow: true,
|
|
suspended: false,
|
|
running: false,
|
|
allWorkspaces
|
|
})
|
|
}
|
|
</script>
|
|
|
|
{#if jobs == undefined}
|
|
<Skeleton
|
|
layout={[
|
|
[2, 2],
|
|
[2, 2]
|
|
]}
|
|
/>
|
|
{:else}
|
|
<div class="flex flex-col gap-2 text-sm">
|
|
{#if jobs.length > 100}
|
|
<div class="text-secondary text-xs">Only showing the first 100 jobs</div>
|
|
{/if}
|
|
|
|
{#each jobs.slice(0, 1000) as job}
|
|
<div class="flex">
|
|
<a
|
|
target="_blank"
|
|
href={`/run/${job.id}?workspace=${job.workspace_id}`}
|
|
class="flex flex-row gap-2 items-center font-mono mr-8"
|
|
>{job.id} <ExternalLink size={10} />
|
|
</a>
|
|
<div class="w-32">{displayDate(job.created_at)}</div>
|
|
<div class="text-2xs text-primary">tag: {job.tag}</div>
|
|
</div>
|
|
{/each}
|
|
</div>
|
|
{/if}
|