From 743d91e51918c2fd644d0f149bb6e012f552b80e Mon Sep 17 00:00:00 2001 From: zouap Date: Tue, 1 Mar 2022 17:35:32 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/index.tmpl | 8 +++++++- templates/repo/cloudbrain/benchmark/new.tmpl | 11 +++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index e0eb0a6f3..fe07702e4 100644 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -39,7 +39,7 @@
- 基准测试排行榜 + 基准测试介绍 {{if .Permission.CanWrite $.UnitTypeCloudBrain}} {{$.i18n.Tr "repo.modelarts.evaluate_job.new_job"}} {{else}} @@ -149,6 +149,12 @@ 评分 + + + 排行榜 + + +
diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 3ea2641d8..5be2d3fe4 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -150,13 +150,13 @@
- 查看样例 + 查看样例
- 查看样例 + 查看样例
@@ -190,6 +190,13 @@ function setChildType(){ let type_id = $('#benchmark_types_id').val(); + if(type_id==4){ + $('#train_href_id').attr('href','https://git.openi.org.cn/CV_benchmark/CV_MOT_benchmark'); + $('#test_href_id').attr('href','https://git.openi.org.cn/CV_benchmark/CV_MOT_benchmark'); + }else{ + $('#train_href_id').attr('href','https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark'); + $('#test_href_id').attr('href','https://git.openi.org.cn/CV_benchmark/CV_reID_benchmark'); + } let child_selected_id = $('#benchmark_child_types_id_hidden').val(); $.get(`${repolink}/cloudbrain/benchmark/get_child_types?benchmark_type_id=${type_id}`, (data) => { const n_length = data['child_types'].length From b790ec68cc39bc3974d0db569dfe94b060802fec Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 2 Mar 2022 09:17:28 +0800 Subject: [PATCH 02/17] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/index.tmpl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index fe07702e4..55333095a 100644 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -130,7 +130,7 @@ {{end}}
-
+
@@ -154,7 +154,6 @@ 排行榜 - From 8345155be9ea6a8ca4f792ed5671e1c99599ae64 Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 2 Mar 2022 09:28:42 +0800 Subject: [PATCH 03/17] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/index.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index 55333095a..60d66f2ef 100644 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -72,7 +72,7 @@
{{$.i18n.Tr "repo.cloudbrain_task"}}
-
+
{{$.i18n.Tr "repo.modelarts.status"}}
@@ -87,7 +87,7 @@
{{$.i18n.Tr "repo.cloudbrain_creator"}}
-
+
{{$.i18n.Tr "repo.cloudbrain_operate"}}
@@ -104,7 +104,7 @@
-
+
{{.Status}} @@ -130,7 +130,7 @@ {{end}}
-
+
From e6c3403b767ed823976f8adef259b575bcae57e4 Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 2 Mar 2022 09:40:53 +0800 Subject: [PATCH 04/17] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/index.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index 60d66f2ef..ff6807d88 100644 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -72,13 +72,13 @@
{{$.i18n.Tr "repo.cloudbrain_task"}}
-
+
{{$.i18n.Tr "repo.modelarts.status"}}
{{$.i18n.Tr "repo.modelarts.createtime"}}
-
+
{{$.i18n.Tr "repo.cloudbrain_status_runtime"}}
@@ -104,7 +104,7 @@
-
+
{{.Status}} @@ -114,7 +114,7 @@ {{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}}
-
+
{{.TrainJobDuration}}
From d4028619daa21565356ca3e06f468a7faae391dd Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Thu, 3 Mar 2022 10:49:06 +0800 Subject: [PATCH 05/17] #1250 add org topics --- models/org.go | 4 ++-- models/topic.go | 13 +++++++++++++ routers/org/home.go | 7 +++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/models/org.go b/models/org.go index e8006d55f..85fb157ae 100755 --- a/models/org.go +++ b/models/org.go @@ -180,8 +180,8 @@ func CreateOrganization(org, owner *User) (err error) { // Add initial creator to organization and owner team. if _, err = sess.Insert(&OrgUser{ - UID: owner.ID, - OrgID: org.ID, + UID: owner.ID, + OrgID: org.ID, IsPublic: setting.Service.DefaultOrgMemberVisible, }); err != nil { return fmt.Errorf("insert org-user relation: %v", err) diff --git a/models/topic.go b/models/topic.go index 5533da7bc..e95e0ed40 100644 --- a/models/topic.go +++ b/models/topic.go @@ -324,3 +324,16 @@ func SaveTopics(repoID int64, topicNames ...string) error { return sess.Commit() } + +func GetOrgTopics(orgId int64) ([]Topic, error) { + result := make([]Topic, 0) + sql := "select t.* from repository r " + + "inner join repo_topic rt on rt.repo_id = r.id " + + "inner join topic t on rt.topic_id = t.id " + + "where r.owner_id = ? order by repo_count desc" + if e := x.SQL(sql, orgId).Find(&result); e != nil { + return nil, e + } + + return result, nil +} diff --git a/routers/org/home.go b/routers/org/home.go index c9769f559..3ffb4fd86 100755 --- a/routers/org/home.go +++ b/routers/org/home.go @@ -94,6 +94,13 @@ func Home(ctx *context.Context) { recommendCourseKeyWords, _ := repository.GetRecommendCourseKeyWords() ctx.Data["CoursesKeywords"] = recommendCourseKeyWords + } else { + orgTopics, err := models.GetOrgTopics(org.ID) + if err != nil { + ctx.Error(500, "GetOrgTopics failed") + return + } + ctx.Data["OrgTopics"] = orgTopics } repos, count, err = models.SearchRepository(&models.SearchRepoOptions{ From 109c9b013e1065054ef9882742b9154879048433 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Thu, 3 Mar 2022 10:58:17 +0800 Subject: [PATCH 06/17] #1250 add topic display limit --- models/topic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/topic.go b/models/topic.go index e95e0ed40..8abc76b9c 100644 --- a/models/topic.go +++ b/models/topic.go @@ -330,7 +330,7 @@ func GetOrgTopics(orgId int64) ([]Topic, error) { sql := "select t.* from repository r " + "inner join repo_topic rt on rt.repo_id = r.id " + "inner join topic t on rt.topic_id = t.id " + - "where r.owner_id = ? order by repo_count desc" + "where r.owner_id = ? order by repo_count desc limit 50" if e := x.SQL(sql, orgId).Find(&result); e != nil { return nil, e } From 1b0df114345125cdb0a11b1c681a9bd2dd569066 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Thu, 3 Mar 2022 11:20:04 +0800 Subject: [PATCH 07/17] #1250 inherit parent repo's topics when fork --- modules/repository/fork.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/repository/fork.go b/modules/repository/fork.go index da9039d00..e3ebbfee2 100644 --- a/modules/repository/fork.go +++ b/modules/repository/fork.go @@ -86,5 +86,11 @@ func ForkRepository(doer, owner *models.User, oldRepo *models.Repository, name, if err := models.CopyLanguageStat(oldRepo, repo); err != nil { log.Error("Copy language stat from oldRepo failed") } + //inherit parent repo's topics + if len(oldRepo.Topics) > 0 { + if err := models.SaveTopics(repo.ID, oldRepo.Topics...); err != nil { + log.Error("SaveTopics failed when fork,e=%v", err) + } + } return repo, models.CopyLFS(ctx, repo, oldRepo) } From e959e7ebd2f702137cb902a2c09799890ea2257f Mon Sep 17 00:00:00 2001 From: wangjr Date: Thu, 3 Mar 2022 14:45:24 +0800 Subject: [PATCH 08/17] =?UTF-8?q?fix-1250=20=E7=BB=84=E7=BB=87=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E5=A2=9E=E5=8A=A0=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- options/locale/locale_en-US.ini | 3 ++ options/locale/locale_zh-CN.ini | 3 ++ templates/org/home.tmpl | 95 +++++++++++++++++++++++++++++++-- 3 files changed, 98 insertions(+), 3 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 0787e6ce6..042886633 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -2088,6 +2088,7 @@ team_unit_disabled = (Disabled) selected_couse=Selected Courses release_course = Publish Course all_keywords=All keywords +all_org_topics=All max_selectedPro= Select up to 9 public projects custom_select_courses = Customize selected courses recommend_remain_pro = Remain @@ -2096,6 +2097,8 @@ select_again = Select more than 9, please select again! custom_select_projects = Customize selected projects customize = Customize selected_project=Selected Projects +fold = Fold +unfold = Unfold form.name_reserved = The organization name '%s' is reserved. form.name_pattern_not_allowed = The pattern '%s' is not allowed in an organization name. diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 2eeb72735..982dc1a49 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -2096,6 +2096,7 @@ team_unit_disabled=(已禁用) selected_couse=精选课程 release_course = 发布课程 all_keywords=全部关键字 +all_org_topics=全部 max_selectedPro= 最多可选9个公开项目 custom_select_courses = 自定义精选课程 recommend_remain_pro = 还能推荐 @@ -2104,6 +2105,8 @@ select_again = 选择超过9个,请重新选择! custom_select_projects = 自定义精选项目 customize = 自定义 selected_project=精选项目 +fold = 折叠 +unfold = 展开 form.name_reserved=组织名称 '%s' 是被保留的。 form.name_pattern_not_allowed=组织名称中不允许使用 "%s"。 diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index 865a780a8..3e0dc0a8a 100755 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -1,3 +1,47 @@ + {{template "base/head" .}}
{{/* overflow: auto is the clearfix - this avoids the image going beyond @@ -22,22 +66,51 @@
{{template "org/navber" .}} {{template "org/select_pro" .}} +
+ +
+
+
+ {{if .OrgTopics}} + {{$.i18n.Tr "org.all_org_topics"}} + {{end}} + + {{range .OrgTopics}} + {{if ne .Name ""}} + + {{.Name}} + + {{end}} + {{end}} +
+ + +
+
+
- {{if .CanCreateOrgRepo}} + {{template "org/repo_list" .}} {{template "base/paginate" .}}
-

+ {{if .CanCreateOrgRepo}} + + {{end}} +

{{.i18n.Tr "org.people"}}

{{template "base/footer" .}} + + \ No newline at end of file From d39ca502e639d727c20bfe2931604246401bf4aa Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Thu, 3 Mar 2022 14:54:17 +0800 Subject: [PATCH 09/17] #1250 fix bug --- models/topic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/topic.go b/models/topic.go index 8abc76b9c..0b19bc1f0 100644 --- a/models/topic.go +++ b/models/topic.go @@ -327,7 +327,7 @@ func SaveTopics(repoID int64, topicNames ...string) error { func GetOrgTopics(orgId int64) ([]Topic, error) { result := make([]Topic, 0) - sql := "select t.* from repository r " + + sql := "select distinct(t.*) from repository r " + "inner join repo_topic rt on rt.repo_id = r.id " + "inner join topic t on rt.topic_id = t.id " + "where r.owner_id = ? order by repo_count desc limit 50" From 7191e74a73479c2e429cc06d2555a3ad9813ccb9 Mon Sep 17 00:00:00 2001 From: chenyifan01 Date: Thu, 3 Mar 2022 15:52:13 +0800 Subject: [PATCH 10/17] #1475 fix bug --- options/locale/locale_en-US.ini | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 0787e6ce6..5cac5133a 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -235,7 +235,7 @@ page_recommend_org_more=More Organizations page_recommend_repo=Recommended Projects page_recommend_repo_desc=Excellent AI projects recommendation. To show your project here, page_recommend_repo_commit=Click here to submit. -page_recommend_repo_go=Click here to +page_recommend_repo_go=Click here to page_recommend_repo_more=explore more projects. page_dev_env=Collaborative Development Environment page_dev_env_desc=Provide a collaborative development environment for AI development, which is the biggest highlight that distinguishes the OpenI AI Collaboration Platform from other traditional Git platforms. @@ -1254,6 +1254,7 @@ issues.filter_sort.moststars = Most stars issues.filter_sort.feweststars = Fewest stars issues.filter_sort.mostforks = Most forks issues.filter_sort.fewestforks = Fewest forks +issues.filter_sort.downloadtimes = Most downloaded issues.action_open = Open issues.action_close = Close issues.action_label = Label @@ -2089,11 +2090,11 @@ selected_couse=Selected Courses release_course = Publish Course all_keywords=All keywords max_selectedPro= Select up to 9 public projects -custom_select_courses = Customize selected courses +custom_select_courses = Customize selected courses recommend_remain_pro = Remain save_fail_tips = The upper limit is exceeded select_again = Select more than 9, please select again! -custom_select_projects = Customize selected projects +custom_select_projects = Customize selected projects customize = Customize selected_project=Selected Projects From e24f4f227f4169d232146fc6259070ef93d65a98 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Thu, 3 Mar 2022 16:06:55 +0800 Subject: [PATCH 11/17] fix 1503 --- modules/modelarts/resty.go | 3 ++- routers/repo/modelarts.go | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/modelarts/resty.go b/modules/modelarts/resty.go index 65dd6fe6d..2f7d08c35 100755 --- a/modules/modelarts/resty.go +++ b/modules/modelarts/resty.go @@ -35,7 +35,8 @@ const ( //error code modelartsIllegalToken = "ModelArts.6401" NotebookNotFound = "ModelArts.6404" - NotebookNoPermission = "ModelArts.6403" + NotebookNoPermission = "ModelArts.6407" + NotebookInvalid = "ModelArts.6400" ) func getRestyClient() *resty.Client { diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index c60740b87..81dd65c16 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -431,24 +431,24 @@ func NotebookDel(ctx *context.Context) { if task.Status != string(models.ModelArtsCreateFailed) && task.Status != string(models.ModelArtsStartFailed) && task.Status != string(models.ModelArtsStopped) { log.Error("the job(%s) has not been stopped", task.JobName) - ctx.ServerError("the job has not been stopped", errors.New("the job has not been stopped")) + ctx.RenderWithErr("the job has not been stopped", tplDebugJobIndex, nil) return } _, err := modelarts.DelNotebook2(jobID) if err != nil { log.Error("DelNotebook2(%s) failed:%v", task.JobName, err.Error()) - if strings.Contains(err.Error(), modelarts.NotebookNotFound) || strings.Contains(err.Error(), modelarts.NotebookNoPermission) { + if strings.Contains(err.Error(), modelarts.NotebookNotFound) || strings.Contains(err.Error(), modelarts.NotebookNoPermission) || strings.Contains(err.Error(), modelarts.NotebookInvalid){ log.Info("old notebook version") } else { - ctx.ServerError("DelNotebook2 failed", err) + ctx.RenderWithErr(err.Error(), tplDebugJobIndex, nil) return } } err = models.DeleteJob(task) if err != nil { - ctx.ServerError("DeleteJob failed", err) + ctx.RenderWithErr(err.Error(), tplDebugJobIndex, nil) return } From 0d1abe0beb43672a5916de3aff97b3707cb3af8e Mon Sep 17 00:00:00 2001 From: wangjr Date: Thu, 3 Mar 2022 16:29:54 +0800 Subject: [PATCH 12/17] =?UTF-8?q?fix-1250=20=E4=BF=AE=E6=94=B9=E9=97=B4?= =?UTF-8?q?=E8=B7=9D=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/org/home.tmpl | 50 ++------------------------------- templates/org/home_courses.tmpl | 28 +++--------------- web_src/less/openi.less | 36 +++++++++++++++++++++++- 3 files changed, 42 insertions(+), 72 deletions(-) diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index 3e0dc0a8a..3ac59d079 100755 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -1,47 +1,3 @@ - {{template "base/head" .}}
{{/* overflow: auto is the clearfix - this avoids the image going beyond @@ -70,7 +26,7 @@
-
+
{{if .OrgTopics}} {{$.i18n.Tr "org.all_org_topics"}} {{end}} @@ -83,8 +39,8 @@ {{end}} {{end}}
- diff --git a/templates/org/home_courses.tmpl b/templates/org/home_courses.tmpl index 03ca8c41e..0f553687d 100644 --- a/templates/org/home_courses.tmpl +++ b/templates/org/home_courses.tmpl @@ -32,27 +32,13 @@ .organization-info >.container { padding-bottom:0px !important; } - .tag_bg{ - background-color: #0366D6 !important; - color:#FFFFFF !important; - } .course{ padding:10px 0 15px !important; } .course_color{ color: #FA8C16; } - .tag_lable{ - border: 1px solid rgba(232, 232, 232, 100) ; - border-radius: 4px; - color: rgba(65, 80, 88, 100); - font-family: Microsoft Yahei; - font-size: 14px; - padding: 0.3em 0.5em; - height: 30px; - text-align: center; - margin: 0.2em; - } + .tag_lable_first{ border: 1px solid rgba(232, 232, 232, 100) ; border-radius: 4px; @@ -65,17 +51,11 @@ margin: 0.2em; margin-left: none; } - .tag_key{ - max-width:100%; - margin: 3px 3px; - display:inline-flex; - } + .bpadding{ padding:10px 40px } - .omit{ - overflow: hidden; white-space: nowrap; text-overflow: ellipsis; - } + .noborder{ border: none !important; } @@ -83,7 +63,7 @@ text-align: center; margin-top: 5px; margin-top: 10px; - } + } diff --git a/web_src/less/openi.less b/web_src/less/openi.less index 6598f5f40..ff43f94e6 100644 --- a/web_src/less/openi.less +++ b/web_src/less/openi.less @@ -734,4 +734,38 @@ display: block; } .el-pagination.is-background .el-pager li:hover { color: #5bb973 !important; - } \ No newline at end of file + } + +.tag_key{ + max-width:100%; + margin: 3px 3px; + display:inline-flex; +} +.tag_lable{ + border: 1px solid rgba(232, 232, 232, 100) ; + border-radius: 4px; + color: rgba(65, 80, 88, 100); + font-family: Microsoft Yahei; + font-size: 14px; + padding: 0.3em 0.5em; + height: 30px; + text-align: center; + margin: 0.2em; +} +.omit{ + overflow: hidden; white-space: nowrap; text-overflow: ellipsis; +} +.tag_bg{ + background-color: #0366D6 !important; + color:#FFFFFF !important; +} +.margin-top20{ + margin-top: 20px; +} +.maxheight{ + max-height: 88px; + overflow: hidden; +} +.pad-botom{ + padding-bottom:0px !important; +} \ No newline at end of file From 929962298f9b3995f44fe8bb185623b474c97bc3 Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 4 Mar 2022 10:37:25 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E8=AF=84=E6=B5=8B=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- templates/repo/cloudbrain/benchmark/index.tmpl | 18 +++++++++++------- templates/repo/cloudbrain/benchmark/new.tmpl | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl index ff6807d88..e2eea57e3 100644 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -39,7 +39,7 @@
- 基准测试介绍 + 基准测试排行榜 {{if .Permission.CanWrite $.UnitTypeCloudBrain}} {{$.i18n.Tr "repo.modelarts.evaluate_job.new_job"}} {{else}} @@ -75,6 +75,9 @@
{{$.i18n.Tr "repo.modelarts.status"}}
+
+ {{.i18n.Tr "repo.cloudbrain.benchmark.evaluate_type"}} +
{{$.i18n.Tr "repo.modelarts.createtime"}}
@@ -87,7 +90,7 @@
{{$.i18n.Tr "repo.cloudbrain_creator"}}
-
+
{{$.i18n.Tr "repo.cloudbrain_operate"}}
@@ -109,6 +112,11 @@ {{.Status}}
+
{{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}} @@ -130,7 +138,7 @@ {{end}}
-
+
@@ -150,10 +158,6 @@ 评分 - - 排行榜 - - diff --git a/templates/repo/cloudbrain/benchmark/new.tmpl b/templates/repo/cloudbrain/benchmark/new.tmpl index 5be2d3fe4..51da4b10b 100755 --- a/templates/repo/cloudbrain/benchmark/new.tmpl +++ b/templates/repo/cloudbrain/benchmark/new.tmpl @@ -190,7 +190,7 @@ function setChildType(){ let type_id = $('#benchmark_types_id').val(); - if(type_id==4){ + if(type_id == 3){ $('#train_href_id').attr('href','https://git.openi.org.cn/CV_benchmark/CV_MOT_benchmark'); $('#test_href_id').attr('href','https://git.openi.org.cn/CV_benchmark/CV_MOT_benchmark'); }else{ From dc5da68d639ad9cb4b681c67ea191029ba16daf9 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Fri, 4 Mar 2022 11:52:49 +0800 Subject: [PATCH 14/17] benchmark opt --- models/cloudbrain.go | 13 +++++++----- routers/repo/cloudbrain.go | 20 ++++++++++++++++++- templates/explore/repo_orgtop.tmpl | 4 ++-- .../repo/cloudbrain/benchmark/index.tmpl | 2 +- 4 files changed, 30 insertions(+), 9 deletions(-) mode change 100644 => 100755 templates/repo/cloudbrain/benchmark/index.tmpl diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 8bb3357ae..b2eed744d 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -144,8 +144,10 @@ type Cloudbrain struct { CkptName string //权重文件名称 ResultUrl string //推理结果的obs路径 - User *User `xorm:"-"` - Repo *Repository `xorm:"-"` + User *User `xorm:"-"` + Repo *Repository `xorm:"-"` + BenchmarkTypeName string `xorm:"-"` + BenchmarkTypeRankLink string `xorm:"-"` } type CloudbrainInfo struct { @@ -407,9 +409,10 @@ type BenchmarkTypes struct { } type BenchmarkType struct { - Id int `json:"id"` - First string `json:"first"` //一级算法类型名称 - Second []*BenchmarkDataset `json:"second"` + Id int `json:"id"` + RankLink string `json:"rank_link"` + First string `json:"first"` //一级算法类型名称 + Second []*BenchmarkDataset `json:"second"` } type BenchmarkDataset struct { diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 4cde5d40d..6fae64bea 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -404,10 +404,11 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { } else { duration = int64(task.UpdatedUnix) - int64(task.CreatedUnix) } - if benchmarkTypes != nil { + if task.BenchmarkTypeID > 0 { for _, benchmarkType := range benchmarkTypes.BenchmarkType { if task.BenchmarkTypeID == benchmarkType.Id { ctx.Data["BenchmarkTypeName"] = benchmarkType.First + ctx.Data["RankLink"] = benchmarkType.RankLink for _, benchmarkChildType := range benchmarkType.Second { if task.BenchmarkChildTypeID == benchmarkChildType.Id { ctx.Data["BenchmarkChildTypeName"] = benchmarkChildType.Value @@ -1051,6 +1052,13 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) { return } + if benchmarkTypes == nil { + if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { + ctx.ServerError("Get BenchmarkTypes faild:", err) + return + } + } + for i, task := range ciTasks { ciTasks[i].CanDel = cloudbrain.CanDeleteJob(ctx, &task.Cloudbrain) ciTasks[i].Cloudbrain.ComputeResource = task.ComputeResource @@ -1061,6 +1069,16 @@ func CloudBrainBenchmarkIndex(ctx *context.Context) { duration = int64(task.Cloudbrain.UpdatedUnix) - int64(task.Cloudbrain.CreatedUnix) } ciTasks[i].TrainJobDuration = util.AddZero(duration/3600000) + ":" + util.AddZero(duration%3600000/60000) + ":" + util.AddZero(duration%60000/1000) + ciTasks[i].BenchmarkTypeName = "" + if task.BenchmarkTypeID > 0 { + for _, benchmarkType := range benchmarkTypes.BenchmarkType { + if task.BenchmarkTypeID == benchmarkType.Id { + ciTasks[i].BenchmarkTypeRankLink = benchmarkType.RankLink + ciTasks[i].BenchmarkTypeName = benchmarkType.First + break + } + } + } } pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5) diff --git a/templates/explore/repo_orgtop.tmpl b/templates/explore/repo_orgtop.tmpl index d9c29fd54..5706a92b8 100755 --- a/templates/explore/repo_orgtop.tmpl +++ b/templates/explore/repo_orgtop.tmpl @@ -53,8 +53,8 @@
diff --git a/templates/repo/cloudbrain/benchmark/index.tmpl b/templates/repo/cloudbrain/benchmark/index.tmpl old mode 100644 new mode 100755 index e2eea57e3..2fc12dc40 --- a/templates/repo/cloudbrain/benchmark/index.tmpl +++ b/templates/repo/cloudbrain/benchmark/index.tmpl @@ -113,7 +113,7 @@
From 1bf77bd88d6d8519d3e1b88cff3c59ac62a1ee96 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Fri, 4 Mar 2022 16:23:15 +0800 Subject: [PATCH 15/17] opt --- routers/repo/cloudbrain.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 6fae64bea..a3ab2bbab 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -339,6 +339,8 @@ func CloudBrainBenchMarkShow(ctx *context.Context) { if benchmarkTypes == nil { if err := json.Unmarshal([]byte(setting.BenchmarkTypes), &benchmarkTypes); err != nil { log.Error("json.Unmarshal BenchmarkTypes(%s) failed:%v", setting.BenchmarkTypes, err, ctx.Data["MsgID"]) + ctx.ServerError(err.Error(), err) + return } } cloudBrainShow(ctx, tplCloudBrainBenchmarkShow) @@ -408,7 +410,6 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName) { for _, benchmarkType := range benchmarkTypes.BenchmarkType { if task.BenchmarkTypeID == benchmarkType.Id { ctx.Data["BenchmarkTypeName"] = benchmarkType.First - ctx.Data["RankLink"] = benchmarkType.RankLink for _, benchmarkChildType := range benchmarkType.Second { if task.BenchmarkChildTypeID == benchmarkChildType.Id { ctx.Data["BenchmarkChildTypeName"] = benchmarkChildType.Value From 1a0cac67b45b2cd4ff9d268cc1a06370fbb26f9c Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Fri, 4 Mar 2022 17:21:23 +0800 Subject: [PATCH 16/17] mod the right for attchment --- models/dataset_permission.go | 29 +++++++++++++++-------------- routers/routes/routes.go | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) mode change 100644 => 100755 models/dataset_permission.go diff --git a/models/dataset_permission.go b/models/dataset_permission.go old mode 100644 new mode 100755 index a4c232d26..f9a1e61ff --- a/models/dataset_permission.go +++ b/models/dataset_permission.go @@ -4,26 +4,27 @@ package models -import ( - "code.gitea.io/gitea/modules/log" -) +import "code.gitea.io/gitea/modules/log" // GetUserDataSetPermission returns the user permissions to the data_set func GetUserDataSetPermission(dataSet *Dataset, user *User) (isPermit bool, err error) { isPermit = false - switch dataSet.Status { - case DatasetStatusDeleted: - log.Error("the data_set has been deleted") - case DatasetStatusPrivate: - if !user.IsAdmin && user.ID != dataSet.UserID { - log.Error("the user is not admin nor the owner of the data_set") + if user != nil { + switch dataSet.Status { + case DatasetStatusDeleted: + log.Error("the data_set has been deleted") + case DatasetStatusPrivate: + if !user.IsAdmin && user.ID != dataSet.UserID { + log.Error("the user is not admin nor the owner of the data_set") + } else { + isPermit = true + } + case DatasetStatusPublic: + isPermit = true + default: + log.Error("the status of data_set is wrong") } - isPermit = true - case DatasetStatusPublic: - isPermit = true - default: - log.Error("the status of data_set is wrong") } return isPermit, nil diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 7fa06fa3b..4ef1e53e3 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -579,7 +579,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("", func() { m.Get("/attachments/:uuid", repo.GetAttachment) - }, reqSignIn) + }) m.Group("/attachments", func() { m.Post("", repo.UploadAttachment) From 1ac260e625082766deeb56960d7a8f9ac44ab5ce Mon Sep 17 00:00:00 2001 From: wangjr Date: Fri, 4 Mar 2022 18:04:22 +0800 Subject: [PATCH 17/17] =?UTF-8?q?fix-1250=20=E4=BF=AE=E6=94=B9=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F,=E6=B2=A1=E6=9C=89=E6=A0=87=E7=AD=BE=E6=97=B6?= =?UTF-8?q?=E6=8A=98=E5=8F=A0=E6=8C=89=E9=92=AE=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/org/home.tmpl | 33 ++++++++++++++++++--------------- web_src/less/openi.less | 13 +++++++++++-- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/templates/org/home.tmpl b/templates/org/home.tmpl index 3ac59d079..2715cb649 100755 --- a/templates/org/home.tmpl +++ b/templates/org/home.tmpl @@ -1,3 +1,4 @@ + {{template "base/head" .}}
{{/* overflow: auto is the clearfix - this avoids the image going beyond @@ -26,7 +27,7 @@
-
+
{{if .OrgTopics}} {{$.i18n.Tr "org.all_org_topics"}} {{end}} @@ -38,9 +39,12 @@ {{end}} {{end}} -
-
@@ -131,16 +135,15 @@ \ No newline at end of file diff --git a/web_src/less/openi.less b/web_src/less/openi.less index ff43f94e6..1ff26dfad 100644 --- a/web_src/less/openi.less +++ b/web_src/less/openi.less @@ -759,8 +759,8 @@ display: block; background-color: #0366D6 !important; color:#FFFFFF !important; } -.margin-top20{ - margin-top: 20px; +.margin-bottom20{ + margin-bottom: 20px; } .maxheight{ max-height: 88px; @@ -768,4 +768,13 @@ display: block; } .pad-botom{ padding-bottom:0px !important; +} +.icon_a{ + position: absolute; + right: 0; + bottom: .2em; + background: #FFF; + border: none !important; + color: #0366d6 !important; + box-shadow: -15px 0px 10px #fff; } \ No newline at end of file