mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Add step start time to ViewStepLog (#24980)
				
					
				
			Part of #24876 According to https://github.com/go-gitea/gitea/pull/24876#discussion_r1205565622 , we need the start time of the step to get the log time offset.
This commit is contained in:
		@@ -106,9 +106,10 @@ type ViewJobStep struct {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type ViewStepLog struct {
 | 
					type ViewStepLog struct {
 | 
				
			||||||
	Step   int                `json:"step"`
 | 
						Step    int                `json:"step"`
 | 
				
			||||||
	Cursor int64              `json:"cursor"`
 | 
						Cursor  int64              `json:"cursor"`
 | 
				
			||||||
	Lines  []*ViewStepLogLine `json:"lines"`
 | 
						Lines   []*ViewStepLogLine `json:"lines"`
 | 
				
			||||||
 | 
						Started int64              `json:"started"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type ViewStepLogLine struct {
 | 
					type ViewStepLogLine struct {
 | 
				
			||||||
@@ -241,9 +242,10 @@ func ViewPost(ctx *context_module.Context) {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			resp.Logs.StepsLog = append(resp.Logs.StepsLog, &ViewStepLog{
 | 
								resp.Logs.StepsLog = append(resp.Logs.StepsLog, &ViewStepLog{
 | 
				
			||||||
				Step:   cursor.Step,
 | 
									Step:    cursor.Step,
 | 
				
			||||||
				Cursor: cursor.Cursor + int64(len(logLines)),
 | 
									Cursor:  cursor.Cursor + int64(len(logLines)),
 | 
				
			||||||
				Lines:  logLines,
 | 
									Lines:   logLines,
 | 
				
			||||||
 | 
									Started: int64(step.Started),
 | 
				
			||||||
			})
 | 
								})
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user