feat: inner build view UI

This commit is contained in:
Jason Song
2022-10-21 17:27:07 +08:00
parent d6e100f6be
commit dee4f2470b
9 changed files with 102 additions and 122 deletions

View File

@ -84,11 +84,15 @@ func (run *Run) LoadAttributes(ctx context.Context) error {
}
func (run *Run) TakeTime() time.Duration {
if run.Started == 0 {
return 0
}
started := run.Started.AsTime()
if run.Status.IsDone() {
return run.Stopped.AsTime().Sub(started)
}
return time.Since(started)
run.Stopped.AsTime().Sub(started)
return time.Since(started).Truncate(time.Second)
}
func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) error {