From e5a657eb3995720d1bb7195a134eb278cc5a0133 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Tue, 22 Feb 2022 09:39:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=AE=AD=E7=BB=83=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=A4=9A=E7=89=88=E6=9C=AC=E4=B8=8D=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/cloudbrain.go | 4 +--- routers/admin/cloudbrains.go | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 74fab171c..a51b2c091 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -1075,9 +1075,7 @@ func Cloudbrains(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) { } if (opts.IsLatestVersion) != "" { - cond = cond.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"})) } if len(opts.CloudbrainIDs) > 0 { diff --git a/routers/admin/cloudbrains.go b/routers/admin/cloudbrains.go index 471902097..1cf5ca256 100644 --- a/routers/admin/cloudbrains.go +++ b/routers/admin/cloudbrains.go @@ -74,13 +74,14 @@ func CloudBrains(ctx *context.Context) { Page: page, PageSize: setting.UI.IssuePagingNum, }, - Keyword: keyword, - Type: debugType, - JobTypeNot: jobTypeNot, - JobStatusNot: jobStatusNot, - JobStatus: jobStatuses, - JobTypes: jobTypes, - NeedRepoInfo: true, + Keyword: keyword, + Type: debugType, + JobTypeNot: jobTypeNot, + JobStatusNot: jobStatusNot, + JobStatus: jobStatuses, + JobTypes: jobTypes, + NeedRepoInfo: true, + IsLatestVersion: modelarts.IsLatestVersion, }) if err != nil { ctx.ServerError("Get job failed:", err) @@ -120,8 +121,9 @@ func DownloadCloudBrains(ctx *context.Context) { Page: page, PageSize: 1, }, - Type: modelarts.DebugType, - NeedRepoInfo: false, + Type: modelarts.DebugType, + NeedRepoInfo: false, + IsLatestVersion: modelarts.IsLatestVersion, }) if err != nil {