mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-28 16:02:47 +00:00
feat(frontend): Make the iterations menu work
This commit is contained in:
@@ -939,6 +939,7 @@
|
||||
}}
|
||||
on:selectedIteration={(e) => {
|
||||
let detail = e.detail
|
||||
|
||||
setModuleState(detail.moduleId, {
|
||||
selectedForloop: detail.id,
|
||||
selectedForloopIndex: detail.index
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
{#if flowJobs && !insertable}
|
||||
<div class="absolute z-10 right-8 -top-5">
|
||||
<div class="absolute z-50 right-8 -top-5">
|
||||
<FlowJobsMenu
|
||||
on:selectedIteration={(e) => {
|
||||
dispatch('selectedIteration', e.detail)
|
||||
|
||||
@@ -159,8 +159,8 @@
|
||||
move: (module, modules) => {
|
||||
dispatch('move', { module, modules })
|
||||
},
|
||||
selectIteration: (detail, moduleId) => {
|
||||
dispatch('selectIteration', { ...detail, moduleId: moduleId })
|
||||
selectedIteration: (detail, moduleId) => {
|
||||
dispatch('selectedIteration', { ...detail, moduleId: moduleId })
|
||||
}
|
||||
},
|
||||
success,
|
||||
|
||||
@@ -10,7 +10,7 @@ export type GraphEventHandlers = {
|
||||
delete: (detail, label: string) => void
|
||||
newBranch: (module: FlowModule) => void
|
||||
move: (module: FlowModule, modules: FlowModule[]) => void
|
||||
selectIteration: (detail, moduleId: string) => void
|
||||
selectedIteration: (detail, moduleId: string) => void
|
||||
}
|
||||
|
||||
export default function graphBuilder(
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<NodeToolbar isVisible position={Position.Top}>
|
||||
<NodeToolbar isVisible position={Position.Top} align="center">
|
||||
{#if data.insertable}
|
||||
<Popover>
|
||||
<button
|
||||
@@ -59,7 +59,8 @@
|
||||
{/if}
|
||||
</NodeToolbar>
|
||||
|
||||
<NodeWrapper let:darkMode>
|
||||
<NodeWrapper let:darkMode
|
||||
>s
|
||||
<VirtualItem
|
||||
label={data.label}
|
||||
modules={data.modules}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
bgColor: string
|
||||
modules: FlowModule[]
|
||||
moving: string | undefined
|
||||
duration_ms: number | undefined
|
||||
disableAi: boolean
|
||||
wrapperId: string | undefined
|
||||
retries: number | undefined
|
||||
@@ -35,8 +34,8 @@
|
||||
type = 'InProgress'
|
||||
}
|
||||
|
||||
const state = data.flowModuleStates?.[data.module.id]
|
||||
const flowJobs = state?.flow_jobs
|
||||
$: state = data.flowModuleStates?.[data.module.id]
|
||||
$: flowJobs = state?.flow_jobs
|
||||
? {
|
||||
flowJobs: state?.flow_jobs,
|
||||
selected: state?.selectedForloopIndex ?? -1,
|
||||
@@ -50,12 +49,12 @@
|
||||
mod={data.module}
|
||||
insertable={data.insertable}
|
||||
annotation={state?.flow_jobs
|
||||
? 'ierations ' + state?.flow_jobs?.length + '/' + (state?.iteration_total ?? '?')
|
||||
? 'Iterations ' + state?.flow_jobs?.length + '/' + (state?.iteration_total ?? '?')
|
||||
: ''}
|
||||
bgColor={getStateColor(type, darkMode)}
|
||||
modules={data.modules ?? []}
|
||||
moving={data.moving}
|
||||
duration_ms={data.duration_ms}
|
||||
duration_ms={state?.duration_ms}
|
||||
retries={data.retries}
|
||||
{flowJobs}
|
||||
on:delete={(e) => {
|
||||
@@ -74,7 +73,7 @@
|
||||
data.eventHandlers.select(e.detail)
|
||||
}}
|
||||
on:selectedIteration={(e) => {
|
||||
data.eventHandlers.selectIteration(e.detail, data.module.id)
|
||||
data.eventHandlers.selectedIteration(e.detail, data.module.id)
|
||||
}}
|
||||
/>
|
||||
</NodeWrapper>
|
||||
|
||||
Reference in New Issue
Block a user