diff --git a/models/dataset.go b/models/dataset.go index e841261c7..d3a142742 100755 --- a/models/dataset.go +++ b/models/dataset.go @@ -155,10 +155,6 @@ func SearchDatasetCondition(opts *SearchDatasetOptions) builder.Cond { if opts.RepoID > 0 { cond = cond.And(builder.Eq{"dataset.repo_id": opts.RepoID}) } - if opts.RecommendOnly { - cond = cond.And(builder.Eq{"dataset.recommend": opts.RecommendOnly}) - } - if opts.IncludePublic { cond = cond.And(builder.Eq{"dataset.status": DatasetStatusPublic}) cond = cond.And(builder.Eq{"attachment.is_private": false}) @@ -197,6 +193,10 @@ func generateFilterCond(opts *SearchDatasetOptions, cond builder.Cond) builder.C cond = cond.And(builder.Eq{"dataset.license": opts.License}) } + if opts.RecommendOnly { + cond = cond.And(builder.Eq{"dataset.recommend": opts.RecommendOnly}) + } + return cond } diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 4ef205af2..b3b07f352 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -40,13 +40,11 @@ const ( tplCloudBrainBenchmarkNew base.TplName = "repo/cloudbrain/benchmark/new" tplCloudBrainBenchmarkShow base.TplName = "repo/cloudbrain/benchmark/show" - tplCloudBrainImageSubmit base.TplName = "repo/cloudbrain/image/submit" - tplCloudBrainImageEdit base.TplName = "repo/cloudbrain/image/edit" - + tplCloudBrainImageSubmit base.TplName = "repo/cloudbrain/image/submit" + tplCloudBrainImageEdit base.TplName = "repo/cloudbrain/image/edit" tplCloudBrainTrainJobNew base.TplName = "repo/cloudbrain/trainjob/new" tplCloudBrainTrainJobShow base.TplName = "repo/cloudbrain/trainjob/show" - ) var ( @@ -601,6 +599,7 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo ctx.Data["dataset_path"] = cloudbrain.DataSetMountPath ctx.Data["model_path"] = cloudbrain.ModelMountPath ctx.Data["canDownload"] = cloudbrain.CanModifyJob(ctx, task) + ctx.Data["branchName"] = task.BranchName ctx.HTML(200, tpName) } @@ -1402,11 +1401,11 @@ func SyncCloudbrainStatus() { maxDuration = setting.MaxDuration } - if task.Duration >= maxDuration { - log.Info("begin to stop job(%s), because of the duration", task.JobName) + if task.Duration >= maxDuration && task.JobType != string(models.JobTypeTrain) { + log.Info("begin to stop job(%s), because of the duration", task.DisplayJobName) err = cloudbrain.StopJob(task.JobID) if err != nil { - log.Error("StopJob(%s) failed:%v", task.JobName, err) + log.Error("StopJob(%s) failed:%v", task.DisplayJobName, err) continue } task.Status = string(models.JobStopped) @@ -1416,7 +1415,8 @@ func SyncCloudbrainStatus() { task.ComputeAndSetDuration() err = models.UpdateJob(task) if err != nil { - log.Error("UpdateJob(%s) failed:%v", task.JobName, err) + log.Error("UpdateJob(%s) failed:%v", task.DisplayJobName, err) + continue } } } diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 35f2e89d0..81e1664a4 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -51,6 +51,9 @@ const ( func DebugJobIndex(ctx *context.Context) { listType := ctx.Query("debugListType") + if listType == "" { + listType = models.AllResource + } ctx.Data["ListType"] = listType MustEnableCloudbrain(ctx) repo := ctx.Repo.Repository diff --git a/templates/admin/cloudbrain/images.html b/templates/admin/cloudbrain/images.tmpl similarity index 100% rename from templates/admin/cloudbrain/images.html rename to templates/admin/cloudbrain/images.tmpl diff --git a/templates/repo/cloudbrain/show.tmpl b/templates/repo/cloudbrain/show.tmpl index 5fabaa937..932a588c3 100755 --- a/templates/repo/cloudbrain/show.tmpl +++ b/templates/repo/cloudbrain/show.tmpl @@ -56,7 +56,7 @@ margin:10px 5px ; } .tab_2_content { - min-height: 380px; + min-height: 420px; margin-left: 10px; } .ac-grid { @@ -291,6 +291,16 @@ td, th {
' + data.Content) + $(`.message${version_name} #header`).text('您已翻阅至日志顶部') + $(`.message${version_name}`).css('display', 'block') + setTimeout(function(){ + $(`.message${version_name}`).css('display', 'none') + }, 1000) scrollAnimation(logContentDom, logContentDom.scrollTop, 0); }) }) - $('.log_bottom').click(function(){ - - let logContentDom = document.querySelector('.log') - let version_name = $('.log_bottom').data('version') - console.log($(`#log${version_name}`).siblings('pre')) + $('.log_bottom').click(function(e){ + let version_name = $(this).data('version') + let logContentDom = document.querySelector(`#log${version_name}`) $(`#log_file${version_name}`).siblings('pre').remove() $.get(`/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/log?version_name=${version_name}&base_line=&lines=50&order=desc`, (data) => { diff --git a/web_src/js/components/images/adminImages.vue b/web_src/js/components/images/adminImages.vue index 3b372114c..417d4e530 100644 --- a/web_src/js/components/images/adminImages.vue +++ b/web_src/js/components/images/adminImages.vue @@ -22,7 +22,7 @@全部 公开 -私有 +私有