From 59058c933715a31c56d29dce0e7325ef415fc2dc Mon Sep 17 00:00:00 2001 From: liuzx Date: Fri, 25 Feb 2022 11:25:43 +0800 Subject: [PATCH 1/7] fix-bug --- routers/repo/cloudbrain.go | 2 ++ routers/repo/modelarts.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 880d28dcf..7fae120d9 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -124,6 +124,7 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { ctx.Data["model_path"] = cloudbrain.ModelMountPath ctx.Data["benchmark_path"] = cloudbrain.BenchMarkMountPath ctx.Data["is_benchmark_enabled"] = setting.IsBenchmarkEnabled + ctx.Data["debugListType"] = models.GPUResource if categories == nil { json.Unmarshal([]byte(setting.BenchmarkCategory), &categories) @@ -422,6 +423,7 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { ctx.Data["task"] = task // ctx.Data["jobID"] = task.JobID ctx.Data["jobName"] = task.JobName + ctx.Data["debugListType"] = models.GPUResource version_list_task := make([]*models.Cloudbrain, 0) version_list_task = append(version_list_task, task) ctx.Data["version_list_task"] = version_list_task diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index ebba2e95a..851e3f140 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -131,6 +131,8 @@ func notebookNewDataPrepare(ctx *context.Context) error { } ctx.Data["flavors"] = modelarts.FlavorInfos.FlavorInfo + ctx.Data["debugListType"] = models.NPUResource + return nil } @@ -271,6 +273,7 @@ func NotebookShow(ctx *context.Context) { ctx.Data["jobID"] = jobID ctx.Data["jobName"] = task.JobName ctx.Data["result"] = result + ctx.Data["debugListType"] = models.NPUResource ctx.HTML(200, tplModelArtsNotebookShow) } From fa774f0a68b05960f3106eab330dcdd7ee629308 Mon Sep 17 00:00:00 2001 From: liuzx Date: Fri, 25 Feb 2022 11:52:34 +0800 Subject: [PATCH 2/7] fix bug --- routers/repo/cloudbrain.go | 2 -- routers/repo/modelarts.go | 3 --- 2 files changed, 5 deletions(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 7fae120d9..880d28dcf 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -124,7 +124,6 @@ func cloudBrainNewDataPrepare(ctx *context.Context) error { ctx.Data["model_path"] = cloudbrain.ModelMountPath ctx.Data["benchmark_path"] = cloudbrain.BenchMarkMountPath ctx.Data["is_benchmark_enabled"] = setting.IsBenchmarkEnabled - ctx.Data["debugListType"] = models.GPUResource if categories == nil { json.Unmarshal([]byte(setting.BenchmarkCategory), &categories) @@ -423,7 +422,6 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { ctx.Data["task"] = task // ctx.Data["jobID"] = task.JobID ctx.Data["jobName"] = task.JobName - ctx.Data["debugListType"] = models.GPUResource version_list_task := make([]*models.Cloudbrain, 0) version_list_task = append(version_list_task, task) ctx.Data["version_list_task"] = version_list_task diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 851e3f140..ebba2e95a 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -131,8 +131,6 @@ func notebookNewDataPrepare(ctx *context.Context) error { } ctx.Data["flavors"] = modelarts.FlavorInfos.FlavorInfo - ctx.Data["debugListType"] = models.NPUResource - return nil } @@ -273,7 +271,6 @@ func NotebookShow(ctx *context.Context) { ctx.Data["jobID"] = jobID ctx.Data["jobName"] = task.JobName ctx.Data["result"] = result - ctx.Data["debugListType"] = models.NPUResource ctx.HTML(200, tplModelArtsNotebookShow) } From 227645ce3247595be341e7ebd3d254d60e1274c7 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Fri, 25 Feb 2022 15:06:30 +0800 Subject: [PATCH 3/7] fix issue --- options/locale/locale_en-US.ini | 7 ++++++ options/locale/locale_zh-CN.ini | 7 ++++++ templates/admin/cloudbrain/list.tmpl | 2 +- templates/repo/cloudbrain/new.tmpl | 2 +- templates/repo/cloudbrain/show.tmpl | 2 +- templates/repo/debugjob/index.tmpl | 3 ++- templates/repo/modelarts/notebook/new.tmpl | 7 ++---- templates/repo/modelarts/notebook/show.tmpl | 5 +++- templates/user/settings/profile.tmpl | 28 ++++++++------------- web_src/js/index.js | 4 +-- 10 files changed, 38 insertions(+), 29 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index bff640f61..fd439c4d1 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -493,6 +493,13 @@ account_link = Linked Accounts organization = Organizations uid = Uid u2f = Security Keys +bind_weChat = Bind WeChat +bind_account_information = Bind account information +bind_time = Bind Time +wechat = Wechat +Unbind = Unbind +unbind_wechat = Are you sure you want to unbind WeChat? +unbind_computing = After unbundling, the qizhi computing power environment will not be available public_profile = Public Profile profile_desc = Your email address will be used for notifications and other operations. diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index c7b214c9d..0f94f1d1d 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -496,6 +496,13 @@ account_link=已绑定帐户 organization=组织 uid=用户 ID u2f=安全密钥 +bind_weChat = 微信绑定 +bind_account_information = 绑定账号信息 +bind_time = 绑定时间 +wechat = 微信 +unbind = 解除绑定 +unbind_wechat = 确定要解绑微信? +unbind_computing = 解绑后将无法使用启智算力环境 public_profile=公开信息 profile_desc=您的电子邮件地址将用于通知和其他操作。 diff --git a/templates/admin/cloudbrain/list.tmpl b/templates/admin/cloudbrain/list.tmpl index 521377838..3bb0a9912 100644 --- a/templates/admin/cloudbrain/list.tmpl +++ b/templates/admin/cloudbrain/list.tmpl @@ -66,7 +66,7 @@
{{if or (eq .JobType "DEBUG") (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE")}} - + {{.JobName}} {{else if eq .JobType "INFERENCE"}} diff --git a/templates/repo/cloudbrain/new.tmpl b/templates/repo/cloudbrain/new.tmpl index 0735c593b..94075405a 100755 --- a/templates/repo/cloudbrain/new.tmpl +++ b/templates/repo/cloudbrain/new.tmpl @@ -254,7 +254,7 @@ - {{.i18n.Tr "repo.cloudbrain.cancel"}} + {{.i18n.Tr "repo.cloudbrain.cancel"}}
diff --git a/templates/repo/cloudbrain/show.tmpl b/templates/repo/cloudbrain/show.tmpl index 921ba179e..d0796edb1 100755 --- a/templates/repo/cloudbrain/show.tmpl +++ b/templates/repo/cloudbrain/show.tmpl @@ -11,7 +11,7 @@ {{.i18n.Tr "repo.cloudbrain"}}
/
- + {{$.i18n.Tr "repo.modelarts.notebook"}}
/
diff --git a/templates/repo/debugjob/index.tmpl b/templates/repo/debugjob/index.tmpl index b624349cd..c894ee2ed 100755 --- a/templates/repo/debugjob/index.tmpl +++ b/templates/repo/debugjob/index.tmpl @@ -485,7 +485,7 @@ let getParam=getQueryVariable('debugListType') let dropdownValue = ['all','',false].includes(getParam)? '全部' : getParam - localStorage.setItem('all',location.href) + // localStorage.setItem('all',location.href) function getQueryVariable(variable) { let query = window.location.search.substring(1); @@ -505,6 +505,7 @@ }) $('.ui.selection.dropdown').dropdown({ onChange:function(value){ + location.href = `${url}/debugjob?debugListType=${value}` } }) diff --git a/templates/repo/modelarts/notebook/new.tmpl b/templates/repo/modelarts/notebook/new.tmpl index fb6e3c9be..d913a5b47 100755 --- a/templates/repo/modelarts/notebook/new.tmpl +++ b/templates/repo/modelarts/notebook/new.tmpl @@ -101,7 +101,7 @@ - {{.i18n.Tr "repo.cloudbrain.cancel"}} + {{.i18n.Tr "repo.cloudbrain.cancel"}} @@ -171,11 +171,8 @@ if(option.innerText===inputValue){ hiddenInput.value = option.getAttribute('data-value'); - break - + break } } - - }) \ No newline at end of file diff --git a/templates/repo/modelarts/notebook/show.tmpl b/templates/repo/modelarts/notebook/show.tmpl index 787b20a99..f6480080b 100755 --- a/templates/repo/modelarts/notebook/show.tmpl +++ b/templates/repo/modelarts/notebook/show.tmpl @@ -11,7 +11,7 @@ {{.i18n.Tr "repo.cloudbrain"}}
/
- + {{$.i18n.Tr "repo.modelarts.notebook"}}
/
@@ -66,3 +66,6 @@ {{template "base/footer" .}} + diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl index d42415493..f253bf3b2 100644 --- a/templates/user/settings/profile.tmpl +++ b/templates/user/settings/profile.tmpl @@ -104,41 +104,35 @@

- 微信绑定 + {{$.i18n.Tr "settings.bind_weChat"}}

{{if not .SignedUser.IsBindWechat}} {{else}}
- - @@ -147,13 +141,13 @@ {{end}} diff --git a/web_src/js/index.js b/web_src/js/index.js index e41f79fd7..902750c5b 100755 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -4179,9 +4179,9 @@ $('.question.circle.icon.cloudbrain-question').hover(function(){ }); //云脑详情页面跳转回上一个页面 -$(".section.backTodeBug").attr("href",localStorage.getItem('all')) +// $(".section.backTodeBug").attr("href",localStorage.getItem('all')) //新建调试取消跳转 -$(".ui.button.cancel").attr("href",localStorage.getItem('all')) +// $(".ui.button.cancel").attr("href",localStorage.getItem('all')) function initcreateRepo(){ let timeout; From 7aea6c515bc8e67c9110bd9dfb7c21498675d77d Mon Sep 17 00:00:00 2001 From: liuzx Date: Fri, 25 Feb 2022 15:27:38 +0800 Subject: [PATCH 4/7] fix bug --- routers/repo/cloudbrain.go | 2 ++ routers/repo/modelarts.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 880d28dcf..4cde5d40d 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -351,6 +351,7 @@ func CloudBrainShow(ctx *context.Context) { func cloudBrainShow(ctx *context.Context, tpName base.TplName) { ctx.Data["PageIsCloudBrain"] = true var jobName = ctx.Params(":jobname") + debugListType := ctx.Query("debugListType") task, err := models.GetCloudbrainByName(jobName) if err != nil { ctx.Data["error"] = err.Error() @@ -425,6 +426,7 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { version_list_task := make([]*models.Cloudbrain, 0) version_list_task = append(version_list_task, task) ctx.Data["version_list_task"] = version_list_task + ctx.Data["debugListType"] = debugListType ctx.HTML(200, tpName) } diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index ebba2e95a..6c586d38e 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -91,6 +91,7 @@ func DebugJobIndex(ctx *context.Context) { ctx.Data["Tasks"] = ciTasks ctx.Data["CanCreate"] = cloudbrain.CanCreateOrDebugJob(ctx) ctx.Data["RepoIsEmpty"] = repo.IsEmpty + ctx.Data["debugListType"] = debugListType ctx.HTML(200, tplDebugJobIndex) } @@ -227,6 +228,7 @@ func Notebook2Create(ctx *context.Context, form auth.CreateModelArtsNotebookForm func NotebookShow(ctx *context.Context) { ctx.Data["PageIsCloudBrain"] = true + debugListType := ctx.Query("debugListType") var jobID = ctx.Params(":jobid") task, err := models.GetCloudbrainByJobID(jobID) @@ -271,6 +273,7 @@ func NotebookShow(ctx *context.Context) { ctx.Data["jobID"] = jobID ctx.Data["jobName"] = task.JobName ctx.Data["result"] = result + ctx.Data["debugListType"] = debugListType ctx.HTML(200, tplModelArtsNotebookShow) } From 8f59f68cc47329a3ed73e4fbba65e258ebd88bf0 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Fri, 25 Feb 2022 15:45:58 +0800 Subject: [PATCH 5/7] fix issue --- templates/admin/cloudbrain/list.tmpl | 2 +- templates/repo/cloudbrain/show.tmpl | 6 ++++-- templates/repo/debugjob/index.tmpl | 2 +- templates/repo/modelarts/notebook/show.tmpl | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/templates/admin/cloudbrain/list.tmpl b/templates/admin/cloudbrain/list.tmpl index 3bb0a9912..521377838 100644 --- a/templates/admin/cloudbrain/list.tmpl +++ b/templates/admin/cloudbrain/list.tmpl @@ -66,7 +66,7 @@
{{if or (eq .JobType "DEBUG") (eq .JobType "SNN4IMAGENET") (eq .JobType "BRAINSCORE")}} - + {{.JobName}} {{else if eq .JobType "INFERENCE"}} diff --git a/templates/repo/cloudbrain/show.tmpl b/templates/repo/cloudbrain/show.tmpl index d0796edb1..3be27cc9b 100755 --- a/templates/repo/cloudbrain/show.tmpl +++ b/templates/repo/cloudbrain/show.tmpl @@ -11,7 +11,7 @@ {{.i18n.Tr "repo.cloudbrain"}}
/
- + {{$.i18n.Tr "repo.modelarts.notebook"}}
/
@@ -98,4 +98,6 @@
{{template "base/footer" .}} - + diff --git a/templates/repo/debugjob/index.tmpl b/templates/repo/debugjob/index.tmpl index c894ee2ed..7150cc11e 100755 --- a/templates/repo/debugjob/index.tmpl +++ b/templates/repo/debugjob/index.tmpl @@ -287,7 +287,7 @@
diff --git a/templates/repo/modelarts/notebook/show.tmpl b/templates/repo/modelarts/notebook/show.tmpl index f6480080b..cdad64c38 100755 --- a/templates/repo/modelarts/notebook/show.tmpl +++ b/templates/repo/modelarts/notebook/show.tmpl @@ -11,7 +11,7 @@ {{.i18n.Tr "repo.cloudbrain"}}
/
- + {{$.i18n.Tr "repo.modelarts.notebook"}}
/
From cc82b7d3f24048e452fe0e571c5f1aa6975c8e63 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Fri, 25 Feb 2022 15:48:42 +0800 Subject: [PATCH 6/7] fix issue --- templates/repo/cloudbrain/new.tmpl | 2 +- templates/repo/modelarts/notebook/new.tmpl | 2 +- templates/repo/modelarts/notebook/show.tmpl | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/templates/repo/cloudbrain/new.tmpl b/templates/repo/cloudbrain/new.tmpl index 94075405a..f7fcda2bc 100755 --- a/templates/repo/cloudbrain/new.tmpl +++ b/templates/repo/cloudbrain/new.tmpl @@ -254,7 +254,7 @@ - {{.i18n.Tr "repo.cloudbrain.cancel"}} + {{.i18n.Tr "repo.cloudbrain.cancel"}}
diff --git a/templates/repo/modelarts/notebook/new.tmpl b/templates/repo/modelarts/notebook/new.tmpl index d913a5b47..367c10906 100755 --- a/templates/repo/modelarts/notebook/new.tmpl +++ b/templates/repo/modelarts/notebook/new.tmpl @@ -101,7 +101,7 @@ - {{.i18n.Tr "repo.cloudbrain.cancel"}} + {{.i18n.Tr "repo.cloudbrain.cancel"}} diff --git a/templates/repo/modelarts/notebook/show.tmpl b/templates/repo/modelarts/notebook/show.tmpl index cdad64c38..93c35cca4 100755 --- a/templates/repo/modelarts/notebook/show.tmpl +++ b/templates/repo/modelarts/notebook/show.tmpl @@ -66,6 +66,3 @@ {{template "base/footer" .}} - From ba62909920add5f966cce1aeb1877145c1fac262 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Fri, 25 Feb 2022 16:02:47 +0800 Subject: [PATCH 7/7] fix issue --- templates/repo/cloudbrain/show.tmpl | 3 --- 1 file changed, 3 deletions(-) diff --git a/templates/repo/cloudbrain/show.tmpl b/templates/repo/cloudbrain/show.tmpl index 3be27cc9b..7600907e7 100755 --- a/templates/repo/cloudbrain/show.tmpl +++ b/templates/repo/cloudbrain/show.tmpl @@ -98,6 +98,3 @@ {{template "base/footer" .}} -
- 绑定账号信息 + {{$.i18n.Tr "settings.bind_account_information"}} - 绑定时间 + {{$.i18n.Tr "settings.bind_time"}} - 操作 + {{$.i18n.Tr "repo.cloudbrain_operate"}}
- 微信 + {{$.i18n.Tr "settings.wechat"}} {{TimeSinceUnix1 .SignedUser.WechatBindUnix}}