|
|
@@ -159,6 +159,18 @@ func GetAllCloudbrainsTrend(ctx *context.Context) { |
|
|
|
ctx.Error(http.StatusBadRequest, ctx.Tr("getYearCloudbrainNum_get_error")) |
|
|
|
return |
|
|
|
} |
|
|
|
} else if queryType == "today" { |
|
|
|
beginTime = now.AddDate(0, 0, 0) |
|
|
|
beginTime = time.Date(beginTime.Year(), beginTime.Month(), beginTime.Day(), 0, 0, 0, 0, now.Location()) |
|
|
|
endTimeTemp = beginTime.Add(time.Hour) |
|
|
|
endTime = now |
|
|
|
dateCloudbrainNum, err = getHourCloudbrainNum(beginTime, endTimeTemp, endTime) |
|
|
|
if err != nil { |
|
|
|
log.Error("Can not query getHourCloudbrainNum.", err) |
|
|
|
ctx.Error(http.StatusBadRequest, ctx.Tr("getYearCloudbrainNum_get_error")) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
} else if queryType == "yesterday" { |
|
|
|
beginTime = now.AddDate(0, 0, -1) |
|
|
|
beginTime = time.Date(beginTime.Year(), beginTime.Month(), beginTime.Day(), 0, 0, 0, 0, now.Location()) |
|
|
@@ -489,10 +501,17 @@ func GetCloudbrainsDetailData(ctx *context.Context) { |
|
|
|
pageSize = 10 |
|
|
|
} |
|
|
|
|
|
|
|
// var jobTypes []string |
|
|
|
// jobTypeNot := false |
|
|
|
// if jobType == string(models.JobTypeDebug) { |
|
|
|
// jobTypes = append(jobTypes, string(models.JobTypeSnn4imagenet), string(models.JobTypeBrainScore), string(models.JobTypeDebug)) |
|
|
|
// } else if jobType != "all" && jobType != "" { |
|
|
|
// jobTypes = append(jobTypes, jobType) |
|
|
|
// } |
|
|
|
var jobTypes []string |
|
|
|
jobTypeNot := false |
|
|
|
if jobType == string(models.JobTypeDebug) { |
|
|
|
jobTypes = append(jobTypes, string(models.JobTypeSnn4imagenet), string(models.JobTypeBrainScore), string(models.JobTypeDebug)) |
|
|
|
if jobType == string(models.JobTypeBenchmark) { |
|
|
|
jobTypes = append(jobTypes, string(models.JobTypeBenchmark), string(models.JobTypeBrainScore), string(models.JobTypeSnn4imagenet)) |
|
|
|
} else if jobType != "all" && jobType != "" { |
|
|
|
jobTypes = append(jobTypes, jobType) |
|
|
|
} |
|
|
@@ -594,8 +613,8 @@ func GetCloudbrainsCreateHoursData(ctx *context.Context) { |
|
|
|
beginTime = recordBeginTime |
|
|
|
endTime = now |
|
|
|
} else if queryType == "today" { |
|
|
|
beginTime = now.AddDate(0, 0, 0) |
|
|
|
endTime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()) |
|
|
|
beginTime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()) |
|
|
|
endTime = now.AddDate(0, 0, 1) |
|
|
|
} else if queryType == "yesterday" { |
|
|
|
beginTime = now.AddDate(0, 0, -1) |
|
|
|
endTime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()) |
|
|
|