Files
windmill/frontend/src/lib/components/graph/model.ts
Guilhem 6b949bb731 fix(frontend): improve runs detail page (#7694)
* separate flow and status with splitpane

* fix autoscroll behavior

* Flow log viewer nit

* not graph viewer

* Improve flow job result

* Create job detail header to replace metadata

* Remove FlowPreviewResult

* Create compact job header

* Use job header in runs page

* Improve runs page run preview

* Use flow header in detail section

* Show logs for script steps

* Clean old schedule status

* Limit result height

* Script run detail improvement

* Script run preview improvement

* Fix csv table overflow

* surface tertiary as background for Inputs

* nit

* Improve runs detail skeleton

* fix check

* nit

* Improve node definition

* fix flow module component overflow

* Use component DataTable for flow schema viewer

* Add language icon to step detail

* improve run header

* Improve Job detail header

* nit

* restore isOwner logic

* Handle resume flows

* restore execution status in run preview

* restore flow execution status in the preview

* flow preview, add status bar

* nit module status

* nit

* Remove flor preview result

* nit

* nit

* fix flow result card

* nit

* nit

* nit

* improve field selection on runs detail based on job type

* Improve column layout

* create JobStatusIcon component

* remove job status badge icons

* improve compact version

* use shared job field display

* improve job detail field display

* fix badge alignment

* increase padding

* nit

* nit

* improve compact display

* make background darker for metadata

* use auto layout

* fix auto layout

* improve display

* fix truncate logic

* fix compact

* improve flex adaptibility

* improve responsive layout

* improve extra compact header

* nit

* remove unused icons

* nit

* Improve flow result display

* nit

* merge progressbar and execution status

* handle canceled flow better
2026-02-03 17:20:35 +00:00

85 lines
2.0 KiB
TypeScript

import type { FlowStatusModule, Job } from '$lib/gen'
import type { StateStore } from '$lib/utils'
import type { FlowState } from '../flows/flowState'
export type ModuleHost = 'workspace' | 'inline' | 'hub'
export type Loop = {
type: 'loop'
items: NestedNodes
}
export type Branch = {
node: Node
nodeEnd: Node
type: 'branch'
items: NestedNodes[]
}
export type GraphItem = Node | Loop | Branch
export type GraphModuleStates = {
job_id: string
states: Record<string, GraphModuleState>
}
export type DurationStatus = {
byJob: Record<string, { created_at?: number; started_at?: number; duration_ms?: number }>
}
export type FlowStatusViewerContext = {
flowState?: FlowState
retryStatus: StateStore<Record<string, number | undefined>>
suspendStatus: StateStore<Record<string, { nb: number; job: Job }>>
hideDownloadInGraph?: boolean
hideTimeline?: boolean
hideNodeDefinition?: boolean
hideJobId?: boolean
hideDownloadLogs?: boolean
}
export type GraphModuleState = {
type: FlowStatusModule['type']
args: any
logs?: string
flow_jobs_results?: any
branchChosen?: number
result?: any
tag?: string
scheduled_for?: Date
job_id?: string
parent_module?: string
selectedForloop?: string
selectedForloopIndex?: number
selectedForLoopSetManually?: boolean
flow_jobs_success?: (boolean | undefined)[]
flow_jobs_duration?: {
started_at?: (string | undefined)[]
duration_ms?: (number | undefined)[]
}
flow_jobs?: string[]
iteration_total?: number
retries?: number
duration_ms?: number
started_at?: number
suspend_count?: number
isListJob?: boolean
skipped?: boolean
agent_actions?: FlowStatusModule['agent_actions']
script_hash?: string
}
export type NestedNodes = GraphItem[]
export function isNode(item: GraphItem | NestedNodes | undefined): item is Node {
return item?.['type'] === 'node'
}
export function isLoop(item: GraphItem | NestedNodes | undefined): item is Loop {
return item?.['type'] === 'loop'
}
export function isBranch(item: GraphItem | NestedNodes | undefined): item is Branch {
return item?.['type'] === 'branch'
}