@@ -80,7 +80,7 @@ impl TaskInstanceModel {
80
80
pub fn mark_task_instance ( & mut self , task_id : & str , status : & str ) {
81
81
self . filtered . items . iter_mut ( ) . for_each ( |task_instance| {
82
82
if task_instance. task_id == task_id {
83
- task_instance. state = status. to_string ( ) ;
83
+ task_instance. state = Some ( status. to_string ( ) ) ;
84
84
}
85
85
} ) ;
86
86
}
@@ -295,14 +295,20 @@ impl Widget for &mut TaskInstanceModel {
295
295
} else {
296
296
"None" . to_string( )
297
297
} ) ,
298
- Line :: from( match item. state. as_str( ) {
299
- "success" => state_to_colored_square( AirflowStateColor :: Success ) ,
300
- "running" => state_to_colored_square( AirflowStateColor :: Running ) ,
301
- "failed" => state_to_colored_square( AirflowStateColor :: Failed ) ,
302
- "queued" => state_to_colored_square( AirflowStateColor :: Queued ) ,
303
- "up_for_retry" => state_to_colored_square( AirflowStateColor :: UpForRetry ) ,
304
- "upstream_failed" => state_to_colored_square( AirflowStateColor :: UpstreamFailed ) ,
305
- _ => state_to_colored_square( AirflowStateColor :: None ) ,
298
+ Line :: from( if let Some ( state) = & item. state {
299
+ match state. as_str( ) {
300
+ "success" => state_to_colored_square( AirflowStateColor :: Success ) ,
301
+ "running" => state_to_colored_square( AirflowStateColor :: Running ) ,
302
+ "failed" => state_to_colored_square( AirflowStateColor :: Failed ) ,
303
+ "queued" => state_to_colored_square( AirflowStateColor :: Queued ) ,
304
+ "up_for_retry" => state_to_colored_square( AirflowStateColor :: UpForRetry ) ,
305
+ "upstream_failed" => {
306
+ state_to_colored_square( AirflowStateColor :: UpstreamFailed )
307
+ }
308
+ _ => state_to_colored_square( AirflowStateColor :: None ) ,
309
+ }
310
+ } else {
311
+ state_to_colored_square( AirflowStateColor :: None )
306
312
} ) ,
307
313
Line :: from( format!( "{:?}" , item. try_number) ) ,
308
314
] )
0 commit comments