@@ -74,7 +74,7 @@ export function useRete<T extends { destroy(): void }>(
74
74
75
75
function WorkGraphGraph ( ) {
76
76
const { pk } = useParams ( ) ;
77
- const [ workgraphData , setWorktreeData ] = useState ( { summary : { } , nodes : { } , links : [ ] , logs : [ ] , pk : [ ] } ) ;
77
+ const [ workgraphData , setWorktreeData ] = useState ( { summary : { } , nodes : { } , links : [ ] , pk : [ ] } ) ;
78
78
const [ ref , editor ] = useRete ( createEditor , workgraphData ) ;
79
79
const [ selectedNode , setSelectedNode ] = useState ( { metadata : [ ] , executor : '' } ) ;
80
80
const [ showNodeDetails , setShowNodeDetails ] = useState ( false ) ;
@@ -111,20 +111,24 @@ function WorkGraphGraph() {
111
111
if ( nodeName && nodeName in stateData ) {
112
112
const nodeState = stateData [ nodeName ] . state ;
113
113
if ( nodeState === 'FINISHED' ) {
114
- titleElement . style . background = 'green' ;
114
+ titleElement . style . background = 'green' ;
115
115
} else if ( nodeState === 'RUNNING' ) {
116
- titleElement . style . background = 'orange' ;
116
+ titleElement . style . background = 'orange' ;
117
117
} else if ( nodeState === 'CREATED' ) {
118
- titleElement . style . background = 'blue' ;
118
+ titleElement . style . background = 'blue' ;
119
+ } else if ( nodeState === 'PLANNED' ) {
120
+ titleElement . style . background = 'gray' ;
119
121
} else if ( nodeState === 'WAITING' ) {
120
- titleElement . style . background = 'purple' ; // Change to the desired color for "waiting"
122
+ titleElement . style . background = 'purple' ; // Change to the desired color for "waiting"
121
123
} else if ( nodeState === 'KILLED' ) {
122
- titleElement . style . background = 'red' ; // Change to the desired color for "killed"
123
- // } else if (nodeState === 'PAUSED') {
124
- // titleElement.style.background = 'purple'; // Change to the desired color for "paused"
124
+ titleElement . style . background = 'pink' ; // Change to the desired color for "killed"
125
+ } else if ( nodeState === 'PAUSED' ) {
126
+ titleElement . style . background = 'yellow' ; // Change to the desired color for "paused"
127
+ } else if ( nodeState === 'FAILED' ) {
128
+ titleElement . style . background = 'red' ; // Change to the desired color for "failed"
125
129
} else {
126
- // Handle any other states or provide a default color
127
- titleElement . style . background = 'gray ' ; // Change to the desired default color
130
+ // Handle any other states or provide a default color
131
+ titleElement . style . background = 'lightblue ' ; // Change to the desired default color
128
132
}
129
133
}
130
134
}
@@ -253,7 +257,7 @@ function WorkGraphGraph() {
253
257
< Button onClick = { ( ) => setSelectedView ( 'Time' ) } > Time</ Button >
254
258
</ TopMenu >
255
259
{ selectedView === 'Summary' && < WorktreeSummary summary = { workgraphData . summary } /> }
256
- { selectedView === 'Log' && < WorkGraphLog logs = { workgraphData . logs } /> }
260
+ { selectedView === 'Log' && < WorkGraphLog id = { pk } /> }
257
261
{ selectedView === 'Time' && < NodeDurationGraph id = { pk } /> }
258
262
< EditorWrapper visible = { selectedView === 'Editor' } >
259
263
< WorkGraphIndicator parentWorktrees = { workgraphHierarchy } />
0 commit comments