reduce default nb of jobs on runs page

This commit is contained in:
Ruben Fiszel
2023-08-20 11:51:07 +02:00
parent 6ef55616e5
commit 3fc465cff6
3 changed files with 24 additions and 16 deletions
@@ -13,7 +13,7 @@
import Tabs from './common/tabs/Tabs.svelte'
import { FlowGraph, type GraphModuleState } from './graph'
import ModuleStatus from './ModuleStatus.svelte'
import { displayDate, emptyString, isOwner, pluralize, truncateRev } from '$lib/utils'
import { emptyString, isOwner, pluralize, truncateRev } from '$lib/utils'
import JobArgs from './JobArgs.svelte'
import { Loader2 } from 'lucide-svelte'
import FlowStatusWaitingForEvents from './FlowStatusWaitingForEvents.svelte'
@@ -107,7 +107,7 @@
}).then((job) => {
localFlowModuleStates[mod.id ?? ''] = {
type: mod.type,
scheduled_for: 'scheduled for ' + displayDate(job?.['scheduled_for'], true),
scheduled_for: job?.['scheduled_for'],
job_id: job?.id,
parent_module: mod['parent_module'],
args: job?.args
@@ -481,7 +481,7 @@
{/if}
{:else if node}
<div class="px-2 flex gap-2 min-w-0">
<ModuleStatus type={node.type} scheduled_for={node['scheduled_for']} />
<ModuleStatus type={node.type} scheduled_for={node.scheduled_for} />
{#if node.job_id}
<div class="truncate min-w-1/2"
><div class=" text-primary whitespace-nowrap truncate">
@@ -3,9 +3,11 @@
import { faHourglassHalf } from '@fortawesome/free-solid-svg-icons'
import { Icon } from 'svelte-awesome'
import { Badge } from './common'
import { forLater } from '$lib/forLater'
import { displayDate } from '$lib/utils'
export let type: FlowStatusModule.type
export let scheduled_for: string | undefined
export let scheduled_for: Date | undefined
</script>
{#if type == FlowStatusModule.type.WAITING_FOR_EVENTS}
@@ -21,10 +23,10 @@
{:else if type == FlowStatusModule.type.WAITING_FOR_EXECUTOR}
<span class="italic text-tertiary">
<Icon data={faHourglassHalf} class="mr-2" />
{#if scheduled_for}
Job has been {scheduled_for} and will be executed after that time
{#if scheduled_for && forLater(scheduled_for.toString())}
Job is scheduled to be executed at {displayDate(scheduled_for, true)}
{:else}
Job is waiting to be executed
Job is waiting for an executor
{/if}
</span>
{:else if type == FlowStatusModule.type.SUCCESS}
+15 -9
View File
@@ -1,19 +1,25 @@
import type { FlowStatusModule } from "$lib/gen"
import type { UserNodeType } from "./svelvet/types";
import type { FlowStatusModule } from '$lib/gen'
import type { UserNodeType } from './svelvet/types'
export type ModuleHost = 'workspace' | 'inline' | 'hub'
export type Node = UserNodeType & { parentIds: string[], edgeLabel?: string, host?: ModuleHost, type: 'node', loopDepth: number }
export type Node = UserNodeType & {
parentIds: string[]
edgeLabel?: string
host?: ModuleHost
type: 'node'
loopDepth: number
}
export type Loop = {
type: 'loop',
type: 'loop'
items: NestedNodes
}
export type Branch = {
node: Node,
nodeEnd: Node,
type: 'branch',
node: Node
nodeEnd: Node
type: 'branch'
items: NestedNodes[]
}
@@ -24,7 +30,7 @@ export type GraphModuleState = {
args: any
logs?: string
result?: any
scheduled_for?: string
scheduled_for?: Date
job_id?: string
parent_module?: string
iteration_total?: number
@@ -43,4 +49,4 @@ export function isLoop(item: GraphItem | NestedNodes | undefined): item is Loop
export function isBranch(item: GraphItem | NestedNodes | undefined): item is Branch {
return item?.['type'] === 'branch'
}
}