|
@@ -350,19 +350,15 @@ func CloudBrainShow(ctx *context.Context) { |
|
|
|
|
|
|
|
|
func cloudBrainShow(ctx *context.Context, tpName base.TplName) { |
|
|
func cloudBrainShow(ctx *context.Context, tpName base.TplName) { |
|
|
ctx.Data["PageIsCloudBrain"] = true |
|
|
ctx.Data["PageIsCloudBrain"] = true |
|
|
|
|
|
|
|
|
var jobName = ctx.Params(":jobname") |
|
|
var jobName = ctx.Params(":jobname") |
|
|
task, err := models.GetCloudbrainByName(jobName) |
|
|
task, err := models.GetCloudbrainByName(jobName) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
ctx.Data["error"] = err.Error() |
|
|
ctx.Data["error"] = err.Error() |
|
|
} |
|
|
} |
|
|
log.Info("task.JobID=" + task.JobID) |
|
|
|
|
|
result, err := cloudbrain.GetJob(task.JobID) |
|
|
result, err := cloudbrain.GetJob(task.JobID) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
ctx.Data["error"] = err.Error() |
|
|
ctx.Data["error"] = err.Error() |
|
|
} |
|
|
} |
|
|
accuracyJson, _ := json.Marshal(result) |
|
|
|
|
|
log.Info(" task result=" + string(accuracyJson)) |
|
|
|
|
|
if result != nil { |
|
|
if result != nil { |
|
|
jobRes, _ := models.ConvertToJobResultPayload(result.Payload) |
|
|
jobRes, _ := models.ConvertToJobResultPayload(result.Payload) |
|
|
jobRes.Resource.Memory = strings.ReplaceAll(jobRes.Resource.Memory, "Mi", "MB") |
|
|
jobRes.Resource.Memory = strings.ReplaceAll(jobRes.Resource.Memory, "Mi", "MB") |
|
|