| @@ -372,6 +372,7 @@ type CloudbrainsOptions struct { | |||||
| ComputeResource string | ComputeResource string | ||||
| BeginTimeUnix int64 | BeginTimeUnix int64 | ||||
| EndTimeUnix int64 | EndTimeUnix int64 | ||||
| AiCenter string | |||||
| } | } | ||||
| type TaskPod struct { | type TaskPod struct { | ||||
| @@ -1403,6 +1404,11 @@ func Cloudbrains(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) { | |||||
| ) | ) | ||||
| } | } | ||||
| } | } | ||||
| if (opts.AiCenter) != "" { | |||||
| cond = cond.And( | |||||
| builder.Like{"cloudbrain.ai_center", opts.AiCenter}, | |||||
| ) | |||||
| } | |||||
| if (opts.IsLatestVersion) != "" { | if (opts.IsLatestVersion) != "" { | ||||
| cond = cond.And(builder.Or(builder.And(builder.Eq{"cloudbrain.is_latest_version": opts.IsLatestVersion}, builder.Eq{"cloudbrain.job_type": "TRAIN"}), builder.Neq{"cloudbrain.job_type": "TRAIN"})) | cond = cond.And(builder.Or(builder.And(builder.Eq{"cloudbrain.is_latest_version": opts.IsLatestVersion}, builder.Eq{"cloudbrain.job_type": "TRAIN"}), builder.Neq{"cloudbrain.job_type": "TRAIN"})) | ||||
| @@ -1944,6 +1950,12 @@ func CloudbrainAll(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) { | |||||
| } | } | ||||
| } | } | ||||
| if (opts.AiCenter) != "" { | |||||
| cond = cond.And( | |||||
| builder.Like{"cloudbrain.ai_center", opts.AiCenter}, | |||||
| ) | |||||
| } | |||||
| if (opts.IsLatestVersion) != "" { | if (opts.IsLatestVersion) != "" { | ||||
| cond = cond.And(builder.Or(builder.And(builder.Eq{"cloudbrain.is_latest_version": opts.IsLatestVersion}, | cond = cond.And(builder.Or(builder.And(builder.Eq{"cloudbrain.is_latest_version": opts.IsLatestVersion}, | ||||
| builder.Eq{"cloudbrain.job_type": "TRAIN"}), builder.Neq{"cloudbrain.job_type": "TRAIN"})) | builder.Eq{"cloudbrain.job_type": "TRAIN"}), builder.Neq{"cloudbrain.job_type": "TRAIN"})) | ||||
| @@ -35,6 +35,7 @@ func CloudBrains(ctx *context.Context) { | |||||
| listType := ctx.Query("listType") | listType := ctx.Query("listType") | ||||
| jobType := ctx.Query("jobType") | jobType := ctx.Query("jobType") | ||||
| jobStatus := ctx.Query("jobStatus") | jobStatus := ctx.Query("jobStatus") | ||||
| aiCenter := ctx.Query("aiCenter") | |||||
| ctx.Data["ListType"] = listType | ctx.Data["ListType"] = listType | ||||
| ctx.Data["JobType"] = jobType | ctx.Data["JobType"] = jobType | ||||
| @@ -80,6 +81,7 @@ func CloudBrains(ctx *context.Context) { | |||||
| IsLatestVersion: modelarts.IsLatestVersion, | IsLatestVersion: modelarts.IsLatestVersion, | ||||
| ComputeResource: listType, | ComputeResource: listType, | ||||
| Type: models.TypeCloudBrainAll, | Type: models.TypeCloudBrainAll, | ||||
| AiCenter: aiCenter, | |||||
| }) | }) | ||||
| if err != nil { | if err != nil { | ||||
| ctx.ServerError("Get job failed:", err) | ctx.ServerError("Get job failed:", err) | ||||
| @@ -679,6 +679,7 @@ func GetCloudbrainsDetailData(ctx *context.Context) { | |||||
| jobType := ctx.Query("jobType") | jobType := ctx.Query("jobType") | ||||
| jobStatus := ctx.Query("jobStatus") | jobStatus := ctx.Query("jobStatus") | ||||
| cloudBrainType := ctx.QueryInt("Type") | cloudBrainType := ctx.QueryInt("Type") | ||||
| aiCenter := ctx.Query("aiCenter") | |||||
| page := ctx.QueryInt("page") | page := ctx.QueryInt("page") | ||||
| pageSize := ctx.QueryInt("pagesize") | pageSize := ctx.QueryInt("pagesize") | ||||
| @@ -724,6 +725,7 @@ func GetCloudbrainsDetailData(ctx *context.Context) { | |||||
| NeedRepoInfo: true, | NeedRepoInfo: true, | ||||
| BeginTimeUnix: int64(recordBeginTime), | BeginTimeUnix: int64(recordBeginTime), | ||||
| EndTimeUnix: endTime.Unix(), | EndTimeUnix: endTime.Unix(), | ||||
| AiCenter: aiCenter, | |||||
| }) | }) | ||||
| if err != nil { | if err != nil { | ||||
| ctx.ServerError("Get job failed:", err) | ctx.ServerError("Get job failed:", err) | ||||
| @@ -761,6 +761,7 @@ func Cloudbrains(ctx *context.Context) { | |||||
| listType := ctx.Query("listType") | listType := ctx.Query("listType") | ||||
| jobType := ctx.Query("jobType") | jobType := ctx.Query("jobType") | ||||
| jobStatus := ctx.Query("jobStatus") | jobStatus := ctx.Query("jobStatus") | ||||
| aiCenter := ctx.Query("aiCenter") | |||||
| ctx.Data["ListType"] = listType | ctx.Data["ListType"] = listType | ||||
| ctx.Data["JobType"] = jobType | ctx.Data["JobType"] = jobType | ||||
| @@ -825,6 +826,7 @@ func Cloudbrains(ctx *context.Context) { | |||||
| RepoIDList: repoIDList, | RepoIDList: repoIDList, | ||||
| ComputeResource: listType, | ComputeResource: listType, | ||||
| Type: models.TypeCloudBrainAll, | Type: models.TypeCloudBrainAll, | ||||
| AiCenter: aiCenter, | |||||
| }) | }) | ||||
| if err != nil { | if err != nil { | ||||
| ctx.ServerError("Get job failed:", err) | ctx.ServerError("Get job failed:", err) | ||||