mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-05 08:02:18 +00:00
improve flow status viewer
This commit is contained in:
@@ -608,28 +608,36 @@
|
||||
if (clicked && state?.selectedForloop) {
|
||||
await globalRefreshes?.[modId]?.(true, state.selectedForloop)
|
||||
}
|
||||
if (state) {
|
||||
let manualOnce = state.selectedForLoopSetManually
|
||||
if (
|
||||
clicked ||
|
||||
(!manualOnce &&
|
||||
(state == undefined || !isForloop || j >= (state.selectedForloopIndex ?? -1)))
|
||||
) {
|
||||
let setManually = clicked || manualOnce
|
||||
let manualOnce = state?.selectedForLoopSetManually
|
||||
if (
|
||||
clicked ||
|
||||
(!manualOnce &&
|
||||
(state == undefined || !isForloop || j >= (state.selectedForloopIndex ?? -1)))
|
||||
) {
|
||||
let setManually = clicked || manualOnce
|
||||
|
||||
let newState = {
|
||||
...(state ?? {}),
|
||||
selectedForloop: id,
|
||||
selectedForloopIndex: j,
|
||||
selectedForLoopSetManually: setManually
|
||||
}
|
||||
if (!deepEqual(state, newState)) {
|
||||
globalState?.update((topLevelModuleStates) => {
|
||||
topLevelModuleStates[modId] = newState
|
||||
return topLevelModuleStates
|
||||
// clicked && callGlobRefresh(modId, {index: j, job: id, selectedManually: setManually ?? false})
|
||||
})
|
||||
}
|
||||
let newState = {
|
||||
...(state ?? {}),
|
||||
selectedForloop: id,
|
||||
selectedForloopIndex: j,
|
||||
selectedForLoopSetManually: setManually
|
||||
}
|
||||
|
||||
const selectedNotEqual =
|
||||
id != state?.selectedForloop ||
|
||||
j != state?.selectedForloopIndex ||
|
||||
setManually != state?.selectedForLoopSetManually
|
||||
if (selectedNotEqual) {
|
||||
console.log('not equal')
|
||||
globalState?.update((topLevelModuleStates) => {
|
||||
topLevelModuleStates[modId] = {
|
||||
type: 'WaitingForPriorSteps',
|
||||
args: {},
|
||||
...newState
|
||||
}
|
||||
return topLevelModuleStates
|
||||
// clicked && callGlobRefresh(modId, {index: j, job: id, selectedManually: setManually ?? false})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -219,17 +219,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
// let lastModules = structuredClone(modules)
|
||||
// $: modules && onModulesChange2(modules)
|
||||
let lastModules = structuredClone(modules)
|
||||
let newModules = modules
|
||||
$: modules && onModulesChange2(modules)
|
||||
|
||||
// function onModulesChange2(modules) {
|
||||
// if (!deepEqual(modules, lastModules) || true) {
|
||||
// lastModules = structuredClone(modules)
|
||||
// }
|
||||
// }
|
||||
function onModulesChange2(modules) {
|
||||
if (!deepEqual(modules, lastModules)) {
|
||||
lastModules = structuredClone(modules)
|
||||
newModules = modules
|
||||
}
|
||||
}
|
||||
|
||||
$: graph = graphBuilder(
|
||||
modules,
|
||||
newModules,
|
||||
{
|
||||
disableAi,
|
||||
insertable,
|
||||
|
||||
@@ -54,6 +54,7 @@ export function graphBuilder(
|
||||
edges: Edge[]
|
||||
error?: string | undefined
|
||||
} {
|
||||
console.debug('Building graph')
|
||||
const nodes: Node[] = []
|
||||
const edges: Edge[] = []
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user