diff --git a/custom/public/css/git.openi.css b/custom/public/css/git.openi.css index 8e2c25b2d..c6ada7b28 100644 --- a/custom/public/css/git.openi.css +++ b/custom/public/css/git.openi.css @@ -185,7 +185,7 @@ .homenews .ui.list>.item>.content{ color: #E8E8E8; line-height: 1.8em; - width: calc(100% - 3.25em) !important; + width: calc(100% - 3.75em) !important; } .homenews .ui.list>.item{ padding: 0; 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..0b19bc1f0 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 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" + if e := x.SQL(sql, orgId).Find(&result); e != nil { + return nil, e + } + + return result, nil +} diff --git a/modules/modelarts/resty.go b/modules/modelarts/resty.go index 28fcdd49a..2f7d08c35 100755 --- a/modules/modelarts/resty.go +++ b/modules/modelarts/resty.go @@ -35,6 +35,8 @@ const ( //error code modelartsIllegalToken = "ModelArts.6401" NotebookNotFound = "ModelArts.6404" + NotebookNoPermission = "ModelArts.6407" + NotebookInvalid = "ModelArts.6400" ) func getRestyClient() *resty.Client { 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) } diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index fd439c4d1..fdd3f7f94 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. @@ -493,11 +493,12 @@ account_link = Linked Accounts organization = Organizations uid = Uid u2f = Security Keys -bind_weChat = Bind WeChat +bind_wechat = Bind WeChat +wechat_bind = WeChat Binding bind_account_information = Bind account information bind_time = Bind Time wechat = Wechat -Unbind = Unbind +unbind_wc = Unbind unbind_wechat = Are you sure you want to unbind WeChat? unbind_computing = After unbundling, the qizhi computing power environment will not be available @@ -1253,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 @@ -2087,14 +2089,17 @@ 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 +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 +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 0f94f1d1d..982dc1a49 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -496,11 +496,12 @@ account_link=已绑定帐户 organization=组织 uid=用户 ID u2f=安全密钥 -bind_weChat = 微信绑定 +wechat_bind = 微信绑定 +bind_wechat = 绑定微信 bind_account_information = 绑定账号信息 bind_time = 绑定时间 wechat = 微信 -unbind = 解除绑定 +unbind_wc = 解除绑定 unbind_wechat = 确定要解绑微信? unbind_computing = 解绑后将无法使用启智算力环境 @@ -2095,6 +2096,7 @@ team_unit_disabled=(已禁用) selected_couse=精选课程 release_course = 发布课程 all_keywords=全部关键字 +all_org_topics=全部 max_selectedPro= 最多可选9个公开项目 custom_select_courses = 自定义精选课程 recommend_remain_pro = 还能推荐 @@ -2103,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/routers/admin/cloudbrains.go b/routers/admin/cloudbrains.go index ee89a5fa4..d7a8f2220 100644 --- a/routers/admin/cloudbrains.go +++ b/routers/admin/cloudbrains.go @@ -62,7 +62,7 @@ func CloudBrains(ctx *context.Context) { jobStatusNot = true jobStatuses = append(jobStatuses, string(models.ModelArtsTrainJobWaiting), string(models.ModelArtsTrainJobFailed), string(models.ModelArtsRunning), string(models.ModelArtsTrainJobCompleted), string(models.ModelArtsStarting), string(models.ModelArtsRestarting), string(models.ModelArtsStartFailed), - string(models.ModelArtsStopping), string(models.ModelArtsStopped)) + string(models.ModelArtsStopping), string(models.ModelArtsStopped), string(models.JobSucceeded)) } else if jobStatus != "all" && jobStatus != "" { jobStatuses = append(jobStatuses, jobStatus) } 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{ diff --git a/routers/repo/modelarts.go b/routers/repo/modelarts.go index 6c586d38e..81dd65c16 100755 --- a/routers/repo/modelarts.go +++ b/routers/repo/modelarts.go @@ -313,7 +313,7 @@ func NotebookDebug2(ctx *context.Context) { return } - ctx.Redirect(result.Url) + ctx.Redirect(result.Url + "?token=" + result.Token) } func NotebookManage(ctx *context.Context) { @@ -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) { + 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 } diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 9dc69828c..7fa06fa3b 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -993,7 +993,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("", reqRepoCloudBrainReader, repo.CloudBrainShow) }) m.Group("/:jobid", func() { - m.Get("/debug", reqWechatBind, cloudbrain.AdminOrJobCreaterRight, repo.CloudBrainDebug) + m.Get("/debug", cloudbrain.AdminOrJobCreaterRight, repo.CloudBrainDebug) m.Post("/commit_image", cloudbrain.AdminOrJobCreaterRight, bindIgnErr(auth.CommitImageCloudBrainForm{}), repo.CloudBrainCommitImage) m.Post("/stop", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.CloudBrainStop) m.Post("/del", cloudbrain.AdminOrOwnerOrJobCreaterRight, repo.CloudBrainDel) diff --git a/templates/admin/cloudbrain/search.tmpl b/templates/admin/cloudbrain/search.tmpl index ba6227d9d..3c24a52e1 100644 --- a/templates/admin/cloudbrain/search.tmpl +++ b/templates/admin/cloudbrain/search.tmpl @@ -35,6 +35,7 @@