File tree 3 files changed +15
-5
lines changed
3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,11 @@ export const useNotebookStatus = (
124
124
const events = useWatchNotebookEvents ( notebook . metadata . namespace , podUid , spawnInProgress ) ;
125
125
126
126
const annotationTime = notebook ?. metadata . annotations ?. [ 'notebooks.kubeflow.org/last-activity' ] ;
127
- const lastActivity = annotationTime ? new Date ( annotationTime ) : null ;
127
+ const lastActivity = annotationTime
128
+ ? new Date ( annotationTime )
129
+ : spawnInProgress || podUid
130
+ ? new Date ( notebook . metadata . creationTimestamp ?? 0 )
131
+ : null ;
128
132
129
133
if ( ! lastActivity ) {
130
134
// Notebook not started, we don't have a filter time, ignore
Original file line number Diff line number Diff line change @@ -284,6 +284,7 @@ type K8sMetadata = {
284
284
uid ?: string ;
285
285
labels ?: { [ key : string ] : string } ;
286
286
annotations ?: { [ key : string ] : string } ;
287
+ creationTimestamp ?: string ;
287
288
} ;
288
289
289
290
/**
Original file line number Diff line number Diff line change @@ -330,10 +330,15 @@ export const useNotebookStatus = (
330
330
evt . involvedObject . uid === currentUserNotebookPodUID ,
331
331
) ;
332
332
333
- const lastActivity = useLastActivity (
334
- open ,
335
- notebook ?. metadata . annotations ?. [ 'notebooks.kubeflow.org/last-activity' ] ,
336
- ) ;
333
+ const lastActivity =
334
+ useLastActivity (
335
+ open ,
336
+ notebook ?. metadata . annotations ?. [ 'notebooks.kubeflow.org/last-activity' ] ,
337
+ ) ||
338
+ ( notebook && ( spawnInProgress || isNotebookRunning )
339
+ ? new Date ( notebook . metadata . creationTimestamp ?? 0 )
340
+ : null ) ;
341
+
337
342
if ( ! lastActivity ) {
338
343
// Notebook not started, we don't have a filter time, ignore
339
344
return [ null , [ ] ] ;
You can’t perform that action at this time.
0 commit comments