| @@ -45,7 +45,7 @@ type ImageStar struct { | |||
| } | |||
| type ImageTopic struct { | |||
| ID int64 | |||
| ID int64 `xorm:"pk autoincr"` | |||
| Name string `xorm:"UNIQUE VARCHAR(105)"` | |||
| ImageCount int | |||
| CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` | |||
| @@ -468,8 +468,13 @@ func (images ImageList) loadAttributes(e Engine, uid int64) error { | |||
| } | |||
| for i := range images { | |||
| images[i].UserName = users[images[i].UID].Name | |||
| images[i].RelAvatarLink = users[images[i].UID].RelAvatarLink() | |||
| if users[images[i].UID] != nil { | |||
| images[i].UserName = users[images[i].UID].Name | |||
| images[i].RelAvatarLink = users[images[i].UID].RelAvatarLink() | |||
| } else { | |||
| images[i].UserName = "" | |||
| images[i].RelAvatarLink = "" | |||
| } | |||
| if uid == -1 { | |||
| images[i].IsStar = false | |||
| } else { | |||
| @@ -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 | |||
| } | |||
| @@ -775,6 +775,41 @@ func (issue *Issue) ChangeContent(doer *User, content string) (err error) { | |||
| return sess.Commit() | |||
| } | |||
| // ChangeRef changes issue ref, as the given user. | |||
| func (issue *Issue) ChangeRef(doer *User, newRef string) (err error) { | |||
| oldRef := issue.Ref | |||
| issue.Ref = newRef | |||
| if oldRef == newRef { | |||
| return nil | |||
| } | |||
| sess := x.NewSession() | |||
| defer sess.Close() | |||
| if err = sess.Begin(); err != nil { | |||
| return err | |||
| } | |||
| if err = updateIssueCols(sess, issue, "ref"); err != nil { | |||
| sess.Rollback() | |||
| return fmt.Errorf("UpdateIssueCols: %v", err) | |||
| } | |||
| var opts = &CreateCommentOptions{ | |||
| Type: CommentTypeRef, | |||
| Doer: doer, | |||
| Repo: issue.Repo, | |||
| Issue: issue, | |||
| OldRef: oldRef, | |||
| NewRef: newRef, | |||
| } | |||
| if _, err = createComment(sess, opts); err != nil { | |||
| sess.Rollback() | |||
| return err | |||
| } | |||
| return sess.Commit() | |||
| } | |||
| // GetTasks returns the amount of tasks in the issues content | |||
| func (issue *Issue) GetTasks() int { | |||
| return len(issueTasksPat.FindAllStringIndex(issue.Content, -1)) | |||
| @@ -90,6 +90,8 @@ const ( | |||
| CommentTypeReviewRequest | |||
| // merge pull request | |||
| CommentTypeMergePull | |||
| // Ref changed | |||
| CommentTypeRef | |||
| ) | |||
| // CommentTag defines comment tag type | |||
| @@ -221,6 +221,7 @@ const ( | |||
| SearchOrderByHot SearchOrderBy = "(num_watches + num_stars + num_forks + clone_cnt) DESC" | |||
| SearchOrderByActive SearchOrderBy = "(num_issues + num_pulls + num_commit) DESC" | |||
| SearchOrderByWatches SearchOrderBy = "num_watches DESC" | |||
| SearchOrderByDefault SearchOrderBy = "recommend desc,num_stars DESC,updated_unix DESC" | |||
| ) | |||
| // SearchRepositoryCondition creates a query condition according search repository options | |||
| @@ -475,6 +475,7 @@ func RestartTask(ctx *context.Context, task *models.Cloudbrain, newID *string) e | |||
| ComputeResource: task.ComputeResource, | |||
| CreatedUnix: createTime, | |||
| UpdatedUnix: createTime, | |||
| BranchName: task.BranchName, | |||
| } | |||
| err = models.RestartCloudbrain(task, newTask) | |||
| @@ -40,6 +40,14 @@ import ( | |||
| "github.com/editorconfig/editorconfig-core-go/v2" | |||
| ) | |||
| const ( | |||
| REF_HEADS_PREFIX = "refs/heads/" | |||
| REF_TAGS_PREFIX = "refs/tags/" | |||
| REF_TYPE_BRANCH = "branch" | |||
| REF_TYPE_TAG = "tag" | |||
| REF_TYPE_PATTERN = "(refs/heads/|refs/tags/)" | |||
| ) | |||
| // Used from static.go && dynamic.go | |||
| var mailSubjectSplit = regexp.MustCompile(`(?m)^-{3,}[\s]*$`) | |||
| @@ -317,6 +325,8 @@ func NewFuncMap() []template.FuncMap { | |||
| "DatasetPathJoin": func(arr []string, index int, seq string) string { | |||
| return strings.Join(arr[1:index+1], seq) | |||
| }, | |||
| "GetRefType": GetRefType, | |||
| "GetRefName": GetRefName, | |||
| }} | |||
| } | |||
| @@ -444,10 +454,12 @@ func SafeJS(raw string) template.JS { | |||
| func Str2html(raw string) template.HTML { | |||
| return template.HTML(markup.Sanitize(raw)) | |||
| } | |||
| // | |||
| func subOne(length int)int{ | |||
| return length-1 | |||
| func subOne(length int) int { | |||
| return length - 1 | |||
| } | |||
| // Escape escapes a HTML string | |||
| func Escape(raw string) string { | |||
| return html.EscapeString(raw) | |||
| @@ -758,3 +770,18 @@ func licenses() []string { | |||
| func tasks() []string { | |||
| return []string{"machine_translation", "question_answering_system", "information_retrieval", "knowledge_graph", "text_annotation", "text_categorization", "emotion_analysis", "language_modeling", "speech_recognition", "automatic_digest", "information_extraction", "description_generation", "image_classification", "face_recognition", "image_search", "target_detection", "image_description_generation", "vehicle_license_plate_recognition", "medical_image_analysis", "unmanned", "unmanned_security", "drone", "vr_ar", "2_d_vision", "2.5_d_vision", "3_d_reconstruction", "image_processing", "video_processing", "visual_input_system", "speech_coding", "speech_enhancement", "speech_synthesis"} | |||
| } | |||
| func GetRefType(ref string) string { | |||
| if strings.HasPrefix(ref, REF_HEADS_PREFIX) { | |||
| return REF_TYPE_BRANCH | |||
| } | |||
| if strings.HasPrefix(ref, REF_TAGS_PREFIX) { | |||
| return REF_TYPE_TAG | |||
| } | |||
| return "" | |||
| } | |||
| func GetRefName(ref string) string { | |||
| reg := regexp.MustCompile(REF_TYPE_PATTERN) | |||
| return reg.ReplaceAllString(ref, "") | |||
| } | |||
| @@ -237,6 +237,8 @@ page_recommend_repo_desc=Excellent AI projects recommendation. To show your proj | |||
| page_recommend_repo_commit=Click here to submit. | |||
| page_recommend_repo_go=Click here to | |||
| page_recommend_repo_more=explore more projects. | |||
| page_recommend_activity=Community Activities | |||
| page_recommend_activity_desc=The community has prepared a wealth of activities, waiting for you to participate! | |||
| 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. | |||
| page_dev_env_desc_title=Unified Management of Development Elements | |||
| @@ -1332,6 +1334,7 @@ issues.new.labels = Labels | |||
| issues.new.add_labels_title = Apply labels | |||
| issues.new.no_label = No Label | |||
| issues.new.clear_labels = Clear labels | |||
| issues.new.clear_branch_tag = Clear branch or tag | |||
| issues.new.no_items = No items | |||
| issues.new.milestone = Milestone | |||
| issues.new.add_milestone_title = Set milestone | |||
| @@ -1361,6 +1364,13 @@ issues.remove_label_at = removed the <div class="ui label" style="color: %s\; ba | |||
| issues.add_milestone_at = `added this to the <b>%s</b> milestone %s` | |||
| issues.change_milestone_at = `modified the milestone from <b>%s</b> to <b>%s</b> %s` | |||
| issues.remove_milestone_at = `removed this from the <b>%s</b> milestone %s` | |||
| issues.add_branch_at=`added this to the <b>%s</b> branch %s` | |||
| issues.add_tag_at =`added this to the <b>%s</b> tag %s` | |||
| issues.change_branch_tag_at= `modified the branch/tag from <b>%s</b> to <b>%s</b> %s` | |||
| issues.remove_branch_at=`removed this from the <b>%s</b> branch %s` | |||
| issues.remove_tag_at=`removed this from the <b>%s</b> tag %s` | |||
| issues.deleted_milestone = `(deleted)` | |||
| issues.self_assign_at = `self-assigned this %s` | |||
| issues.add_assignee_at = `was assigned by <b>%s</b> %s` | |||
| @@ -1384,6 +1394,7 @@ issues.filter_type.assigned_to_you = Assigned to you | |||
| issues.filter_type.created_by_you = Created by you | |||
| issues.filter_type.mentioning_you = Mentioning you | |||
| issues.filter_sort = Sort | |||
| issues.filter_sort.default = Default | |||
| issues.filter_sort.latest = Newest | |||
| issues.filter_sort.oldest = Oldest | |||
| issues.filter_sort.recentupdate = Recently updated | |||
| @@ -2520,6 +2531,7 @@ datasets.name=name | |||
| datasets.private=Private | |||
| datasets.recommend=Set recommend | |||
| datasets.unrecommend=Set unrecommend | |||
| datasets.only_recommend = Only show platform recommendations | |||
| cloudbrain.all_task_types=All Task Types | |||
| cloudbrain.all_computing_resources=All Computing Resources | |||
| @@ -239,6 +239,8 @@ page_recommend_repo_desc=优秀的AI项目推荐;你的项目也想展示到 | |||
| page_recommend_repo_commit=点此提交 | |||
| page_recommend_repo_go=。进入 | |||
| page_recommend_repo_more=项目广场 | |||
| page_recommend_activity=社区活动 | |||
| page_recommend_activity_desc=社区准备了丰富的活动,等你来参加! | |||
| page_dev_env=协同开发环境 | |||
| page_dev_env_desc=启智AI协作开发平台与传统git平台最大的不同就在于提供了面向AI开发的协同开发环境 | |||
| page_dev_env_desc_title=开发要素统一管理 | |||
| @@ -1344,6 +1346,7 @@ issues.new.labels=标签 | |||
| issues.new.add_labels_title=添加标签 | |||
| issues.new.no_label=未选择标签 | |||
| issues.new.clear_labels=清除选中标签 | |||
| issues.new.clear_branch_tag=清除选中分支/标签 | |||
| issues.new.no_items=无可选项 | |||
| issues.new.milestone=里程碑 | |||
| issues.new.add_milestone_title=设置里程碑 | |||
| @@ -1373,6 +1376,13 @@ issues.remove_label_at=删除了 <div class="ui label" style="color: %s\; backgr | |||
| issues.add_milestone_at=` %[2]s 添加了里程碑 <b>%[1]s</b>` | |||
| issues.change_milestone_at=`%[3]s 修改了里程碑从 <b>%[1]s</b> 到 <b>%[2]s</b>` | |||
| issues.remove_milestone_at=`%[2]s 删除了里程碑 <b>%[1]s</b>` | |||
| issues.add_branch_at=` %[2]s 添加了分支 <b>%[1]s</b>` | |||
| issues.add_tag_at =` %[2]s 添加了标签 <b>%[1]s</b>` | |||
| issues.change_branch_tag_at=`%[3]s 修改了分支/标签从 <b>%[1]s</b> 到 <b>%[2]s</b>` | |||
| issues.remove_branch_at=`%[2]s 删除了分支 <b>%[1]s</b>` | |||
| issues.remove_tag_at=`%[2]s 删除了标签 <b>%[1]s</b>` | |||
| issues.deleted_milestone= (已删除) | |||
| issues.self_assign_at=`于 %s 指派给自己` | |||
| issues.add_assignee_at=`于 %[2]s 被 <b>%[1]s</b> 指派` | |||
| @@ -1396,6 +1406,7 @@ issues.filter_type.assigned_to_you=指派给您的 | |||
| issues.filter_type.created_by_you=由您创建的 | |||
| issues.filter_type.mentioning_you=提及您的 | |||
| issues.filter_sort=排序 | |||
| issues.filter_sort.default=默认排序 | |||
| issues.filter_sort.latest=最新创建 | |||
| issues.filter_sort.oldest=最早创建 | |||
| issues.filter_sort.recentupdate=最近更新 | |||
| @@ -2530,6 +2541,7 @@ datasets.name=名称 | |||
| datasets.private=私有 | |||
| datasets.recommend=设为推荐 | |||
| datasets.unrecommend=取消推荐 | |||
| datasets.only_recommend = 仅显示平台推荐 | |||
| cloudbrain.all_task_types=全部任务类型 | |||
| cloudbrain.all_computing_resources=全部计算资源 | |||
| @@ -6,6 +6,7 @@ if(isEmpty(token)){ | |||
| token = meta.attr("content"); | |||
| } | |||
| } | |||
| var swiperNewMessage = new Swiper(".newslist", { | |||
| direction: "vertical", | |||
| slidesPerView: 10, | |||
| @@ -15,6 +16,18 @@ var swiperNewMessage = new Swiper(".newslist", { | |||
| disableOnInteraction: false, | |||
| }, | |||
| }); | |||
| var swiperEvent = new Swiper(".event-list", { | |||
| slidesPerView: 2, | |||
| spaceBetween: 30, | |||
| pagination: { | |||
| el: ".swiper-pagination", | |||
| clickable: true, | |||
| }, | |||
| autoplay: { | |||
| delay: 2500, | |||
| disableOnInteraction: false, | |||
| }, | |||
| }); | |||
| var swiperRepo = new Swiper(".homepro-list", { | |||
| slidesPerView: 1, | |||
| slidesPerColumn: 2, | |||
| @@ -433,6 +446,38 @@ function queryRecommendData(){ | |||
| } | |||
| }); | |||
| $.ajax({ | |||
| type:"GET", | |||
| url:"/recommend/imageinfo", | |||
| headers: { | |||
| authorization:token, | |||
| }, | |||
| dataType:"json", | |||
| async:false, | |||
| success:function(json){ | |||
| displayActivity(json); | |||
| }, | |||
| error:function(response) { | |||
| } | |||
| }); | |||
| } | |||
| function displayActivity(json){ | |||
| var activityDiv = document.getElementById("recommendactivity"); | |||
| var html = ""; | |||
| if (json != null && json.length > 0){ | |||
| for(var i = 0; i < json.length;i++){ | |||
| var record = json[i] | |||
| html += "<div class=\"swiper-slide\">"; | |||
| html += "<a href=\"" + record["image_link"] + "\" class=\"ui fluid card\">"; | |||
| html += " <div class=\"image\"><img src=\"" + record["url"] + "\"></div>" | |||
| html += "</a>"; | |||
| html += "</div>"; | |||
| } | |||
| } | |||
| activityDiv.innerHTML = html; | |||
| swiperEvent.updateSlides(); | |||
| swiperEvent.updateProgress(); | |||
| } | |||
| function displayRepo(json){ | |||
| @@ -8,6 +8,7 @@ package routers | |||
| import ( | |||
| "bytes" | |||
| "net/http" | |||
| "strconv" | |||
| "strings" | |||
| "code.gitea.io/gitea/services/repository" | |||
| @@ -92,6 +93,8 @@ func setRecommendURL(ctx *context.Context) { | |||
| ctx.Data["page_dev_yunlao_desc3"] = ctx.Tr("home.page_dev_yunlao_desc3") | |||
| ctx.Data["page_dev_yunlao_desc4"] = ctx.Tr("home.page_dev_yunlao_desc4") | |||
| ctx.Data["page_dev_yunlao_apply"] = ctx.Tr("home.page_dev_yunlao_apply") | |||
| ctx.Data["page_recommend_activity"] = ctx.Tr("home.page_recommend_activity") | |||
| ctx.Data["page_recommend_activity_desc"] = ctx.Tr("home.page_recommend_activity_desc") | |||
| } | |||
| func Dashboard(ctx *context.Context) { | |||
| @@ -309,9 +312,11 @@ func ExploreDatasets(ctx *context.Context) { | |||
| orderBy = models.SearchOrderByStarsReverse | |||
| case "feweststars": | |||
| orderBy = models.SearchOrderByStars | |||
| case "default": | |||
| orderBy = models.SearchOrderByDefault | |||
| default: | |||
| ctx.Data["SortType"] = "recentupdate" | |||
| orderBy = models.SearchOrderByRecentUpdated | |||
| ctx.Data["SortType"] = "default" | |||
| orderBy = models.SearchOrderByDefault | |||
| } | |||
| keyword := strings.Trim(ctx.Query("q"), " ") | |||
| @@ -638,6 +643,87 @@ func GetRecommendOrg() ([]map[string]interface{}, error) { | |||
| } | |||
| return resultOrg, nil | |||
| } | |||
| func GetImageInfo() ([]map[string]interface{}, error) { | |||
| url := setting.RecommentRepoAddr + "picture_info" | |||
| result, err := repository.RecommendFromPromote(url) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| imageInfo := make([]map[string]interface{}, 0) | |||
| for i := 0; i < (len(result) - 1); i++ { | |||
| line := result[i] | |||
| imageMap := make(map[string]interface{}) | |||
| if line[0:4] == "url=" { | |||
| url := line[4:] | |||
| imageMap["url"] = url | |||
| if result[i+1][0:11] == "image_link=" { | |||
| image_link := result[i+1][11:] | |||
| imageMap["image_link"] = image_link | |||
| } | |||
| } | |||
| imageInfo = append(imageInfo, imageMap) | |||
| i = i + 1 | |||
| } | |||
| return imageInfo, nil | |||
| } | |||
| func GetRankUser(index string) ([]map[string]interface{}, error) { | |||
| url := setting.RecommentRepoAddr + "user_rank_" + index | |||
| result, err := repository.RecommendFromPromote(url) | |||
| if err != nil { | |||
| return nil, err | |||
| } | |||
| resultOrg := make([]map[string]interface{}, 0) | |||
| for _, userRank := range result { | |||
| tmpIndex := strings.Index(userRank, " ") | |||
| userName := userRank | |||
| score := 0 | |||
| if tmpIndex != -1 { | |||
| userName = userRank[0:tmpIndex] | |||
| tmpScore, err := strconv.Atoi(userRank[tmpIndex+1:]) | |||
| if err != nil { | |||
| log.Info("convert to int error.") | |||
| } | |||
| score = tmpScore | |||
| } | |||
| user, err := models.GetUserByName(userName) | |||
| if err == nil { | |||
| userMap := make(map[string]interface{}) | |||
| userMap["Name"] = user.Name | |||
| userMap["Description"] = user.Description | |||
| userMap["FullName"] = user.FullName | |||
| userMap["HomeLink"] = user.HomeLink() | |||
| userMap["ID"] = user.ID | |||
| userMap["Avatar"] = user.RelAvatarLink() | |||
| userMap["Score"] = score | |||
| resultOrg = append(resultOrg, userMap) | |||
| } else { | |||
| log.Info("query user error," + err.Error()) | |||
| } | |||
| } | |||
| return resultOrg, nil | |||
| } | |||
| func GetImageInfoFromPromote(ctx *context.Context) { | |||
| imageInfo, err := GetImageInfo() | |||
| if err != nil { | |||
| ctx.ServerError("500", err) | |||
| return | |||
| } | |||
| ctx.JSON(200, imageInfo) | |||
| } | |||
| func GetUserRankFromPromote(ctx *context.Context) { | |||
| index := ctx.Params("index") | |||
| resultUserRank, err := GetRankUser(index) | |||
| if err != nil { | |||
| ctx.ServerError("500", err) | |||
| return | |||
| } | |||
| ctx.JSON(200, resultUserRank) | |||
| } | |||
| func RecommendOrgFromPromote(ctx *context.Context) { | |||
| resultOrg, err := GetRecommendOrg() | |||
| @@ -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 ( | |||
| @@ -493,34 +491,22 @@ func cloudBrainShow(ctx *context.Context, tpName base.TplName, jobType models.Jo | |||
| } | |||
| } | |||
| taskRoles := jobRes.TaskRoles | |||
| if jobRes.JobStatus.State != string(models.JobFailed) { | |||
| taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{})) | |||
| ctx.Data["taskRes"] = taskRes | |||
| task.Status = taskRes.TaskStatuses[0].State | |||
| task.ContainerID = taskRes.TaskStatuses[0].ContainerID | |||
| task.ContainerIp = taskRes.TaskStatuses[0].ContainerIP | |||
| models.ParseAndSetDurationFromCloudBrainOne(jobRes, task) | |||
| if task.DeletedAt.IsZero() { //normal record | |||
| err = models.UpdateJob(task) | |||
| if err != nil { | |||
| ctx.Data["error"] = err.Error() | |||
| return | |||
| } | |||
| } else { //deleted record | |||
| taskRes, _ := models.ConvertToTaskPod(taskRoles[cloudbrain.SubTaskName].(map[string]interface{})) | |||
| ctx.Data["taskRes"] = taskRes | |||
| ctx.Data["ExitDiagnostics"] = taskRes.TaskStatuses[0].ExitDiagnostics | |||
| task.Status = taskRes.TaskStatuses[0].State | |||
| task.ContainerID = taskRes.TaskStatuses[0].ContainerID | |||
| task.ContainerIp = taskRes.TaskStatuses[0].ContainerIP | |||
| models.ParseAndSetDurationFromCloudBrainOne(jobRes, task) | |||
| if task.DeletedAt.IsZero() { //normal record | |||
| err = models.UpdateJob(task) | |||
| if err != nil { | |||
| ctx.Data["error"] = err.Error() | |||
| return | |||
| } | |||
| } else { | |||
| task.Status = jobRes.JobStatus.State | |||
| taskRes := models.TaskPod{TaskStatuses: []models.TaskStatuses{ | |||
| { | |||
| State: jobRes.JobStatus.State, | |||
| }, | |||
| }} | |||
| ctx.Data["taskRes"] = taskRes | |||
| jobRes.JobStatus.StartTime = time.Unix(int64(task.CreatedUnix), 0).Format("2006-01-02 15:04:05") | |||
| jobRes.JobStatus.EndTime = time.Unix(int64(task.UpdatedUnix), 0).Format("2006-01-02 15:04:05") | |||
| } else { //deleted record | |||
| } | |||
| ctx.Data["result"] = jobRes | |||
| @@ -601,6 +587,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 +1389,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 +1403,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 | |||
| } | |||
| } | |||
| } | |||
| @@ -432,7 +432,7 @@ func RetrieveRepoMetas(ctx *context.Context, repo *models.Repository, isPull boo | |||
| return nil | |||
| } | |||
| brs, _, err := ctx.Repo.GitRepo.GetBranches(0,0) | |||
| brs, _, err := ctx.Repo.GitRepo.GetBranches(0, 0) | |||
| if err != nil { | |||
| ctx.ServerError("GetBranches", err) | |||
| return nil | |||
| @@ -1302,6 +1302,35 @@ func UpdateIssueContent(ctx *context.Context) { | |||
| }) | |||
| } | |||
| // UpdateIssueRef change issue's code reference | |||
| func UpdateIssueRef(ctx *context.Context) { | |||
| issues := getActionIssues(ctx) | |||
| if ctx.Written() { | |||
| return | |||
| } | |||
| issue := issues[0] | |||
| if issue == nil { | |||
| log.Error("UpdateIssueRef param error ") | |||
| return | |||
| } | |||
| if !ctx.IsSigned || (ctx.User.ID != issue.PosterID && !ctx.Repo.CanWriteIssuesOrPulls(issue.IsPull)) { | |||
| ctx.Error(403) | |||
| return | |||
| } | |||
| ref := ctx.Query("id") | |||
| if err := issue_service.ChangeRef(issue, ctx.User, ref); err != nil { | |||
| ctx.ServerError("ChangeRef", err) | |||
| return | |||
| } | |||
| ctx.JSON(200, map[string]interface{}{ | |||
| "ref": issue.Ref, | |||
| }) | |||
| } | |||
| // UpdateIssueMilestone change issue's milestone | |||
| func UpdateIssueMilestone(ctx *context.Context) { | |||
| issues := getActionIssues(ctx) | |||
| @@ -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 | |||
| @@ -1473,9 +1476,9 @@ func paramCheckCreateTrainJob(form auth.CreateModelArtsTrainJobForm) error { | |||
| return errors.New("启动文件必须是python文件") | |||
| } | |||
| if form.WorkServerNumber > 25 || form.WorkServerNumber < 1 { | |||
| log.Error("the WorkServerNumber(%d) must be in (1,25)", form.WorkServerNumber) | |||
| return errors.New("计算节点数必须在1-25之间") | |||
| if form.WorkServerNumber > 2 || form.WorkServerNumber < 1 { | |||
| log.Error("the WorkServerNumber(%d) must be in (1,2)", form.WorkServerNumber) | |||
| return errors.New("计算节点数必须在1-2之间") | |||
| } | |||
| if form.BranchName == "" { | |||
| log.Error("the branch must not be null!", form.BranchName) | |||
| @@ -1491,9 +1494,9 @@ func paramCheckCreateInferenceJob(form auth.CreateModelArtsInferenceJobForm) err | |||
| return errors.New("启动文件必须是python文件") | |||
| } | |||
| if form.WorkServerNumber > 25 || form.WorkServerNumber < 1 { | |||
| log.Error("the WorkServerNumber(%d) must be in (1,25)", form.WorkServerNumber) | |||
| return errors.New("计算节点数必须在1-25之间") | |||
| if form.WorkServerNumber > 2 || form.WorkServerNumber < 1 { | |||
| log.Error("the WorkServerNumber(%d) must be in (1,2)", form.WorkServerNumber) | |||
| return errors.New("计算节点数必须在1-2之间") | |||
| } | |||
| if form.ModelName == "" { | |||
| @@ -325,6 +325,8 @@ func RegisterRoutes(m *macaron.Macaron) { | |||
| m.Get("/action/notification", routers.ActionNotification) | |||
| m.Get("/recommend/org", routers.RecommendOrgFromPromote) | |||
| m.Get("/recommend/repo", routers.RecommendRepoFromPromote) | |||
| m.Get("/recommend/userrank/:index", routers.GetUserRankFromPromote) | |||
| m.Get("/recommend/imageinfo", routers.GetImageInfoFromPromote) | |||
| m.Post("/all/search/", routers.Search) | |||
| m.Get("/all/search/", routers.EmptySearch) | |||
| m.Get("/all/dosearch/", routers.SearchApi) | |||
| @@ -892,6 +894,7 @@ func RegisterRoutes(m *macaron.Macaron) { | |||
| m.Post("/labels", reqRepoIssuesOrPullsWriter, repo.UpdateIssueLabel) | |||
| m.Post("/milestone", reqRepoIssuesOrPullsWriter, repo.UpdateIssueMilestone) | |||
| m.Post("/assignee", reqRepoIssuesOrPullsWriter, repo.UpdateIssueAssignee) | |||
| m.Post("/ref", reqRepoIssuesOrPullsWriter, repo.UpdateIssueRef) | |||
| m.Post("/request_review", reqRepoIssuesOrPullsReader, repo.UpdatePullReviewRequest) | |||
| m.Post("/status", reqRepoIssuesOrPullsWriter, repo.UpdateIssueStatus) | |||
| m.Post("/resolve_conversation", reqRepoIssuesOrPullsReader, repo.UpdateResolveConversation) | |||
| @@ -21,3 +21,12 @@ func ChangeContent(issue *models.Issue, doer *models.User, content string) (err | |||
| return nil | |||
| } | |||
| // ChangeRef changes issue ref, as the given user. | |||
| func ChangeRef(issue *models.Issue, doer *models.User, ref string) (err error) { | |||
| if err := issue.ChangeRef(doer, ref); err != nil { | |||
| return err | |||
| } | |||
| return nil | |||
| } | |||
| @@ -29,7 +29,7 @@ | |||
| <h4 class="ui top attached header"> | |||
| {{.i18n.Tr "repo.submit_image"}} | |||
| </h4> | |||
| <div class="submit-image-tmplvalue" style="display: none;" data-link="{{$.Link}}"></div> | |||
| <div class="submit-image-tmplvalue" style="display: none;" data-link="{{$.Link}}" data-edit-page="{{.PageIsAdminImages}}"></div> | |||
| <div class="ui attached segment" style="padding: 2em 3em;padding-bottom: 7rem;"> | |||
| <div class="ui form" id="form_image"> | |||
| <input type="hidden" name="edit" value="edit"> | |||
| @@ -125,5 +125,4 @@ | |||
| </div> | |||
| </div> | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| {{template "base/footer" .}} | |||
| @@ -4,7 +4,6 @@ | |||
| <div class="ui container"> | |||
| {{template "base/alert" .}} | |||
| <div class="ui negative message" style="display: none;"> | |||
| </div> | |||
| <h4 class="ui top attached header"> | |||
| {{.i18n.Tr "admin.datasets.dataset_manage_panel"}} ({{.i18n.Tr "admin.total" .Total}}) | |||
| @@ -12,6 +11,15 @@ | |||
| <div class="ui attached segment"> | |||
| {{template "admin/dataset/search" .}} | |||
| </div> | |||
| <div class="ui attached segment"> | |||
| <div class="ui ten wide column"> | |||
| <div class="ui checkbox" id="dataset_check"> | |||
| <input type="checkbox"> | |||
| <label>{{.i18n.Tr "admin.datasets.only_recommend"}}</label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="ui attached table segment"> | |||
| <table class="ui very basic striped table"> | |||
| <thead> | |||
| @@ -27,7 +35,7 @@ | |||
| {{range .Datasets}} | |||
| <tr> | |||
| <td>{{.ID}}</td> | |||
| <td style="display: flex;align-items: center;"><a href="{{AppSubUrl}}/">{{.Title}}</a>{{if .Recommend}}<img src="/img/jian.svg" style="margin-left: 0.5rem;">{{end}}</td> | |||
| <td style="display: flex;align-items: center;"><a href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Alias}}/datasets">{{.Title}}</a>{{if .Recommend}}<img src="/img/jian.svg" style="margin-left: 0.5rem;">{{end}}</td> | |||
| <td><i class="fa fa{{if .IsPrivate}}-check{{end}}-square-o"></i></td> | |||
| <td><span title="{{.CreatedUnix.FormatLong}}">{{.CreatedUnix.FormatShort}}</span></td> | |||
| <td>{{if .Recommend}}<span class="set_dataset" style="color: rgb(250, 140, 22);cursor: pointer;" data-url="{{$.Link}}/{{.ID}}/action/unrecommend">{{$.i18n.Tr "admin.datasets.unrecommend"}}</span>{{else}}<span class="set_dataset" style="color: rgb(19, 194, 141);cursor: pointer;" data-url="{{$.Link}}/{{.ID}}/action/recommend">{{$.i18n.Tr "admin.datasets.recommend"}}</span>{{end}}</td> | |||
| @@ -40,4 +48,4 @@ | |||
| {{template "base/paginate" .}} | |||
| </div> | |||
| </div> | |||
| {{template "base/footer" .}} | |||
| {{template "base/footer" .}} | |||
| @@ -6,18 +6,18 @@ | |||
| <i class="dropdown icon"></i> | |||
| </span> | |||
| <div class="menu"> | |||
| <a class='{{if or (eq .SortType "oldest") (not .SortType)}}active{{end}} item' href='{{$.Link}}?sort=oldest&q={{$.Keyword}}'>{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> | |||
| <a class='{{if eq .SortType "newest"}}active{{end}} item' href='{{$.Link}}?sort=newest&q={{$.Keyword}}'>{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a> | |||
| <a class='{{if eq .SortType "alphabetically"}}active{{end}} item' href='{{$.Link}}?sort=alphabetically&q={{$.Keyword}}'>{{.i18n.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> | |||
| <a class='{{if eq .SortType "reversealphabetically"}}active{{end}} item' href='{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}'>{{.i18n.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> | |||
| <a class='{{if eq .SortType "recentupdate"}}active{{end}} item' href='{{$.Link}}?sort=recentupdate&q={{$.Keyword}}'>{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> | |||
| <a class='{{if eq .SortType "leastupdate"}}active{{end}} item' href='{{$.Link}}?sort=leastupdate&q={{$.Keyword}}'>{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> | |||
| <a class='{{if eq .SortType "moststars"}}active{{end}} item' href='{{$.Link}}?sort=moststars&q={{$.Keyword}}&tab={{$.TabName}}'>{{.i18n.Tr "repo.issues.filter_sort.moststars"}}</a> | |||
| <a class='{{if eq .SortType "feweststars"}}active{{end}} item' href='{{$.Link}}?sort=feweststars&q={{$.Keyword}}&tab={{$.TabName}}'>{{.i18n.Tr "repo.issues.filter_sort.feweststars"}}</a> | |||
| <a class='{{if eq .SortType "mostforks"}}active{{end}} item' href='{{$.Link}}?sort=mostforks&q={{$.Keyword}}&tab={{$.TabName}}'>{{.i18n.Tr "repo.issues.filter_sort.mostforks"}}</a> | |||
| <a class='{{if eq .SortType "fewestforks"}}active{{end}} item' href='{{$.Link}}?sort=fewestforks&q={{$.Keyword}}&tab={{$.TabName}}'>{{.i18n.Tr "repo.issues.filter_sort.fewestforks"}}</a> | |||
| <a class='{{if eq .SortType "size"}}active{{end}} item' href='{{$.Link}}?sort=size&q={{$.Keyword}}'>{{.i18n.Tr "repo.issues.label.filter_sort.by_size"}}</a> | |||
| <a class='{{if eq .SortType "reversesize"}}active{{end}} item' href='{{$.Link}}?sort=reversesize&q={{$.Keyword}}'>{{.i18n.Tr "repo.issues.label.filter_sort.reverse_by_size"}}</a> | |||
| <a class='{{if or (eq .SortType "oldest") (not .SortType)}}active{{end}} item' href='{{$.Link}}?sort=oldest&q={{$.Keyword}}&recommend={{$.Recommend}}'>{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> | |||
| <a class='{{if eq .SortType "newest"}}active{{end}} item' href='{{$.Link}}?sort=newest&q={{$.Keyword}}&recommend={{$.Recommend}}'>{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a> | |||
| <a class='{{if eq .SortType "alphabetically"}}active{{end}} item' href='{{$.Link}}?sort=alphabetically&q={{$.Keyword}}&recommend={{$.Recommend}}'>{{.i18n.Tr "repo.issues.label.filter_sort.alphabetically"}}</a> | |||
| <a class='{{if eq .SortType "reversealphabetically"}}active{{end}} item' href='{{$.Link}}?sort=reversealphabetically&q={{$.Keyword}}&recommend={{$.Recommend}}'>{{.i18n.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a> | |||
| <a class='{{if eq .SortType "recentupdate"}}active{{end}} item' href='{{$.Link}}?sort=recentupdate&q={{$.Keyword}}&recommend={{$.Recommend}}'>{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> | |||
| <a class='{{if eq .SortType "leastupdate"}}active{{end}} item' href='{{$.Link}}?sort=leastupdate&q={{$.Keyword}}&recommend={{$.Recommend}}'>{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> | |||
| <a class='{{if eq .SortType "moststars"}}active{{end}} item' href='{{$.Link}}?sort=moststars&q={{$.Keyword}}&tab={{$.TabName}}&recommend={{$.Recommend}}'>{{.i18n.Tr "repo.issues.filter_sort.moststars"}}</a> | |||
| <a class='{{if eq .SortType "feweststars"}}active{{end}} item' href='{{$.Link}}?sort=feweststars&q={{$.Keyword}}&tab={{$.TabName}}&recommend={{$.Recommend}}'>{{.i18n.Tr "repo.issues.filter_sort.feweststars"}}</a> | |||
| <a class='{{if eq .SortType "mostforks"}}active{{end}} item' href='{{$.Link}}?sort=mostforks&q={{$.Keyword}}&tab={{$.TabName}}&recommend={{$.Recommend}}'>{{.i18n.Tr "repo.issues.filter_sort.mostforks"}}</a> | |||
| <a class='{{if eq .SortType "fewestforks"}}active{{end}} item' href='{{$.Link}}?sort=fewestforks&q={{$.Keyword}}&tab={{$.TabName}}&recommend={{$.Recommend}}'>{{.i18n.Tr "repo.issues.filter_sort.fewestforks"}}</a> | |||
| <a class='{{if eq .SortType "size"}}active{{end}} item' href='{{$.Link}}?sort=size&q={{$.Keyword}}&recommend={{$.Recommend}}'>{{.i18n.Tr "repo.issues.label.filter_sort.by_size"}}</a> | |||
| <a class='{{if eq .SortType "reversesize"}}active{{end}} item' href='{{$.Link}}?sort=reversesize&q={{$.Keyword}}&recommend={{$.Recommend}}'>{{.i18n.Tr "repo.issues.label.filter_sort.reverse_by_size"}}</a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -26,4 +26,4 @@ | |||
| <input name="q" value="{{.Keyword}}" placeholder='{{.i18n.Tr "explore.search"}}...' autofocus> | |||
| <button class="ui blue button">{{.i18n.Tr "explore.search"}}</button> | |||
| </div> | |||
| </form> | |||
| </form> | |||
| @@ -121,12 +121,13 @@ | |||
| <i class="dropdown icon"></i> | |||
| </span> | |||
| <div class="menu"> | |||
| <a class="{{if eq .SortType "newest"}}active{{end}} item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a> | |||
| <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> | |||
| <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> | |||
| <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> | |||
| <a class="{{if eq .SortType "downloadtimes"}}active{{end}} item" href="{{$.Link}}?sort=downloadtimes&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.downloadtimes"}}</a> | |||
| <a class="{{if eq .SortType "moststars"}}active{{end}} item" href="{{$.Link}}?sort=moststars&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}">{{.i18n.Tr "repo.issues.filter_sort.moststars"}}</a> | |||
| <a class="{{if eq .SortType "default"}}active{{end}} item" href="{{$.Link}}?sort=default&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.default"}}</a> | |||
| <a class="{{if eq .SortType "newest"}}active{{end}} item" href="{{$.Link}}?sort=newest&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a> | |||
| <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?sort=oldest&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a> | |||
| <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?sort=recentupdate&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a> | |||
| <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?sort=leastupdate&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a> | |||
| <a class="{{if eq .SortType "downloadtimes"}}active{{end}} item" href="{{$.Link}}?sort=downloadtimes&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.downloadtimes"}}</a> | |||
| <a class="{{if eq .SortType "moststars"}}active{{end}} item" href="{{$.Link}}?sort=moststars&q={{$.Keyword}}&tab={{$.TabName}}&category={{$.Category}}&task={{$.Task}}&license={{$.License}}&recommend={{$.Recommend}}">{{.i18n.Tr "repo.issues.filter_sort.moststars"}}</a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -140,15 +141,17 @@ | |||
| {{end}} | |||
| <div class="ui row" style="clear: both;" id="dataset-base"> | |||
| <el-checkbox v-model="checked" style="padding: 0.5rem 1rem;" @change="handleCheckedChange" >仅显示平台推荐</el-checkbox> | |||
| <div class="ui two cards"> | |||
| {{range $k, $v :=.Datasets}} | |||
| <div class="ui card" @click="gotoDataset('{{.Repo.Link}}/datasets')" style="cursor: pointer;box-shadow: 0px 4px 4px 0px rgba(232,232,232,0.6);border: 1px solid rgba(232, 232, 232, 1);"> | |||
| <div class="content" style="border-bottom: none;"> | |||
| <div class="repo_dataset_header" style="display: flex;align-items: center;justify-content: space-between;"> | |||
| <a href="{{.Repo.Link}}/datasets" style="font-size: 12px;color: #3291F8;height: 24px;">{{.Repo.OwnerName}} / {{.Repo.Alias}}{{if .Recommend}}<img src="/img/jian.svg" style="margin-left: 0.5rem;">{{end}}</a> | |||
| <a href="{{.Repo.Link}}/datasets" style="font-size: 12px;color: #3291F8;height: 24px;">{{.Repo.OwnerName}} / {{.Repo.Alias}}</a> | |||
| {{if $.IsSigned}} | |||
| <span style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;" @click.stop="postSquareStar({{.ID}},'{{.Repo.Link}}/datasets',{{$k}})"> | |||
| <span style="line-height: 1;color: #101010;margin-bottom: -2px;"><i class="ri-download-line" style="font-size: 1.3em;"></i></span> | |||
| <span style="line-height: 1;color: #101010;margin-right: 0.6rem;">{{.DownloadTimes}}</span> | |||
| <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;"> | |||
| <svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke" :class='{stars_active:starActives[{{$k}}]}'><path d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z"></path></svg> | |||
| </div> | |||
| @@ -156,6 +159,8 @@ | |||
| </span> | |||
| {{else}} | |||
| <span style="display: flex;align-items: center;justify-content: flex-end;cursor: pointer;"> | |||
| <span style="line-height: 1;color: #101010;margin-bottom: -2px;"><i class="ri-download-line" style="font-size: 1.3em;"></i></span> | |||
| <span style="line-height: 1;color: #101010;margin-right: 0.6rem;">{{.DownloadTimes}}</span> | |||
| <div style="line-height: 1;margin-right: 4px;margin-bottom: -2px;"> | |||
| <svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke" :class='{stars_active:starActives[{{$k}}]}'><path d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z"></path></svg> | |||
| </div> | |||
| @@ -163,7 +168,7 @@ | |||
| </span> | |||
| {{end}} | |||
| </div> | |||
| <div style="font-size: 16px;color:#0366D6;font-family: SourceHanSansSC-medium;height: 27px;font-weight: bold;">{{.Title}}</div> | |||
| <div style="font-size: 16px;color:#0366D6;font-family: SourceHanSansSC-medium;height: 27px;font-weight: bold;display: flex;align-items: center"><span title="{{.Title}}" class="nowrap" style="display: inline-block;">{{.Title}}</span>{{if .Recommend}}<img src="/img/jian.svg" style="margin-left: 0.5rem;">{{end}}</div> | |||
| {{if or (.Category) (.Task) (.License)}} | |||
| <div style="font-size: 12px;margin-top: 5px;"> | |||
| {{if .Category}} | |||
| @@ -1,4 +1,4 @@ | |||
| <a href="https://openi.org.cn/html/2020/qimengxingdong_0813/450.html" target="_blank"><img class="ui mini image" src="/img/banner-qimen-4X3.jpg" style="width:100%;"></a> | |||
| <a href="https://openi.org.cn/index.php?m=content&c=index&a=lists&catid=208" target="_blank"><img class="ui mini image" src="https://openi.org.cn/uploadfile/2022/0507/e8bdd42ed598f12.jpg" style="width:100%;"></a> | |||
| <div class="ui secondary pointing menu"> | |||
| <div class="active item"> | |||
| @@ -36,6 +36,20 @@ | |||
| <!--组织--> | |||
| <div class="ui container homeorg"> | |||
| <div class="ui stackable grid"> | |||
| <div class="sixteen wide tablet four wide computer column homeorg-tit"> | |||
| <h2>{{.page_recommend_activity}}</h2> | |||
| <p><span class="ui text grey">{{.page_recommend_activity_desc}}</p> | |||
| </div> | |||
| <div class="sixteen wide tablet twelve wide computer column"> | |||
| <div class="event-list"> | |||
| <div class="swiper-wrapper" id="recommendactivity"> | |||
| </div> | |||
| <div class="swiper-pagination"></div> | |||
| </div> | |||
| </div> | |||
| <div class="sixteen wide tablet four wide computer column homeorg-tit"> | |||
| <h2>{{.page_recommend_org}}</h2> | |||
| <p><span class="ui text grey">{{.page_recommend_org_desc}} </span><a href="{{.RecommendURL}}">{{.page_recommend_org_commit}}</a></p> | |||
| @@ -11,5 +11,6 @@ | |||
| <p><a href="{{AppUrl}}user/activate?code={{.Code}}">{{AppUrl}}user/activate?code={{.Code}}</a></p> | |||
| <p>Not working? Try copying and pasting it to your browser.</p> | |||
| <p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p> | |||
| <p>退订(TD)</p> | |||
| </body> | |||
| </html> | |||
| @@ -11,5 +11,6 @@ | |||
| <p><a href="{{AppUrl}}user/activate_email?code={{.Code}}&email={{.Email}}">{{AppUrl}}user/activate_email?code={{.Code}}&email={{.Email}}</a></p> | |||
| <p>Not working? Try copying and pasting it to your browser.</p> | |||
| <p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p> | |||
| <p>退订(TD)</p> | |||
| </body> | |||
| </html> | |||
| @@ -11,5 +11,6 @@ | |||
| <p><a href="{{AppUrl}}user/login">{{AppUrl}}user/login</a></p> | |||
| <p>If this account has been created for you, please <a href="{{AppUrl}}user/forgot_password">set your password</a> first.</p> | |||
| <p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p> | |||
| <p>退订(TD)</p> | |||
| </body> | |||
| </html> | |||
| @@ -12,5 +12,6 @@ | |||
| <p><a href="{{AppUrl}}user/recover_account?code={{.Code}}">{{AppUrl}}user/recover_account?code={{.Code}}</a></p> | |||
| <p>Not working? Try copying and pasting it to your browser.</p> | |||
| <p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p> | |||
| <p>退订(TD)</p> | |||
| </body> | |||
| </html> | |||
| @@ -15,6 +15,8 @@ | |||
| --- | |||
| <br> | |||
| <a href="{{.Link}}">View it on {{AppName}}</a>. | |||
| <br> | |||
| 退订(TD) | |||
| </p> | |||
| </div> | |||
| </body> | |||
| @@ -53,6 +53,8 @@ | |||
| --- | |||
| <br> | |||
| <a href="{{.Link}}">View it on {{AppName}}</a>. | |||
| <br> | |||
| 退订(TD) | |||
| </p> | |||
| </div> | |||
| </body> | |||
| @@ -15,6 +15,8 @@ | |||
| --- | |||
| <br> | |||
| <a href="{{.Link}}">View it on {{AppName}}</a>. | |||
| <br> | |||
| 退订(TD) | |||
| </p> | |||
| </div> | |||
| </body> | |||
| @@ -15,7 +15,7 @@ | |||
| <span class="help">{{.i18n.Tr "org.org_name_helper"}}</span> | |||
| </div> | |||
| <div class="inline field {{if .Err_OrgVisibility}}error{{end}}"> | |||
| <!-- <div class="inline field {{if .Err_OrgVisibility}}error{{end}}"> | |||
| <span class="inline required field"><label for="visibility">{{.i18n.Tr "org.settings.visibility"}}</label></span> | |||
| <div class="inline-grouped-list"> | |||
| <div class="ui radio checkbox"> | |||
| @@ -31,7 +31,7 @@ | |||
| <label>{{.i18n.Tr "org.settings.visibility.private"}}</label> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> --> | |||
| <div class="inline field" id="permission_box"> | |||
| <label>{{.i18n.Tr "org.settings.permission"}}</label> | |||
| @@ -43,13 +43,13 @@ | |||
| </div> | |||
| </div> | |||
| <div class="field"> | |||
| <div class="ui radio checkbox"> | |||
| <div class="ui radio disabled checkbox"> | |||
| <input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="1" {{if eq .CurrentVisibility 1}}checked{{end}}/> | |||
| <label>{{.i18n.Tr "org.settings.visibility.limited"}}</label> | |||
| </div> | |||
| </div> | |||
| <div class="field"> | |||
| <div class="ui radio checkbox"> | |||
| <div class="ui radio disabled checkbox"> | |||
| <input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="2" {{if eq .CurrentVisibility 2}}checked{{end}}/> | |||
| <label>{{.i18n.Tr "org.settings.visibility.private"}}</label> | |||
| </div> | |||
| @@ -13,17 +13,15 @@ | |||
| <el-form label-width="140px"> | |||
| {{.CsrfTokenHtml}} | |||
| <el-form-item label='{{$.i18n.Tr "dataset.dataset_available_clusters"}}:' prop="title"> | |||
| <el-button :class="{active:type==0}" size="small" style="margin: 0;border-radius: 0.28571429rem 0 0 0.28571429rem;" @click="uploadGpu">CPU/GPU</el-button> | |||
| <el-button :class="{active:type==1}" size="small" style="margin: 0 0 0 -4px;border-radius: 0 0.28571429rem 0.28571429rem 0;" @click="uploadNpu">NPU</el-button> | |||
| <!-- <span>请输入字母、数字、_和-,最长64个字符,且不能以中划线(-)结尾。</span> --> | |||
| <el-button :class="{active:type==0}" :disabled="clusterFlag" size="small" style="margin: 0;border-radius: 0.28571429rem 0 0 0.28571429rem;" @click="uploadGpu">CPU/GPU</el-button> | |||
| <el-button :class="{active:type==1}" :disabled="clusterFlag" size="small" style="margin: 0 0 0 -4px;border-radius: 0 0.28571429rem 0.28571429rem 0;" @click="uploadNpu">NPU</el-button> | |||
| </el-form-item> | |||
| <el-form-item label='{{$.i18n.Tr "dataset.file_description"}}:' prop="description"> | |||
| <el-input type="textarea" :rows="3" maxlength="255" placeholder="{{$.i18n.Tr "repo.modelarts.train_job.new_place"}}" v-model="desc"></el-input> | |||
| </el-form-item> | |||
| <el-form-item label='{{$.i18n.Tr "dataset.data_upload"}}:' prop="category"> | |||
| <minio-uploader :uploadtype="type" :desc="desc"></minio-uploader> | |||
| </el-form-item> | |||
| <minio-uploader :uploadtype="type" :desc="desc" @setcluster="setcluster"></minio-uploader> | |||
| </el-form-item> | |||
| <div style='display:none;' | |||
| id="minioUploader-params" | |||
| data-uuid="{{.uuid}}" | |||
| @@ -1,171 +1,205 @@ | |||
| {{template "base/head" .}} | |||
| <style> | |||
| .according-panel-heading{ | |||
| box-sizing: border-box; | |||
| padding: 8px 16px; | |||
| color: #252b3a; | |||
| background-color: #f2f5fc; | |||
| line-height: 1.5; | |||
| cursor: pointer; | |||
| -moz-user-select: none; | |||
| -webkit-user-select: none; | |||
| -ms-user-select: none; | |||
| -khtml-user-select: none; | |||
| user-select: none; | |||
| } | |||
| .accordion-panel-title { | |||
| margin-top: 0; | |||
| margin-bottom: 0; | |||
| color: #252b3a; | |||
| } | |||
| .accordion-panel-title-content{ | |||
| vertical-align: middle; | |||
| display: inline-block; | |||
| width: calc(100% - 32px); | |||
| cursor: default; | |||
| } | |||
| .acc-margin-bottom { | |||
| margin-bottom: 5px; | |||
| } | |||
| .title_text { | |||
| font-size: 12px; | |||
| } | |||
| .ac-display-inblock { | |||
| display: inline-block; | |||
| } | |||
| .cti-mgRight-sm { | |||
| margin-right: 8px; | |||
| } | |||
| .ac-text-normal { | |||
| font-size: 14px; | |||
| color: #575d6c; | |||
| } | |||
| .uc-accordionTitle-black { | |||
| color: #333; | |||
| } | |||
| .accordion-border{ | |||
| border:1px solid #cce2ff; | |||
| } | |||
| .padding0{ | |||
| padding: 0 !important; | |||
| } | |||
| .content-pad{ | |||
| padding: 15px 35px; | |||
| } | |||
| .content-margin{ | |||
| margin:10px 5px ; | |||
| } | |||
| .tab_2_content { | |||
| min-height: 380px; | |||
| margin-left: 10px; | |||
| } | |||
| .ac-grid { | |||
| display: block; | |||
| *zoom: 1; | |||
| } | |||
| .ac-grid-col { | |||
| float: left; | |||
| width: 100%; | |||
| } | |||
| .ac-grid-col2 .ac-grid-col { | |||
| width: 50%; | |||
| } | |||
| .ti-form { | |||
| text-align: left; | |||
| max-width: 100%; | |||
| vertical-align: middle; | |||
| } | |||
| .ti-form>tbody { | |||
| font-size: 12px; | |||
| } | |||
| .ti-form>tbody, .ti-form>tbody>tr { | |||
| vertical-align: inherit; | |||
| } | |||
| .info_text { | |||
| padding-bottom: 20px; | |||
| padding-right: 20px; | |||
| font-size: 12px; | |||
| } | |||
| .ti-text-form-label { | |||
| padding-bottom: 20px; | |||
| padding-right: 20px; | |||
| color: #8a8e99; | |||
| font-size: 12px; | |||
| white-space: nowrap !important; | |||
| width: 80px; | |||
| line-height: 30px; | |||
| } | |||
| .ti-text-form-content{ | |||
| line-height: 30px; | |||
| padding-bottom: 20px; | |||
| } | |||
| .ti-form>tbody>tr>td { | |||
| vertical-align: top; | |||
| white-space: normal; | |||
| } | |||
| td, th { | |||
| padding: 0; | |||
| } | |||
| .ac-grid-col .text-span { | |||
| width: 450px; | |||
| overflow: hidden; | |||
| text-overflow: ellipsis; | |||
| white-space: nowrap; | |||
| } | |||
| .redo-color{ | |||
| color: #3291F8; | |||
| } | |||
| .ti-action-menu-item:not(:last-child){ | |||
| margin-right: 10px; | |||
| padding-right: 11px; | |||
| text-decoration: none!important; | |||
| color: #526ecc; | |||
| cursor: pointer; | |||
| display: inline-block; | |||
| -moz-user-select: none; | |||
| -webkit-user-select: none; | |||
| -ms-user-select: none; | |||
| -khtml-user-select: none; | |||
| user-select: none; | |||
| position: relative; | |||
| } | |||
| .ti-action-menu-item:not(:last-child):after { | |||
| content: ""; | |||
| display: inline-block; | |||
| position: absolute; | |||
| height: 12px; | |||
| right: 0; | |||
| top: 50%; | |||
| -webkit-transform: translateY(-6px); | |||
| -ms-transform: translateY(-6px); | |||
| -o-transform: translateY(-6px); | |||
| transform: translateY(-6px); | |||
| border-right: 1px solid #dfe1e6; | |||
| } | |||
| .text-width80{ | |||
| width: 100px; | |||
| line-height: 30px; | |||
| } | |||
| .border-according{ | |||
| border: 1px solid #dfe1e6; | |||
| } | |||
| .disabled { | |||
| .according-panel-heading { | |||
| box-sizing: border-box; | |||
| padding: 8px 16px; | |||
| color: #252b3a; | |||
| background-color: #f2f5fc; | |||
| line-height: 1.5; | |||
| cursor: pointer; | |||
| -moz-user-select: none; | |||
| -webkit-user-select: none; | |||
| -ms-user-select: none; | |||
| -khtml-user-select: none; | |||
| user-select: none; | |||
| } | |||
| .accordion-panel-title { | |||
| margin-top: 0; | |||
| margin-bottom: 0; | |||
| color: #252b3a; | |||
| } | |||
| .accordion-panel-title-content { | |||
| vertical-align: middle; | |||
| display: inline-block; | |||
| width: calc(100% - 32px); | |||
| cursor: default; | |||
| } | |||
| .acc-margin-bottom { | |||
| margin-bottom: 5px; | |||
| } | |||
| .title_text { | |||
| font-size: 12px; | |||
| } | |||
| .ac-display-inblock { | |||
| display: inline-block; | |||
| } | |||
| .cti-mgRight-sm { | |||
| margin-right: 8px; | |||
| } | |||
| .ac-text-normal { | |||
| font-size: 14px; | |||
| color: #575d6c; | |||
| } | |||
| .uc-accordionTitle-black { | |||
| color: #333; | |||
| } | |||
| .accordion-border { | |||
| border: 1px solid #cce2ff; | |||
| } | |||
| .padding0 { | |||
| padding: 0 !important; | |||
| } | |||
| .content-pad { | |||
| padding: 15px 35px; | |||
| } | |||
| .content-margin { | |||
| margin: 10px 5px; | |||
| } | |||
| .tab_2_content { | |||
| min-height: 420px; | |||
| margin-left: 10px; | |||
| } | |||
| .ac-grid { | |||
| display: block; | |||
| *zoom: 1; | |||
| } | |||
| .ac-grid-col { | |||
| float: left; | |||
| width: 100%; | |||
| } | |||
| .ac-grid-col2 .ac-grid-col { | |||
| width: 50%; | |||
| } | |||
| .ti-form { | |||
| text-align: left; | |||
| max-width: 100%; | |||
| vertical-align: middle; | |||
| } | |||
| .ti-form>tbody { | |||
| font-size: 12px; | |||
| } | |||
| .ti-form>tbody, | |||
| .ti-form>tbody>tr { | |||
| vertical-align: inherit; | |||
| } | |||
| .info_text { | |||
| padding-bottom: 20px; | |||
| padding-right: 20px; | |||
| font-size: 12px; | |||
| } | |||
| .ti-text-form-label { | |||
| padding-bottom: 20px; | |||
| padding-right: 20px; | |||
| color: #8a8e99; | |||
| font-size: 12px; | |||
| white-space: nowrap !important; | |||
| width: 80px; | |||
| line-height: 30px; | |||
| } | |||
| .ti-text-form-content { | |||
| line-height: 30px; | |||
| padding-bottom: 20px; | |||
| } | |||
| .ti-form>tbody>tr>td { | |||
| vertical-align: top; | |||
| white-space: normal; | |||
| } | |||
| td, | |||
| th { | |||
| padding: 0; | |||
| } | |||
| .ac-grid-col .text-span { | |||
| width: 450px; | |||
| overflow: hidden; | |||
| text-overflow: ellipsis; | |||
| white-space: nowrap; | |||
| } | |||
| .redo-color { | |||
| color: #3291F8; | |||
| } | |||
| .ti-action-menu-item:not(:last-child) { | |||
| margin-right: 10px; | |||
| padding-right: 11px; | |||
| text-decoration: none !important; | |||
| color: #526ecc; | |||
| cursor: pointer; | |||
| display: inline-block; | |||
| -moz-user-select: none; | |||
| -webkit-user-select: none; | |||
| -ms-user-select: none; | |||
| -khtml-user-select: none; | |||
| user-select: none; | |||
| position: relative; | |||
| } | |||
| .ti-action-menu-item:not(:last-child):after { | |||
| content: ""; | |||
| display: inline-block; | |||
| position: absolute; | |||
| height: 12px; | |||
| right: 0; | |||
| top: 50%; | |||
| -webkit-transform: translateY(-6px); | |||
| -ms-transform: translateY(-6px); | |||
| -o-transform: translateY(-6px); | |||
| transform: translateY(-6px); | |||
| border-right: 1px solid #dfe1e6; | |||
| } | |||
| .text-width80 { | |||
| width: 100px; | |||
| line-height: 30px; | |||
| } | |||
| .border-according { | |||
| border: 1px solid #dfe1e6; | |||
| } | |||
| .disabled { | |||
| cursor: default; | |||
| pointer-events: none; | |||
| color: rgba(0,0,0,.6) !important; | |||
| color: rgba(0, 0, 0, .6) !important; | |||
| opacity: .45 !important; | |||
| } | |||
| .pad20{ | |||
| border:0px !important; | |||
| } | |||
| .model_file_bread{ | |||
| margin-bottom: -0.5rem !important; | |||
| padding-left: 1rem; | |||
| padding-top: 0.5rem ; | |||
| } | |||
| } | |||
| .pad20 { | |||
| border: 0px !important; | |||
| } | |||
| .model_file_bread { | |||
| margin-bottom: -0.5rem !important; | |||
| padding-left: 1rem; | |||
| padding-top: 0.5rem; | |||
| } | |||
| </style> | |||
| @@ -179,7 +213,7 @@ td, th { | |||
| </div> | |||
| </div> | |||
| <div class="repository"> | |||
| {{template "repo/header" .}} | |||
| {{template "repo/header" .}} | |||
| <div class="ui container"> | |||
| <h4 class="ui header" id="vertical-segment"> | |||
| <div class="ui breadcrumb"> | |||
| @@ -191,11 +225,12 @@ td, th { | |||
| {{$.i18n.Tr "repo.modelarts.notebook"}} | |||
| </a> | |||
| <div class="divider"> / </div> | |||
| <div class="active section">{{.displayJobName}}</div> | |||
| </div> | |||
| <div class="active section">{{.displayJobName}}</div> | |||
| </div> | |||
| </h4> | |||
| {{range $k ,$v := .version_list_task}} | |||
| <div class="ui accordion border-according" id="accordion{{.VersionName}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}" data-version="{{.VersionName}}"> | |||
| <div class="ui accordion border-according" id="accordion{{.VersionName}}" | |||
| data-repopath="{{$.RepoRelPath}}/cloudbrain" data-jobid="{{.ID}}" data-version="{{.VersionName}}"> | |||
| <input type="hidden" id="jobId_input" name="jobId_input" value="{{.JobID}}"> | |||
| <div class="{{if eq $k 0}}active{{end}} title padding0"> | |||
| <div class="according-panel-heading"> | |||
| @@ -205,19 +240,26 @@ td, th { | |||
| <span> | |||
| <div class="ac-display-inblock title_text acc-margin-bottom"> | |||
| <span class="cti-mgRight-sm"> | |||
| {{if not (eq .StartTime 0)}} | |||
| <td>{{TimeSinceUnix1 .StartTime}}</td> | |||
| {{else}} | |||
| <td>{{TimeSinceUnix1 .CreatedUnix}}<td> | |||
| {{end}} | |||
| </span> | |||
| {{if not (eq .StartTime 0)}} | |||
| <td>{{TimeSinceUnix1 .StartTime}}</td> | |||
| {{else}} | |||
| <td>{{TimeSinceUnix1 .CreatedUnix}} | |||
| <td> | |||
| {{end}} | |||
| </span> | |||
| <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}: | |||
| <span id="{{.VersionName}}-status-span"><i id="icon" style="vertical-align: middle;" class="{{.Status}}"></i><span id="text" style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span> | |||
| <span id="{{.VersionName}}-status-span"><i id="icon" | |||
| style="vertical-align: middle;" class="{{.Status}}"></i><span id="text" | |||
| style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span> | |||
| </span> | |||
| <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}:</span> | |||
| <span class="cti-mgRight-sm uc-accordionTitle-black" id="{{.VersionName}}-duration-span">{{$.duration}}</span> | |||
| <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}: | |||
| </span> | |||
| <span class="cti-mgRight-sm uc-accordionTitle-black" | |||
| id="{{.VersionName}}-duration-span">{{$.duration}}</span> | |||
| <span data-tooltip="刷新" style="cursor: pointer;" data-inverted="" | |||
| onclick="refreshStatus({{.VersionName}})"><i | |||
| class="redo icon redo-color"></i></span> | |||
| </div> | |||
| </span> | |||
| </span> | |||
| @@ -227,8 +269,10 @@ td, th { | |||
| <div class="{{if eq $k 0}}active{{end}} content"> | |||
| <div class="content-pad"> | |||
| <div class="ui pointing secondary menu" style="border-bottom: 1px solid rgba(34,36,38,.15);"> | |||
| <a class="active item" data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a> | |||
| <a class="item" data-tab="second{{$k}}" onclick="javascript:parseLog()">{{$.i18n.Tr "repo.cloudbrain.runinfo"}}</a> | |||
| <a class="active item" | |||
| data-tab="first{{$k}}">{{$.i18n.Tr "repo.modelarts.train_job.config"}}</a> | |||
| <a class="item" data-tab="second{{$k}}" | |||
| onclick="javascript:parseLog()">{{$.i18n.Tr "repo.cloudbrain.runinfo"}}</a> | |||
| </div> | |||
| <div class="ui tab active" data-tab="first{{$k}}"> | |||
| <div style="padding-top: 10px;"> | |||
| @@ -259,182 +303,199 @@ td, th { | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain_creator"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||
| {{.User.Name}} | |||
| </div> | |||
| </td> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain_creator"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||
| {{.User.Name}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.computing_resources"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-computeresource"> | |||
| {{.ComputeResource}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.task_type"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-computeresource"> | |||
| {{.JobType}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.code_version"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-code"> | |||
| {{.BranchName}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.computing_resources"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-computeresource"> | |||
| {{.ComputeResource}} | |||
| </div> | |||
| </td> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.gpu_type"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w"> | |||
| {{$.resource_type}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.task_type"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-computeresource"> | |||
| {{.JobType}} | |||
| </div> | |||
| </td> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.createtime"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-createtime"> | |||
| {{TimeSinceUnix1 .CreatedUnix}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.gpu_type"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w"> | |||
| {{$.resource_type}} | |||
| </div> | |||
| </td> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-duration"> | |||
| {{$.duration}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.createtime"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-createtime"> | |||
| {{TimeSinceUnix1 .CreatedUnix}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.train_job.dura_time"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-duration"> | |||
| {{$.duration}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| </tbody> | |||
| </table> | |||
| </div> | |||
| <div class="ac-grid-col"> | |||
| <table class="ti-form"> | |||
| <tbody class="ti-text-form"> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.mirror"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||
| {{.Image}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.train_job.dataset"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-BenchmarkTypeName"> | |||
| {{$.datasetname}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.train_job.standard"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w"> | |||
| {{$.i18n.Tr "cloudbrain.gpu_num"}}:{{$.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{$.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{$.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{$.ShareMemMiB}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.dataset_storage_path"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="dataset_storage_path"> | |||
| <table class="ti-form"> | |||
| <tbody class="ti-text-form"> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.mirror"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||
| {{.Image}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.train_job.dataset"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-BenchmarkTypeName"> | |||
| {{$.datasetname}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.train_job.standard"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w"> | |||
| {{$.i18n.Tr "cloudbrain.gpu_num"}}:{{$.GpuNum}},{{$.i18n.Tr "cloudbrain.cpu_num"}}:{{$.CpuNum}},{{$.i18n.Tr "cloudbrain.memory"}}(MB):{{$.MemMiB}},{{$.i18n.Tr "cloudbrain.shared_memory"}}(MB):{{$.ShareMemMiB}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.dataset_storage_path"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="dataset_storage_path"> | |||
| {{$.dataset_path}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.model_storage_path"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="model_storage_path"> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.model_storage_path"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="model_storage_path"> | |||
| {{$.model_path}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.code_storage_path"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="code_storage_path"> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.code_storage_path"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="code_storage_path"> | |||
| {{$.code_path}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain.time.starttime"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-startTime"> | |||
| {{if not (eq .StartTime 0)}} | |||
| {{TimeSinceUnix1 .StartTime}} | |||
| {{else}} | |||
| -- | |||
| {{end}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain.time.endtime"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-EndTime"> | |||
| {{if not (eq .EndTime 0)}} | |||
| {{TimeSinceUnix1 .EndTime}} | |||
| {{else}} | |||
| -- | |||
| {{end}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| </tbody> | |||
| </table> | |||
| </div> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain.time.starttime"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-startTime"> | |||
| {{if not (eq .StartTime 0)}} | |||
| {{TimeSinceUnix1 .StartTime}} | |||
| {{else}} | |||
| -- | |||
| {{end}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain.time.endtime"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-EndTime"> | |||
| {{if not (eq .EndTime 0)}} | |||
| {{TimeSinceUnix1 .EndTime}} | |||
| {{else}} | |||
| -- | |||
| {{end}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| </tbody> | |||
| </table> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -445,10 +506,11 @@ td, th { | |||
| <div class="ui message message{{.VersionName}}" style="display: none;"> | |||
| <div id="header"></div> | |||
| </div> | |||
| <div class="ui attached log" id="log{{.VersionName}}" style="height: 390px !important; overflow: auto;"> | |||
| <div class="ui attached log" id="log{{.VersionName}}" | |||
| style="height: 390px !important; overflow: auto;"> | |||
| <input type="hidden" id="json_value" value="{{$.result.JobStatus.AppExitDiagnostics}}"> | |||
| <span id="info_display" class="info_text"> | |||
| </span> | |||
| </div> | |||
| @@ -488,38 +550,71 @@ td, th { | |||
| <script> | |||
| $('.menu .item').tab() | |||
| $(document).ready(function(){ | |||
| $('.ui.accordion').accordion({selector:{trigger:'.icon'}}); | |||
| $(document).ready(function () { | |||
| $('.ui.accordion').accordion({ selector: { trigger: '.icon' } }); | |||
| }); | |||
| $(document).ready(function(){ | |||
| $(document).ready(function () { | |||
| $('.secondary.menu .item').tab(); | |||
| }); | |||
| function parseLog(){ | |||
| let jsonValue = document.getElementById("json_value").value; | |||
| let jsonObj = JSON.parse(jsonValue); | |||
| let podRoleName = jsonObj["podRoleName"]; | |||
| let html = ""; | |||
| if (podRoleName != null){ | |||
| let task0 = podRoleName["task1-0"]; | |||
| let podEvents = jsonObj["podEvents"]; | |||
| let podEventArray = podEvents[task0]; | |||
| if(podEventArray != null){ | |||
| for(var i=0; i < podEventArray.length;i++){ | |||
| html +="<p><b>[" +podEventArray[i]["reason"] + "]</b></p>"; | |||
| html +="<p>" +podEventArray[i]["message"] + "</p>"; | |||
| html +="<p>" +podEventArray[i]["action"] + "</p>"; | |||
| } | |||
| } | |||
| let extras= jsonObj["extras"]; | |||
| if(extras != null){ | |||
| for(var i=0; i < extras.length;i++){ | |||
| html +="<p><b>[" +extras[i]["reason"] + "]</b></p>"; | |||
| html +="<p>" +extras[i]["message"] + "</p>"; | |||
| html +="<p>" +extras[i]["action"] + "</p>"; | |||
| function parseLog() { | |||
| let jsonValue = document.getElementById("json_value").value; | |||
| let jsonObj = JSON.parse(jsonValue); | |||
| let podRoleName = jsonObj["podRoleName"]; | |||
| let html = ""; | |||
| if (podRoleName != null) { | |||
| let task0 = podRoleName["task1-0"]; | |||
| let podEvents = jsonObj["podEvents"]; | |||
| let podEventArray = podEvents[task0]; | |||
| if (podEventArray != null) { | |||
| for (var i = 0; i < podEventArray.length; i++) { | |||
| if (podEventArray[i]["reason"] != "") { | |||
| html += "<p><b>[" + podEventArray[i]["reason"] + "]</b></p>"; | |||
| html += "<p>" + podEventArray[i]["message"] + "</p>"; | |||
| html += "<p>" + podEventArray[i]["action"] + "</p>"; | |||
| } | |||
| } | |||
| } | |||
| let extras = jsonObj["extras"]; | |||
| if (extras != null) { | |||
| for (var i = 0; i < extras.length; i++) { | |||
| if (extras[i]["reason"] != "") { | |||
| html += "<p><b>[" + extras[i]["reason"] + "]</b></p>"; | |||
| html += "<p>" + extras[i]["message"] + "</p>"; | |||
| html += "<p>" + extras[i]["action"] + "</p>"; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| document.getElementById("info_display").innerHTML = html; | |||
| } | |||
| function stopBubbling(e) { | |||
| e = window.event || e; | |||
| if (e.stopPropagation) { | |||
| e.stopPropagation(); //阻止事件 冒泡传播 | |||
| } else { | |||
| e.cancelBubble = true; //ie兼容 | |||
| } | |||
| } | |||
| function refreshStatus(version_name) { | |||
| $(".ui.accordion.border-according").each((index, job) => { | |||
| const jobID = job.dataset.jobid; | |||
| const repoPath = job.dataset.repopath; | |||
| const versionname = job.dataset.version | |||
| $.get(`/api/v1/repos/${repoPath}/cloudbrain/${jobID}?version_name=${versionname}`, (data) => { | |||
| // header status and duration | |||
| //$(`#${version_name}-duration-span`).text(data.JobDuration) | |||
| $(`#${version_name}-status-span span`).text(data.JobStatus) | |||
| $(`#${version_name}-status-span i`).attr("class", data.JobStatus) | |||
| // detail status and duration | |||
| //$('#'+version_name+'-duration').text(data.JobDuration) | |||
| $('#' + version_name + '-status').text(data.JobStatus) | |||
| parseLog() | |||
| }).fail(function (err) { | |||
| console.log(err); | |||
| }); | |||
| stopBubbling(arguments.callee.caller.arguments[0]) | |||
| }) | |||
| } | |||
| document.getElementById("info_display").innerHTML=html; | |||
| } | |||
| </script> | |||
| @@ -2,20 +2,23 @@ | |||
| {{template "base/head" .}} | |||
| <style> | |||
| .label_after::after{ | |||
| .label_after::after { | |||
| margin: -.2em 0 0 .2em; | |||
| content: '\00a0'; | |||
| } | |||
| .selectcloudbrain .active.item{ | |||
| } | |||
| .selectcloudbrain .active.item { | |||
| color: #0087f5 !important; | |||
| border: 1px solid #0087f5; | |||
| margin: -1px; | |||
| background: #FFF !important; | |||
| } | |||
| #deletemodel { | |||
| width: 100%; | |||
| height: 100%; | |||
| } | |||
| /* 弹窗 */ | |||
| #mask { | |||
| @@ -73,28 +76,33 @@ | |||
| } | |||
| @-webkit-keyframes sk-stretchdelay { | |||
| 0%, | |||
| 40%, | |||
| 100% { | |||
| -webkit-transform: scaleY(0.4) | |||
| } | |||
| 20% { | |||
| -webkit-transform: scaleY(1.0) | |||
| } | |||
| } | |||
| @keyframes sk-stretchdelay { | |||
| 0%, | |||
| 40%, | |||
| 100% { | |||
| transform: scaleY(0.4); | |||
| -webkit-transform: scaleY(0.4); | |||
| } | |||
| 20% { | |||
| transform: scaleY(1.0); | |||
| -webkit-transform: scaleY(1.0); | |||
| } | |||
| } | |||
| /* 消息框 */ | |||
| .alert { | |||
| @@ -137,6 +145,7 @@ | |||
| width: calc(100% - 260px); | |||
| box-sizing: border-box; | |||
| } | |||
| /* 弹窗 (background) */ | |||
| #imageModal { | |||
| @@ -151,6 +160,7 @@ | |||
| background-color: rgb(0, 0, 0); | |||
| background-color: rgba(0, 0, 0, 0.4); | |||
| } | |||
| /* 弹窗内容 */ | |||
| .modal-content { | |||
| @@ -160,6 +170,7 @@ | |||
| border: 1px solid #888; | |||
| width: 30%; | |||
| } | |||
| /* 关闭按钮 */ | |||
| .close { | |||
| @@ -184,12 +195,12 @@ | |||
| cursor: pointer; | |||
| pointer-events: none; | |||
| } | |||
| .time-show{ | |||
| .time-show { | |||
| font-size: 10px; | |||
| margin-top: 0.4rem; | |||
| display: inline-block; | |||
| } | |||
| </style> | |||
| <!-- 弹窗 --> | |||
| @@ -208,49 +219,56 @@ | |||
| {{template "repo/header" .}} | |||
| {{template "base/alert" .}} | |||
| <!-- 提示框 --> | |||
| <div class="cloudbrain_debug" style="display: none;" data-debug="{{$.i18n.Tr "repo.debug"}}" data-debug-again="{{$.i18n.Tr "repo.debug_again"}}"></div> | |||
| <div class="cloudbrain_debug" style="display: none;" data-debug="{{$.i18n.Tr "repo.debug"}}" | |||
| data-debug-again="{{$.i18n.Tr "repo.debug_again"}}"></div> | |||
| <!-- 列表容器 --> | |||
| <div class="ui container"> | |||
| <div class="ui two column stackable grid"> | |||
| <div class="column"> | |||
| <div class="ui blue small menu compact selectcloudbrain"> | |||
| <a class="active item" href="{{.RepoLink}}/debugjob?debugListType=all">{{$.i18n.Tr "repo.modelarts.notebook"}}</a> | |||
| <a class="item" href="{{.RepoLink}}/modelarts/train-job">{{$.i18n.Tr "repo.modelarts.train_job"}}</a> | |||
| <a class="item" href="{{.RepoLink}}/modelarts/inference-job">{{$.i18n.Tr "repo.modelarts.infer_job"}}</a> | |||
| <a class="item" href="{{.RepoLink}}/cloudbrain/benchmark">{{$.i18n.Tr "repo.modelarts.evaluate_job"}}</a> | |||
| </div> | |||
| <div class="column"> | |||
| <div class="ui blue small menu compact selectcloudbrain"> | |||
| <a class="active item" | |||
| href="{{.RepoLink}}/debugjob?debugListType=all">{{$.i18n.Tr "repo.modelarts.notebook"}}</a> | |||
| <a class="item" | |||
| href="{{.RepoLink}}/modelarts/train-job">{{$.i18n.Tr "repo.modelarts.train_job"}}</a> | |||
| <a class="item" | |||
| href="{{.RepoLink}}/modelarts/inference-job">{{$.i18n.Tr "repo.modelarts.infer_job"}}</a> | |||
| <a class="item" | |||
| href="{{.RepoLink}}/cloudbrain/benchmark">{{$.i18n.Tr "repo.modelarts.evaluate_job"}}</a> | |||
| </div> | |||
| <div class="column right aligned"> | |||
| <div class="ui selection dropdown" style="min-width: 10em;min-height:2.6em;border-radius: .28571429rem;margin-right: 1em;padding: .67em 3.2em .7em 1em;"> | |||
| {{svg "octicon-server" 16}} | |||
| <div class="default text" style="color: rgba(0,0,0,.87);"></div> | |||
| <i class="dropdown icon"></i> | |||
| <div class="menu"> | |||
| <div class="item" data-value="all">{{$.i18n.Tr "repo.gpu_type_all"}}</div> | |||
| <div class="item" data-value="CPU/GPU">CPU/GPU</div> | |||
| <div class="item" data-value="NPU">NPU</div> | |||
| </div> | |||
| </div> | |||
| <div class="column right aligned"> | |||
| <div class="ui selection dropdown" | |||
| style="min-width: 10em;min-height:2.6em;border-radius: .28571429rem;margin-right: 1em;padding: .67em 3.2em .7em 1em;"> | |||
| {{svg "octicon-server" 16}} | |||
| <div class="default text" style="color: rgba(0,0,0,.87);"></div> | |||
| <i class="dropdown icon"></i> | |||
| <div class="menu"> | |||
| <div class="item" data-value="all">{{$.i18n.Tr "repo.gpu_type_all"}}</div> | |||
| <div class="item" data-value="CPU/GPU">CPU/GPU</div> | |||
| <div class="item" data-value="NPU">NPU</div> | |||
| </div> | |||
| {{if .Permission.CanWrite $.UnitTypeCloudBrain}} | |||
| <a class="ui green button" href="{{.RepoLink}}/cloudbrain/create">{{$.i18n.Tr "repo.modelarts.train_job.new_debug"}}</a> | |||
| {{else}} | |||
| <a class="ui disabled button">{{$.i18n.Tr "repo.modelarts.train_job.new_debug"}}</a> | |||
| {{end}} | |||
| </div> | |||
| {{if .Permission.CanWrite $.UnitTypeCloudBrain}} | |||
| <a class="ui green button" | |||
| href="{{.RepoLink}}/cloudbrain/create">{{$.i18n.Tr "repo.modelarts.train_job.new_debug"}}</a> | |||
| {{else}} | |||
| <a class="ui disabled button">{{$.i18n.Tr "repo.modelarts.train_job.new_debug"}}</a> | |||
| {{end}} | |||
| </div> | |||
| </div> | |||
| {{if eq 0 (len .Tasks)}} | |||
| <div class="ui placeholder segment bgtask-none"> | |||
| <div class="ui icon header bgtask-header-pic"></div> | |||
| <div class="bgtask-content-header">{{$.i18n.Tr "repo.debug_task_not_created"}}</div> | |||
| <div class="bgtask-content"> | |||
| {{if $.RepoIsEmpty}} | |||
| <div class="bgtask-content-txt">{{$.i18n.Tr "repo.repo_not_initialized" .RepoLink | Safe}}</div> | |||
| {{end}} | |||
| <div class="bgtask-content-txt">{{$.i18n.Tr "repo.debug_task_running_limit"}}</div> | |||
| <div class="bgtask-content-txt">{{$.i18n.Tr "repo.dataset_desc"}}</div> | |||
| <div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions" | Safe}}</div> | |||
| </div> | |||
| <div class="ui icon header bgtask-header-pic"></div> | |||
| <div class="bgtask-content-header">{{$.i18n.Tr "repo.debug_task_not_created"}}</div> | |||
| <div class="bgtask-content"> | |||
| {{if $.RepoIsEmpty}} | |||
| <div class="bgtask-content-txt">{{$.i18n.Tr "repo.repo_not_initialized" .RepoLink | Safe}}</div> | |||
| {{end}} | |||
| <div class="bgtask-content-txt">{{$.i18n.Tr "repo.debug_task_running_limit"}}</div> | |||
| <div class="bgtask-content-txt">{{$.i18n.Tr "repo.dataset_desc"}}</div> | |||
| <div class="bgtask-content-txt">{{$.i18n.Tr "repo.platform_instructions" | Safe}}</div> | |||
| </div> | |||
| </div> | |||
| {{else}} | |||
| <!-- 中下列表展示区 --> | |||
| @@ -287,29 +305,40 @@ | |||
| <div class="row"> | |||
| <!-- 任务名 --> | |||
| <div class="four wide column"> | |||
| <a class="title" href='{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain/{{.Cloudbrain.ID}}{{else}}{{$.RepoLink}}/modelarts/notebook/{{.Cloudbrain.ID}}{{end}}' title="{{.JobName}}" style="font-size: 14px;"> | |||
| <span class="fitted text_over" style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span> | |||
| <a class="title" | |||
| href='{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain/{{.Cloudbrain.ID}}{{else}}{{$.RepoLink}}/modelarts/notebook/{{.Cloudbrain.ID}}{{end}}' | |||
| title="{{.DisplayJobName}}" style="font-size: 14px;"> | |||
| <span class="fitted text_over" | |||
| style="width: 90%;vertical-align: middle;">{{.DisplayJobName}}</span> | |||
| </a> | |||
| </div> | |||
| <div class="two wide column text center"> | |||
| <!--任务状态 --> | |||
| <span class="job-status" id="{{.Cloudbrain.ID}}" data-repopath="{{$.RepoRelPath}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}" data-jobid="{{.Cloudbrain.ID}}" data-resource="{{.ComputeResource}}"> | |||
| <span><i id="{{.Cloudbrain.ID}}-icon" style="vertical-align: middle;" class="{{.Status}}"></i><span id="{{.Cloudbrain.ID}}-text" style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span> | |||
| <!--任务状态 --> | |||
| <span class="job-status" id="{{.Cloudbrain.ID}}" | |||
| data-repopath="{{$.RepoRelPath}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}" | |||
| data-jobid="{{.Cloudbrain.ID}}" data-resource="{{.ComputeResource}}"> | |||
| <span><i id="{{.Cloudbrain.ID}}-icon" style="vertical-align: middle;" | |||
| class="{{.Status}}"></i><span id="{{.Cloudbrain.ID}}-text" | |||
| style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span> | |||
| </span> | |||
| </div> | |||
| <div class="two wide column text center"> | |||
| <!-- 任务创建时间 --> | |||
| <span style="font-size: 12px;margin-left: 0.4rem;" class="">{{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}}</span> | |||
| <span style="font-size: 12px;margin-left: 0.4rem;" | |||
| class="">{{TimeSinceUnix .Cloudbrain.CreatedUnix $.Lang}}</span> | |||
| </div> | |||
| <div class="two wide column text center"> | |||
| <!-- 任务计算资源 --> | |||
| <span style="font-size: 12px;margin-left: 0.4rem;" class="">{{.ComputeResource}}</span> | |||
| <!-- 任务计算资源 --> | |||
| <span style="font-size: 12px;margin-left: 0.4rem;" | |||
| class="">{{.ComputeResource}}</span> | |||
| </div> | |||
| <div class="one wide column text center"> | |||
| {{if .User.Name}} | |||
| <a href="{{AppSubUrl}}/{{.User.Name}}" title="{{.User.Name}}"><img class="ui avatar image" src="{{.User.RelAvatarLink}}"></a> | |||
| <a href="{{AppSubUrl}}/{{.User.Name}}" title="{{.User.Name}}"><img | |||
| class="ui avatar image" src="{{.User.RelAvatarLink}}"></a> | |||
| {{else}} | |||
| <a title="Ghost"><img class="ui avatar image" src="{{AppSubUrl}}/user/avatar/Ghost/-1"></a> | |||
| <a title="Ghost"><img class="ui avatar image" | |||
| src="{{AppSubUrl}}/user/avatar/Ghost/-1"></a> | |||
| {{end}} | |||
| </div> | |||
| <div class="five wide column text center"> | |||
| @@ -323,79 +352,103 @@ | |||
| <form id="debugAgainForm-{{.Cloudbrain.ID}}"> | |||
| {{$.CsrfTokenHtml}} | |||
| {{if .CanDebug}} | |||
| {{if eq .Status "RUNNING" "WAITING" "CREATING" "STARTING"}} | |||
| <a style="margin: 0 1rem;" id="ai-debug-{{.Cloudbrain.ID}}" class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}}disabled {{else}}blue {{end}}button' data-jobid="{{.Cloudbrain.ID}}" data-repopath='{{$.RepoLink}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/'> | |||
| {{$.i18n.Tr "repo.debug"}} | |||
| </a> | |||
| {{else}} | |||
| <a id="ai-debug-{{.Cloudbrain.ID}}" class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}} disabled {{else}}blue {{end}}button' data-jobid="{{.Cloudbrain.ID}}" data-repopath='{{$.RepoLink}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/' data-linkpath='{{$.Link}}'> | |||
| {{$.i18n.Tr "repo.debug_again"}} | |||
| </a> | |||
| {{end}} | |||
| {{if eq .Status "RUNNING" "WAITING" "CREATING" "STARTING"}} | |||
| <a style="margin: 0 1rem;" id="ai-debug-{{.Cloudbrain.ID}}" | |||
| class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}}disabled {{else}}blue {{end}}button' | |||
| data-jobid="{{.Cloudbrain.ID}}" | |||
| data-repopath='{{$.RepoLink}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/'> | |||
| {{$.i18n.Tr "repo.debug"}} | |||
| </a> | |||
| {{else}} | |||
| {{if eq .Status "RUNNING" "WAITING" "CREATING" "STARTING"}} | |||
| <a class="ui basic disabled button"> | |||
| {{$.i18n.Tr "repo.debug"}} | |||
| </a> | |||
| {{else}} | |||
| <a class="ui basic disabled button"> | |||
| {{$.i18n.Tr "repo.debug_again"}} | |||
| </a> | |||
| {{end}} | |||
| <a id="ai-debug-{{.Cloudbrain.ID}}" | |||
| class='ui basic ai_debug {{if eq .Status "CREATING" "STOPPING" "WAITING" "STARTING"}} disabled {{else}}blue {{end}}button' | |||
| data-jobid="{{.Cloudbrain.ID}}" | |||
| data-repopath='{{$.RepoLink}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/' | |||
| data-linkpath='{{$.Link}}'> | |||
| {{$.i18n.Tr "repo.debug_again"}} | |||
| </a> | |||
| {{end}} | |||
| {{else}} | |||
| {{if eq .Status "RUNNING" "WAITING" "CREATING" "STARTING"}} | |||
| <a class="ui basic disabled button"> | |||
| {{$.i18n.Tr "repo.debug"}} | |||
| </a> | |||
| {{else}} | |||
| <a class="ui basic disabled button"> | |||
| {{$.i18n.Tr "repo.debug_again"}} | |||
| </a> | |||
| {{end}} | |||
| {{end}} | |||
| </form> | |||
| <!-- 停止 --> | |||
| <form id="stopForm-{{.Cloudbrain.ID}}" style="margin-left:-1px;"> | |||
| <form id="stopForm-{{.Cloudbrain.ID}}" style="margin-left:-1px;"> | |||
| {{$.CsrfTokenHtml}} | |||
| {{if .CanDel}} | |||
| <a id="ai-stop-{{.Cloudbrain.ID}}" class='ui basic ai_stop {{if eq .Status "STOPPED" "FAILED" "START_FAILED" "STOPPING" "CREATING" "STARTING" "SUCCEEDED"}}disabled {{else}}blue {{end}}button' data-repopath="{{$.RepoLink}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/stop" data-jobid="{{.Cloudbrain.ID}}"> | |||
| <a id="ai-stop-{{.Cloudbrain.ID}}" | |||
| class='ui basic ai_stop {{if eq .Status "STOPPED" "FAILED" "START_FAILED" "STOPPING" "CREATING" "STARTING" "SUCCEEDED"}}disabled {{else}}blue {{end}}button' | |||
| data-repopath="{{$.RepoLink}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain{{else}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/stop" | |||
| data-jobid="{{.Cloudbrain.ID}}"> | |||
| {{$.i18n.Tr "repo.stop"}} | |||
| </a> | |||
| {{else}} | |||
| <a class="ui basic disabled button"> | |||
| {{$.i18n.Tr "repo.stop"}} | |||
| <a class="ui basic disabled button"> | |||
| {{$.i18n.Tr "repo.stop"}} | |||
| </a> | |||
| {{end}} | |||
| </form> | |||
| <!-- 删除 --> | |||
| <form id="delForm-{{.Cloudbrain.ID}}" action="{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/del" method="post"> | |||
| <form id="delForm-{{.Cloudbrain.ID}}" | |||
| action="{{if eq .ComputeResource "CPU/GPU"}}{{$.RepoLink}}/cloudbrain{{else}}{{$.RepoLink}}/modelarts/notebook{{end}}/{{.Cloudbrain.ID}}/del" | |||
| method="post"> | |||
| <input type="hidden" name="debugListType" value="{{$.ListType}}"> | |||
| {{$.CsrfTokenHtml}} | |||
| {{if .CanDel}} | |||
| <a id="ai-delete-{{.Cloudbrain.ID}}" class='ui basic ai_delete {{if eq .Status "STOPPED" "FAILED" "START_FAILED"}}blue {{else}}disabled {{end}}button' style="border-radius: .28571429rem;"> | |||
| <a id="ai-delete-{{.Cloudbrain.ID}}" | |||
| class='ui basic ai_delete {{if eq .Status "STOPPED" "FAILED" "START_FAILED"}}blue {{else}}disabled {{end}}button' | |||
| style="border-radius: .28571429rem;"> | |||
| {{$.i18n.Tr "repo.delete"}} | |||
| </a> | |||
| {{else}} | |||
| <a class="ui basic button disabled" style="border-radius: .28571429rem;"> | |||
| <a class="ui basic button disabled" style="border-radius: .28571429rem;"> | |||
| {{$.i18n.Tr "repo.delete"}} | |||
| </a> | |||
| {{end}} | |||
| </form> | |||
| </div> | |||
| <div class="ui compact buttons" style="{{if eq .ComputeResource "CPU/GPU"}} visibility: visible {{else}} visibility: hidden{{end}}"> | |||
| <div class="ui dropdown" id="model_more" style="padding: .58928571em 1.125em .58928571em;"> | |||
| <div class="ui compact buttons" | |||
| style="{{if eq .ComputeResource "CPU/GPU"}} visibility: visible {{else}} visibility: hidden{{end}}"> | |||
| <div class="ui dropdown" id="model_more" | |||
| style="padding: .58928571em 1.125em .58928571em;"> | |||
| <div class="text">{{$.i18n.Tr "repo.more"}}</div> | |||
| <i class="dropdown icon"></i> | |||
| <div class="menu" style="right: auto;"> | |||
| <div class="item" style="padding: 0 !important;"> | |||
| {{if .CanDebug}} | |||
| <a id="model-image-{{.Cloudbrain.ID}}" class='imageBtn ui basic {{if ne .Status "RUNNING"}}disabled {{else}}blue {{end}}button' href="{{$.RepoLink}}/cloudbrain/{{.Cloudbrain.ID}}/commit_image">{{$.i18n.Tr "repo.submit_image"}}</a> | |||
| <a id="model-image-{{.Cloudbrain.ID}}" | |||
| class='imageBtn ui basic {{if ne .Status "RUNNING"}}disabled {{else}}blue {{end}}button' | |||
| href="{{$.RepoLink}}/cloudbrain/{{.Cloudbrain.ID}}/commit_image">{{$.i18n.Tr "repo.submit_image"}}</a> | |||
| {{else}} | |||
| <a class="imageBtn ui basic disabled button">{{$.i18n.Tr "repo.submit_image"}}</a> | |||
| <a | |||
| class="imageBtn ui basic disabled button">{{$.i18n.Tr "repo.submit_image"}}</a> | |||
| {{end}} | |||
| </div> | |||
| <div class="item" style="padding: 0 !important;"> | |||
| <!-- 模型下载 --> | |||
| <!-- 模型下载 --> | |||
| {{if .CanDebug}} | |||
| <a class="ui basic blue button" href="{{$.RepoLink}}/cloudbrain/{{.Cloudbrain.ID}}/models" target="_blank">{{$.i18n.Tr "repo.download"}}</a> | |||
| <a class="ui basic blue button" | |||
| href="{{$.RepoLink}}/cloudbrain/{{.Cloudbrain.ID}}/models" | |||
| target="_blank">{{$.i18n.Tr "repo.download"}}</a> | |||
| {{else}} | |||
| <a class="ui basic disabled button">{{$.i18n.Tr "repo.download"}}</a> | |||
| <a | |||
| class="ui basic disabled button">{{$.i18n.Tr "repo.download"}}</a> | |||
| {{end}} | |||
| </div> | |||
| {{if and (ne .JobType "DEBUG") (eq .Cloudbrain.Type 0)}} | |||
| <div class="item" style="padding: 0 !important;"> | |||
| <a class="ui basic blue button" href="{{$.RepoLink}}/cloudbrain/{{.Cloudbrain.ID}}/rate" target="_blank"> | |||
| <a class="ui basic blue button" | |||
| href="{{$.RepoLink}}/cloudbrain/{{.Cloudbrain.ID}}/rate" | |||
| target="_blank"> | |||
| 评分 | |||
| </a> | |||
| </div> | |||
| @@ -405,20 +458,15 @@ | |||
| </div> | |||
| </div> | |||
| <!-- 镜像列表弹窗 --> | |||
| </div> | |||
| </div> | |||
| {{end}} | |||
| {{end}} | |||
| <div id="app" style="margin-top: 2rem;"> | |||
| <div class="center"> | |||
| <el-pagination | |||
| background | |||
| @current-change="handleCurrentChange" | |||
| :current-page="page" | |||
| :page-sizes="[10]" | |||
| :page-size="10" | |||
| layout="total, sizes, prev, pager, next, jumper" | |||
| :total="{{.Page.Paginater.Total}}"> | |||
| <el-pagination background @current-change="handleCurrentChange" :current-page="page" | |||
| :page-sizes="[10]" :page-size="10" layout="total, sizes, prev, pager, next, jumper" | |||
| :total="{{.Page.Paginater.Total}}"> | |||
| </el-pagination> | |||
| </div> | |||
| </div> | |||
| @@ -457,42 +505,41 @@ | |||
| {{template "base/footer" .}} | |||
| <script> | |||
| // 调试和评分新开窗口 | |||
| const {AppSubUrl, StaticUrlPrefix, csrf} = window.config; | |||
| let url={{.RepoLink}} | |||
| let redirect_to = {{$.Link}} | |||
| let getParam=getQueryVariable('debugListType') | |||
| const { AppSubUrl, StaticUrlPrefix, csrf } = window.config; | |||
| let url = {{.RepoLink }} | |||
| let redirect_to = {{ $.Link }} | |||
| let getParam = getQueryVariable('debugListType') | |||
| let dropdownValue = ['all','',false].includes(getParam)? '{{$.i18n.Tr "repo.gpu_type_all"}}' : getParam | |||
| let dropdownValue = ['all', '', false].includes(getParam) ? '{{$.i18n.Tr "repo.gpu_type_all"}}' : getParam | |||
| // localStorage.setItem('all',location.href) | |||
| function getQueryVariable(variable) | |||
| { | |||
| function getQueryVariable(variable) { | |||
| let query = window.location.search.substring(1); | |||
| let vars = query.split("&"); | |||
| for (let i=0;i<vars.length;i++) { | |||
| let pair = vars[i].split("="); | |||
| if(pair[0] == variable){return pair[1];} | |||
| for (let i = 0; i < vars.length; i++) { | |||
| let pair = vars[i].split("="); | |||
| if (pair[0] == variable) { return pair[1]; } | |||
| } | |||
| return(false); | |||
| return (false); | |||
| } | |||
| $(document).ready(function(){ | |||
| dropdownValue = dropdownValue==="CPU%2FGPU"? 'CPU/GPU' : dropdownValue | |||
| $(document).ready(function () { | |||
| dropdownValue = dropdownValue === "CPU%2FGPU" ? 'CPU/GPU' : dropdownValue | |||
| $('.default.text').text(dropdownValue) | |||
| $('.ui.dropdown') | |||
| .dropdown({ | |||
| action: 'hide', | |||
| }) | |||
| .dropdown({ | |||
| action: 'hide', | |||
| }) | |||
| $('.ui.selection.dropdown').dropdown({ | |||
| onChange:function(value){ | |||
| onChange: function (value) { | |||
| location.href = `${url}/debugjob?debugListType=${value}` | |||
| } | |||
| }) | |||
| $('.message .close') | |||
| .on('click', function() { | |||
| $(this) | |||
| .closest('.message') | |||
| .transition('fade') | |||
| }) | |||
| .on('click', function () { | |||
| $(this) | |||
| .closest('.message') | |||
| .transition('fade') | |||
| }) | |||
| }) | |||
| </script> | |||
| </script> | |||
| @@ -14,12 +14,12 @@ | |||
| <div class="ui grid"> | |||
| <div class="two column row"> | |||
| <a class="reference column" href="#" data-target="#branch-list"> | |||
| <span class="text black"> | |||
| <span class="text "> | |||
| {{svg "octicon-git-branch" 16}} {{.i18n.Tr "repo.branches"}} | |||
| </span> | |||
| </a> | |||
| <a class="reference column" href="#" data-target="#tag-list"> | |||
| <span class="text"> | |||
| <span class="text black"> | |||
| <i class="reference tags icon"></i> {{.i18n.Tr "repo.tags"}} | |||
| </span> | |||
| </a> | |||
| @@ -594,5 +594,40 @@ | |||
| {{end}} | |||
| </span> | |||
| </div> | |||
| {{else if eq .Type 29}} | |||
| <div class="timeline-item event" id="{{.HashTag}}"> | |||
| <span class="badge">{{svg "octicon-git-branch" 16}}</span> | |||
| <a class="ui avatar image" href="{{.Poster.HomeLink}}"> | |||
| <img src="{{.Poster.RelAvatarLink}}"> | |||
| </a> | |||
| <span class="text grey"> | |||
| <a class="author" href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> | |||
| {{ $refOldName:= GetRefName .OldRef }} | |||
| {{ $refNewName:= GetRefName .NewRef }} | |||
| {{if .OldRef }} | |||
| {{if .NewRef }} | |||
| {{$.i18n.Tr "repo.issues.change_branch_tag_at" ($refOldName|Escape) ($refNewName|Escape) $createdStr | Safe}} | |||
| {{else}} | |||
| {{ $getRefOldType:= GetRefType .OldRef }} | |||
| {{ if eq $getRefOldType "branch"}} | |||
| {{$.i18n.Tr "repo.issues.remove_branch_at" ($refOldName|Escape) $createdStr | Safe}} | |||
| {{else}} | |||
| {{$.i18n.Tr "repo.issues.remove_tag_at" ($refOldName|Escape) $createdStr | Safe}} | |||
| {{end}} | |||
| {{end}} | |||
| {{else}} | |||
| {{if .NewRef}} | |||
| {{ $getRefNewType:= GetRefType .NewRef }} | |||
| {{ if eq $getRefNewType "branch"}} | |||
| {{$.i18n.Tr "repo.issues.add_branch_at" ($refNewName|Escape) $createdStr | Safe}} | |||
| {{else}} | |||
| {{$.i18n.Tr "repo.issues.add_tag_at" ($refNewName|Escape) $createdStr | Safe}} | |||
| {{end}} | |||
| {{end}} | |||
| {{end}} | |||
| </span> | |||
| </div> | |||
| {{end}} | |||
| {{end}} | |||
| @@ -1,6 +1,52 @@ | |||
| <div class="four wide column"> | |||
| <div class="ui segment metas"> | |||
| {{template "repo/issue/branch_selector_field" .}} | |||
| <!-- {{template "repo/issue/branch_selector_field" .}} --> | |||
| {{if and (not .Issue.IsPull) (not .PageIsComparePull)}} | |||
| <input id="ref_selector" name="ref" type="hidden" value="{{.Issue.Ref}}"> | |||
| <div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating filter select-branch dropdown" data-no-results="{{.i18n.Tr "repo.pulls.no_results"}}"> | |||
| <div class="ui basic small button"> | |||
| <span class="text branch-name">{{if .Issue.Ref}}{{$.RefEndName}}{{else}}{{.i18n.Tr "repo.issues.no_ref"}}{{end}}</span> | |||
| <i class="dropdown icon"></i> | |||
| </div> | |||
| <div class="menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/ref"> | |||
| <div class="ui icon search input"> | |||
| <i class="filter icon"></i> | |||
| <input name="search" placeholder="{{.i18n.Tr "repo.filter_branch_and_tag"}}..."> | |||
| </div> | |||
| <div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_branch_tag"}}</div> | |||
| <div class="header"> | |||
| <div class="ui grid"> | |||
| <div class="two column row"> | |||
| <a class="reference column" href="#" data-target="#branch-list"> | |||
| <span class="text"> | |||
| {{svg "octicon-git-branch" 16}} {{.i18n.Tr "repo.branches"}} | |||
| </span> | |||
| </a> | |||
| <a class="reference column" href="#" data-target="#tag-list"> | |||
| <span class="text black"> | |||
| <i class="reference tags icon"></i> {{.i18n.Tr "repo.tags"}} | |||
| </span> | |||
| </a> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div id="branch-list" class="scrolling menu reference-list-menu"> | |||
| {{range .Branches}} | |||
| <div class="item" data-id="refs/heads/{{.}}" data-name="{{.}}" data-id-selector="#ref_selector">{{.}}</div> | |||
| {{end}} | |||
| </div> | |||
| <div id="tag-list" class="scrolling menu reference-list-menu" style="display: none"> | |||
| {{range .Tags}} | |||
| <div class="item" data-id="refs/tags/{{.}}" data-name="tags/{{.}}" data-id-selector="#ref_selector">{{.}}</div> | |||
| {{end}} | |||
| </div> | |||
| </div> | |||
| </div> | |||
| <div class="ui divider"></div> | |||
| {{end}} | |||
| {{if .Issue.IsPull }} | |||
| @@ -600,3 +646,4 @@ | |||
| </div> | |||
| {{end}} | |||
| {{end}} | |||
| @@ -1,179 +1,213 @@ | |||
| {{template "base/head" .}} | |||
| <style> | |||
| .according-panel-heading{ | |||
| box-sizing: border-box; | |||
| padding: 8px 16px; | |||
| color: #252b3a; | |||
| background-color: #f2f5fc; | |||
| line-height: 1.5; | |||
| cursor: pointer; | |||
| -moz-user-select: none; | |||
| -webkit-user-select: none; | |||
| -ms-user-select: none; | |||
| -khtml-user-select: none; | |||
| user-select: none; | |||
| } | |||
| .accordion-panel-title { | |||
| margin-top: 0; | |||
| margin-bottom: 0; | |||
| color: #252b3a; | |||
| } | |||
| .accordion-panel-title-content{ | |||
| vertical-align: middle; | |||
| display: inline-block; | |||
| width: calc(100% - 32px); | |||
| cursor: default; | |||
| } | |||
| .acc-margin-bottom { | |||
| margin-bottom: 5px; | |||
| } | |||
| .title_text { | |||
| font-size: 12px; | |||
| } | |||
| .ac-display-inblock { | |||
| display: inline-block; | |||
| } | |||
| .cti-mgRight-sm { | |||
| margin-right: 8px; | |||
| } | |||
| .ac-text-normal { | |||
| font-size: 14px; | |||
| color: #575d6c; | |||
| } | |||
| .uc-accordionTitle-black { | |||
| color: #333; | |||
| } | |||
| .accordion-border{ | |||
| border:1px solid #cce2ff; | |||
| } | |||
| .padding0{ | |||
| padding: 0 !important; | |||
| } | |||
| .content-pad{ | |||
| padding: 15px 35px; | |||
| } | |||
| .content-margin{ | |||
| margin:10px 5px ; | |||
| } | |||
| .tab_2_content { | |||
| min-height: 460px; | |||
| margin-left: 10px; | |||
| } | |||
| .ac-grid { | |||
| display: block; | |||
| *zoom: 1; | |||
| } | |||
| .ac-grid-col { | |||
| float: left; | |||
| width: 100%; | |||
| } | |||
| .ac-grid-col2 .ac-grid-col { | |||
| width: 50%; | |||
| } | |||
| .ti-form { | |||
| text-align: left; | |||
| max-width: 100%; | |||
| vertical-align: middle; | |||
| } | |||
| .ti-form>tbody { | |||
| font-size: 12px; | |||
| } | |||
| .ti-form>tbody, .ti-form>tbody>tr { | |||
| vertical-align: inherit; | |||
| } | |||
| .info_text { | |||
| padding-bottom: 20px; | |||
| padding-right: 20px; | |||
| font-size: 12px; | |||
| } | |||
| .ti-text-form-label { | |||
| padding-bottom: 20px; | |||
| padding-right: 20px; | |||
| color: #8a8e99; | |||
| font-size: 12px; | |||
| white-space: nowrap !important; | |||
| width: 80px; | |||
| line-height: 30px; | |||
| } | |||
| .ti-text-form-content{ | |||
| line-height: 30px; | |||
| padding-bottom: 20px; | |||
| } | |||
| .ti-form>tbody>tr>td { | |||
| vertical-align: top; | |||
| white-space: normal; | |||
| } | |||
| td, th { | |||
| padding: 0; | |||
| } | |||
| .ac-grid-col .text-span { | |||
| width: 450px; | |||
| overflow: hidden; | |||
| text-overflow: ellipsis; | |||
| white-space: nowrap; | |||
| } | |||
| .text-span-new { | |||
| width: 800px; | |||
| overflow: hidden; | |||
| text-overflow: ellipsis; | |||
| height: 20%; | |||
| word-break: break-all; | |||
| } | |||
| .redo-color{ | |||
| color: #3291F8; | |||
| } | |||
| .ti-action-menu-item:not(:last-child){ | |||
| margin-right: 10px; | |||
| padding-right: 11px; | |||
| text-decoration: none!important; | |||
| color: #526ecc; | |||
| cursor: pointer; | |||
| display: inline-block; | |||
| -moz-user-select: none; | |||
| -webkit-user-select: none; | |||
| -ms-user-select: none; | |||
| -khtml-user-select: none; | |||
| user-select: none; | |||
| position: relative; | |||
| } | |||
| .ti-action-menu-item:not(:last-child):after { | |||
| content: ""; | |||
| display: inline-block; | |||
| position: absolute; | |||
| height: 12px; | |||
| right: 0; | |||
| top: 50%; | |||
| -webkit-transform: translateY(-6px); | |||
| -ms-transform: translateY(-6px); | |||
| -o-transform: translateY(-6px); | |||
| transform: translateY(-6px); | |||
| border-right: 1px solid #dfe1e6; | |||
| } | |||
| .text-width80{ | |||
| width: 100px; | |||
| line-height: 30px; | |||
| } | |||
| .border-according{ | |||
| border: 1px solid #dfe1e6; | |||
| } | |||
| .disabled { | |||
| .according-panel-heading { | |||
| box-sizing: border-box; | |||
| padding: 8px 16px; | |||
| color: #252b3a; | |||
| background-color: #f2f5fc; | |||
| line-height: 1.5; | |||
| cursor: pointer; | |||
| -moz-user-select: none; | |||
| -webkit-user-select: none; | |||
| -ms-user-select: none; | |||
| -khtml-user-select: none; | |||
| user-select: none; | |||
| } | |||
| .accordion-panel-title { | |||
| margin-top: 0; | |||
| margin-bottom: 0; | |||
| color: #252b3a; | |||
| } | |||
| .accordion-panel-title-content { | |||
| vertical-align: middle; | |||
| display: inline-block; | |||
| width: calc(100% - 32px); | |||
| cursor: default; | |||
| } | |||
| .acc-margin-bottom { | |||
| margin-bottom: 5px; | |||
| } | |||
| .title_text { | |||
| font-size: 12px; | |||
| } | |||
| .ac-display-inblock { | |||
| display: inline-block; | |||
| } | |||
| .cti-mgRight-sm { | |||
| margin-right: 8px; | |||
| } | |||
| .ac-text-normal { | |||
| font-size: 14px; | |||
| color: #575d6c; | |||
| } | |||
| .uc-accordionTitle-black { | |||
| color: #333; | |||
| } | |||
| .accordion-border { | |||
| border: 1px solid #cce2ff; | |||
| } | |||
| .padding0 { | |||
| padding: 0 !important; | |||
| } | |||
| .content-pad { | |||
| padding: 15px 35px; | |||
| } | |||
| .content-margin { | |||
| margin: 10px 5px; | |||
| } | |||
| .tab_2_content { | |||
| min-height: 460px; | |||
| margin-left: 10px; | |||
| } | |||
| .ac-grid { | |||
| display: block; | |||
| *zoom: 1; | |||
| } | |||
| .ac-grid-col { | |||
| float: left; | |||
| width: 100%; | |||
| } | |||
| .ac-grid-col2 .ac-grid-col { | |||
| width: 50%; | |||
| } | |||
| .ti-form { | |||
| text-align: left; | |||
| max-width: 100%; | |||
| vertical-align: middle; | |||
| } | |||
| .ti-form>tbody { | |||
| font-size: 12px; | |||
| } | |||
| .ti-form>tbody, | |||
| .ti-form>tbody>tr { | |||
| vertical-align: inherit; | |||
| } | |||
| .info_text { | |||
| padding-bottom: 20px; | |||
| padding-right: 20px; | |||
| font-size: 12px; | |||
| } | |||
| .ti-text-form-label { | |||
| padding-bottom: 20px; | |||
| padding-right: 20px; | |||
| color: #8a8e99; | |||
| font-size: 12px; | |||
| white-space: nowrap !important; | |||
| width: 80px; | |||
| line-height: 30px; | |||
| } | |||
| .ti-text-form-content { | |||
| line-height: 30px; | |||
| padding-bottom: 20px; | |||
| } | |||
| .ti-form>tbody>tr>td { | |||
| vertical-align: top; | |||
| white-space: normal; | |||
| } | |||
| td, | |||
| th { | |||
| padding: 0; | |||
| } | |||
| .ac-grid-col .text-span { | |||
| width: 450px; | |||
| overflow: hidden; | |||
| text-overflow: ellipsis; | |||
| white-space: nowrap; | |||
| } | |||
| .text-span-new { | |||
| width: 800px; | |||
| overflow: hidden; | |||
| text-overflow: ellipsis; | |||
| height: 20%; | |||
| word-break: break-all; | |||
| } | |||
| .redo-color { | |||
| color: #3291F8; | |||
| } | |||
| .ti-action-menu-item:not(:last-child) { | |||
| margin-right: 10px; | |||
| padding-right: 11px; | |||
| text-decoration: none !important; | |||
| color: #526ecc; | |||
| cursor: pointer; | |||
| display: inline-block; | |||
| -moz-user-select: none; | |||
| -webkit-user-select: none; | |||
| -ms-user-select: none; | |||
| -khtml-user-select: none; | |||
| user-select: none; | |||
| position: relative; | |||
| } | |||
| .ti-action-menu-item:not(:last-child):after { | |||
| content: ""; | |||
| display: inline-block; | |||
| position: absolute; | |||
| height: 12px; | |||
| right: 0; | |||
| top: 50%; | |||
| -webkit-transform: translateY(-6px); | |||
| -ms-transform: translateY(-6px); | |||
| -o-transform: translateY(-6px); | |||
| transform: translateY(-6px); | |||
| border-right: 1px solid #dfe1e6; | |||
| } | |||
| .text-width80 { | |||
| width: 100px; | |||
| line-height: 30px; | |||
| } | |||
| .border-according { | |||
| border: 1px solid #dfe1e6; | |||
| } | |||
| .disabled { | |||
| cursor: default; | |||
| pointer-events: none; | |||
| color: rgba(0,0,0,.6) !important; | |||
| color: rgba(0, 0, 0, .6) !important; | |||
| opacity: .45 !important; | |||
| } | |||
| .pad20{ | |||
| border:0px !important; | |||
| } | |||
| .model_file_bread{ | |||
| margin-bottom: -0.5rem !important; | |||
| padding-left: 1rem; | |||
| padding-top: 0.5rem ; | |||
| } | |||
| } | |||
| .pad20 { | |||
| border: 0px !important; | |||
| } | |||
| .model_file_bread { | |||
| margin-bottom: -0.5rem !important; | |||
| padding-left: 1rem; | |||
| padding-top: 0.5rem; | |||
| } | |||
| </style> | |||
| <div id="mask"> | |||
| <div id="loadingPage"> | |||
| @@ -185,7 +219,7 @@ td, th { | |||
| </div> | |||
| </div> | |||
| <div class="repository"> | |||
| {{template "repo/header" .}} | |||
| {{template "repo/header" .}} | |||
| <div class="ui container"> | |||
| <h4 class="ui header" id="vertical-segment"> | |||
| <div class="ui breadcrumb"> | |||
| @@ -194,36 +228,42 @@ td, th { | |||
| </a> | |||
| <div class="divider"> / </div> | |||
| <a class="section backTodeBug" href="{{.RepoLink}}/debugjob?debugListType=all"> | |||
| {{$.i18n.Tr "repo.modelarts.notebook"}} | |||
| {{$.i18n.Tr "repo.modelarts.notebook"}} | |||
| </a> | |||
| <div class="divider"> / </div> | |||
| {{with .task}} | |||
| {{with .task}} | |||
| <div class="active section">{{.DisplayJobName}}</div> | |||
| {{end}} | |||
| </div> | |||
| </div> | |||
| </h4> | |||
| {{with .task}} | |||
| <div class="ui accordion border-according" id="accordion" data-repopath="" data-jobid="" data-version=""> | |||
| <div class="ui accordion border-according" id="accordion" data-repopath="{{$.RepoRelPath}}/modelarts/notebook" | |||
| data-jobid="{{.ID}}" data-version=""> | |||
| <div class="active title padding0"> | |||
| <div class="according-panel-heading"> | |||
| <div class="accordion-panel-title"> | |||
| <!-- <i class="dropdown icon"></i> --> | |||
| <!-- <i class="dropdown icon"></i> --> | |||
| <span class="accordion-panel-title-content"> | |||
| <span> | |||
| <div class="ac-display-inblock title_text acc-margin-bottom"> | |||
| <span class="cti-mgRight-sm"> | |||
| {{if not (eq .StartTime 0)}} | |||
| <td>{{TimeSinceUnix1 .StartTime}}</td> | |||
| {{else}} | |||
| <td>{{TimeSinceUnix1 .CreatedUnix}}<td> | |||
| {{end}} | |||
| </span> | |||
| {{if not (eq .StartTime 0)}} | |||
| <td>{{TimeSinceUnix1 .StartTime}}</td> | |||
| {{else}} | |||
| <td>{{TimeSinceUnix1 .CreatedUnix}} | |||
| <td> | |||
| {{end}} | |||
| </span> | |||
| <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.status"}}: | |||
| <span id="{{.VersionName}}-status-span"><i id="icon" style="vertical-align: middle;" class="{{.Status}}"></i><span id="text" style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span> | |||
| <span id="{{.VersionName}}-status-span"><i id="icon" | |||
| style="vertical-align: middle;" class="{{.Status}}"></i><span id="text" | |||
| style="margin-left: 0.4em;font-size: 12px;">{{.Status}}</span></span> | |||
| </span> | |||
| <span class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}:</span> | |||
| <span class="cti-mgRight-sm uc-accordionTitle-black" id="{{.VersionName}}-duration-span">{{$.duration}}</span> | |||
| <span | |||
| class="cti-mgRight-sm">{{$.i18n.Tr "repo.modelarts.train_job.dura_time"}}:</span> | |||
| <span class="cti-mgRight-sm uc-accordionTitle-black" | |||
| id="{{.VersionName}}-duration-span">{{$.duration}}</span> | |||
| </div> | |||
| </span> | |||
| @@ -265,36 +305,38 @@ td, th { | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain_creator"}} | |||
| </td> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain_creator"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||
| {{.User.Name}} | |||
| </div> | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-mirror"> | |||
| {{.User.Name}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.computing_resources"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-computeresource"> | |||
| {{.ComputeResource}} | |||
| </div> | |||
| </td> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.computing_resources"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-computeresource"> | |||
| {{.ComputeResource}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.createtime"}} | |||
| </td> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.createtime"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-createtime"> | |||
| {{TimeSinceUnix1 .CreatedUnix}} | |||
| </div> | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-createtime"> | |||
| {{TimeSinceUnix1 .CreatedUnix}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| @@ -303,40 +345,41 @@ td, th { | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-duration"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-duration"> | |||
| {{$.duration}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain.datasetdownload"}} | |||
| </td> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain.datasetdownload"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span-new" id="model_description"> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span-new" id="model_description"> | |||
| {{$.datasetDownloadLink}} | |||
| </div> | |||
| </td> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.description"}} | |||
| </td> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "cloudbrain.description"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span-new" id="model_description"> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span-new" id="model_description"> | |||
| {{.Description}} | |||
| </div> | |||
| </td> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| </tbody> | |||
| </table> | |||
| </div> | |||
| <div class="ac-grid-col"> | |||
| <table class="ti-form"> | |||
| <tbody class="ti-text-form"> | |||
| <table class="ti-form"> | |||
| <tbody class="ti-text-form"> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| @@ -350,33 +393,34 @@ td, th { | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.train_job.dataset"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-BenchmarkTypeName"> | |||
| {{.DatasetName}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.train_job.dataset"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-BenchmarkTypeName"> | |||
| {{.DatasetName}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.train_job.standard"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w"> | |||
| {{$.resource_spec}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.modelarts.train_job.standard"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w"> | |||
| {{$.resource_spec}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain.time.starttime"}} | |||
| @@ -384,44 +428,46 @@ td, th { | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-startTime"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-startTime"> | |||
| {{if not (eq .StartTime 0)}} | |||
| {{TimeSinceUnix1 .StartTime}} | |||
| {{else}} | |||
| -- | |||
| {{end}} | |||
| {{TimeSinceUnix1 .StartTime}} | |||
| {{else}} | |||
| -- | |||
| {{end}} | |||
| </div> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr class="ti-no-ng-animate"> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain.time.endtime"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" id="{{.VersionName}}-EndTime"> | |||
| {{if not (eq .EndTime 0)}} | |||
| {{TimeSinceUnix1 .EndTime}} | |||
| {{else}} | |||
| -- | |||
| {{end}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| </tbody> | |||
| </table> | |||
| </div> | |||
| <td class="ti-no-ng-animate ti-text-form-label text-width80"> | |||
| {{$.i18n.Tr "repo.cloudbrain.time.endtime"}} | |||
| </td> | |||
| <td class="ti-text-form-content"> | |||
| <div class="text-span text-span-w" | |||
| id="{{.VersionName}}-EndTime"> | |||
| {{if not (eq .EndTime 0)}} | |||
| {{TimeSinceUnix1 .EndTime}} | |||
| {{else}} | |||
| -- | |||
| {{end}} | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| </tbody> | |||
| </table> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -457,24 +503,10 @@ td, th { | |||
| <script> | |||
| $('.menu .item').tab() | |||
| $(document).ready(function(){ | |||
| $('.ui.accordion').accordion({selector:{trigger:'.icon'}}); | |||
| $(document).ready(function () { | |||
| $('.ui.accordion').accordion({ selector: { trigger: '.icon' } }); | |||
| }); | |||
| $(document).ready(function(){ | |||
| $(document).ready(function () { | |||
| $('.secondary.menu .item').tab(); | |||
| }); | |||
| let userName | |||
| let repoPath | |||
| let jobName | |||
| $(document).ready(function(){ | |||
| let url = window.location.href; | |||
| let urlArr = url.split('/') | |||
| userName = urlArr.slice(-5)[0] | |||
| repoPath = urlArr.slice(-4)[0] | |||
| jobName = urlArr.slice(-1)[0] | |||
| }) | |||
| </script> | |||
| </script> | |||
| @@ -239,7 +239,7 @@ const params = new URLSearchParams(location.search) | |||
| if(!location.search){ | |||
| $('.default.text').text(all) | |||
| }else{ | |||
| if(params.has('listType') && params.get('listType')=='all'){ | |||
| if(!params.has('listType') || params.get('listType')=='all'){ | |||
| $('.default.text').text(all) | |||
| } | |||
| else{ | |||
| @@ -233,8 +233,13 @@ | |||
| <div class="ui labeled input" style="width: 5%;"> | |||
| <input style="border-radius: 0;text-align: center;" name="work_server_number" id="trainjob_work_server_num" tabindex="3" autofocus required maxlength="255" value="1" readonly> | |||
| <input style="border-radius: 0;text-align: center;"type="hidden" name="work_server_number" id="trainjob_work_server_num" tabindex="3" autofocus required maxlength="255" value="1" readonly> | |||
| <div class="field" id="trainjob_work_server_num_select" name="work_server_number_select"> | |||
| <select class="ui dropdown width" style='width: 100%;' name="work_server_id"> | |||
| <option name="server_id" value="1">1</option> | |||
| <option name="server_id" value="2">2</option> | |||
| </select> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| @@ -263,19 +268,20 @@ | |||
| $('.menu .item') | |||
| .tab(); | |||
| let sever_num = $('#trainjob_work_server_num') | |||
| $('.add').click(function(){ | |||
| sever_num.val(parseInt(sever_num.val())+1) | |||
| if(sever_num.val()>=26){ | |||
| sever_num.val(parseInt(sever_num.val())-1) | |||
| } | |||
| }) | |||
| $('.min').click(function(){ | |||
| sever_num.val(parseInt(sever_num.val())-1) | |||
| if(sever_num.val()<=0){ | |||
| sever_num.val(parseInt(sever_num.val())+1) | |||
| } | |||
| }) | |||
| // let sever_num = $("#trainjob_work_server_num_select .text").text() //$('#trainjob_work_server_num') | |||
| // console.log("sever_num:",sever_num) | |||
| // $('.add').click(function(){ | |||
| // sever_num.val(parseInt(sever_num.val())+1) | |||
| // if(sever_num.val()>=26){ | |||
| // sever_num.val(parseInt(sever_num.val())-1) | |||
| // } | |||
| // }) | |||
| // $('.min').click(function(){ | |||
| // sever_num.val(parseInt(sever_num.val())-1) | |||
| // if(sever_num.val()<=0){ | |||
| // sever_num.val(parseInt(sever_num.val())+1) | |||
| // } | |||
| // }) | |||
| // 参数增加、删除、修改、保存 | |||
| function Add_parameter(i){ | |||
| value = '<div class="two fields width85" id= "para'+ i +'">' + | |||
| @@ -349,7 +355,7 @@ | |||
| // $("select[name='pool_id']").val(parameters[i]); | |||
| // break; | |||
| case (6): | |||
| $("input[name='work_server_number']").val(parameters[i]); | |||
| // $("input[name='work_server_number']").val(parameters[i]); | |||
| break; | |||
| } | |||
| } | |||
| @@ -456,6 +462,10 @@ | |||
| $("input#ai_engine_name").val(name1) | |||
| $("input#ai_flaver_name").val(name2) | |||
| let val_server_num_select = $("#trainjob_work_server_num_select .text").text() | |||
| // console.log("val_server_num_select:",val_server_num_select) | |||
| $("input#trainjob_work_server_num").val(val_server_num_select) | |||
| } | |||
| $('.ui.create_train_job.green.button').click(function(e) { | |||
| get_name() | |||
| @@ -1,25 +1,31 @@ | |||
| <template> | |||
| <div class="dropzone-wrapper dataset-files"> | |||
| <div | |||
| id="dataset" | |||
| class="dropzone" | |||
| /> | |||
| <p class="upload-info"> | |||
| {{ file_status_text }} | |||
| <strong class="success text red">{{ status }}</strong> | |||
| </p> | |||
| <el-button style="background-color: #21ba45;" type="success" :disabled="btnFlag" @click="onFileAdded">{{upload}}</el-button> | |||
| <div id="dataset" class="dropzone"> | |||
| <div class="maxfilesize ui red message" style="display: none;margin: 2.5rem;"></div> | |||
| </div> | |||
| <el-button style="background-color: #21ba45;margin-top: 2rem;" type="success" :disabled="btnFlag" @click="startUpload">{{upload}}</el-button> | |||
| <el-button type="info" @click="cancelDataset">{{cancel}}</el-button> | |||
| <!-- <p>说明:<br> | |||
| - 只有zip格式的数据集才能发起云脑任务;<br> | |||
| - 云脑1提供 <span class="text blue">CPU / GPU</span> 资源,云脑2提供 <span class="text blue">Ascend NPU</span> 资源;调试使用的数据集也需要上传到对应的环境。</p> --> | |||
| <div style="margin-top: 2rem;position: relative;"> | |||
| <label class="el-form-item__label" style="width: 140px;position: absolute;left: -140px;">上传状态:</label> | |||
| <div v-for="item in allUploadFiles" style="display:flex;padding: 0.8rem 0;border-bottom: 1px solid #e8e8e8;line-height: 1;" > | |||
| <span style="flex:4 1 0%;display: flex;max-width: 80%;"><i :class="[item.status===0?'ri-checkbox-circle-line success':'ri-close-circle-line failed']" style="margin-right: 0.5rem;"></i><span class="nowrap">{{item.name}}</span></span> | |||
| <span style="flex:1" v-if="item.status===0"><span style="color: #21ba45;">上传成功</span></span> | |||
| <span style="flex:1" v-else-if="item.status===1"> | |||
| <el-tooltip class="item" effect="dark" placement="top"> | |||
| <div slot="content">{{item.info}}</div> | |||
| <span style="color: red;cursor: pointer;">上传失败<span>(重复上传)</span></span> | |||
| </el-tooltip> | |||
| </span> | |||
| <span style="flex:1" v-else><span style="color: red;">上传失败</span></span> | |||
| </div> | |||
| </div> | |||
| </div> | |||
| </template> | |||
| <script> | |||
| /* eslint-disable eqeqeq */ | |||
| // import Dropzone from 'dropzone/dist/dropzone.js'; | |||
| // import 'dropzone/dist/dropzone.css' | |||
| import SparkMD5 from 'spark-md5'; | |||
| import axios from 'axios'; | |||
| import qs from 'qs'; | |||
| @@ -43,8 +49,8 @@ export default { | |||
| data() { | |||
| return { | |||
| dropzoneUploader: null, | |||
| maxFiles: 1, | |||
| maxFilesize: 1 * 1024 * 1024 * 1024 * 1024, | |||
| maxFiles: 10, | |||
| maxFilesize: 200 , | |||
| acceptedFiles: '*/*', | |||
| progress: 0, | |||
| status: '', | |||
| @@ -55,6 +61,11 @@ export default { | |||
| btnFlag:false, | |||
| cancel:'', | |||
| upload:'', | |||
| uploadFiles:[], | |||
| uploadFilesAddId:[], | |||
| allUploadFiles:[], | |||
| uploadLength:0, | |||
| allUploadLength:0, | |||
| }; | |||
| }, | |||
| @@ -65,82 +76,98 @@ export default { | |||
| this.repoPath = this.dropzoneParams.data('repopath'); | |||
| this.cancel = this.dropzoneParams.data('cancel'); | |||
| this.upload = this.dropzoneParams.data('upload'); | |||
| // let previewTemplate = ''; | |||
| // previewTemplate += '<div class="dz-preview dz-file-preview">\n '; | |||
| // previewTemplate += ' <div class="dz-details">\n '; | |||
| // previewTemplate += ' <div class="dz-filename">'; | |||
| // previewTemplate += | |||
| // ' <span data-dz-name data-dz-thumbnail></span>'; | |||
| // previewTemplate += ' </div>\n '; | |||
| // previewTemplate += ' <div class="dz-size" data-dz-size style="white-space: nowrap"></div>\n '; | |||
| // previewTemplate += ' </div>\n '; | |||
| // previewTemplate += ' <div class="dz-progress ui active progress">'; | |||
| // previewTemplate += | |||
| // ' <div class="dz-upload bar" data-dz-uploadprogress><div class="progress"></div></div>\n '; | |||
| // previewTemplate += ' </div>\n '; | |||
| // previewTemplate += ' <div class="dz-success-mark">'; | |||
| // previewTemplate += ' <span>上传成功</span>'; | |||
| // previewTemplate += ' </div>\n '; | |||
| // previewTemplate += ' <div class="dz-error-mark">'; | |||
| // previewTemplate += ' <span>上传失败</span>'; | |||
| // previewTemplate += ' </div>\n '; | |||
| // previewTemplate += ' <div class="dz-error-message">'; | |||
| // previewTemplate += ' <span data-dz-errormessage></span>'; | |||
| // previewTemplate += ' </div>\n'; | |||
| // previewTemplate += '</div>'; | |||
| let previewTemplate = '' | |||
| previewTemplate += '<div class="dz-preview dz-file-preview" style="width:100%;background: none;">' | |||
| previewTemplate += '<div class="dz-details" style="opacity: 1;">' | |||
| previewTemplate += '<div class="dz-filename"><span data-dz-name></span></div>' | |||
| previewTemplate += '<div class="dz-size" data-dz-size></div>' | |||
| previewTemplate += '<div class="dz-progress ui active progress" style="top: 75%;width: 80%;left: 15%;"><div class="dz-upload bar" data-dz-uploadprogress><div class="progress"></div></div></div>' | |||
| // previewTemplate += '<img data-dz-thumbnail />' | |||
| previewTemplate += '</div>' | |||
| previewTemplate += '<div class="dz-success-mark"><span>✔</span></div>' | |||
| previewTemplate += '<div class="dz-error-mark"><span>✘</span></div>' | |||
| previewTemplate += '<div class="dz-error-message"><span data-dz-errormessage></span></div>' | |||
| previewTemplate += '</div>' | |||
| let previewTemplate = ` | |||
| <div class="dz-preview dz-file-preview"> | |||
| <div class="dz-image"> | |||
| <img data-dz-thumbnail /> | |||
| </div> | |||
| <div class="dz-details"> | |||
| <div class="dz-size"><span data-dz-size></span></div> | |||
| <div class="dz-filename"><span data-dz-name></span></div> | |||
| </div> | |||
| <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div> | |||
| <div class="dz-error-message" style="line-height: 1.5;"><span data-dz-errormessage></span></div> | |||
| <div class="dz-success-mark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="54" height="54"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414 2.829 2.829 5.656-5.657 1.415 1.414L11.003 16z" fill="rgba(47,204,113,1)"/></svg></div> | |||
| <div class="dz-error-mark"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="54" height="54"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-9.414l2.828-2.829 1.415 1.415L13.414 12l2.829 2.828-1.415 1.415L12 13.414l-2.828 2.829-1.415-1.415L10.586 12 7.757 9.172l1.415-1.415L12 10.586z" fill="rgba(231,76,60,1)"/></svg></div> | |||
| </div> ` | |||
| const $dropzone = $('div#dataset'); | |||
| const dropzoneUploader = await createDropzone($dropzone[0], { | |||
| url: '/todouploader', | |||
| maxFiles: this.maxFiles, | |||
| maxFilesize: this.maxFileSize, | |||
| maxFilesize: 1024*200, | |||
| filesizeBase:1024, | |||
| parallelUploads: this.maxFiles, | |||
| timeout: 0, | |||
| autoQueue: false, | |||
| addRemoveLinks:true, | |||
| // autoQueue: false, | |||
| autoProcessQueue: false, //自动上传 | |||
| dictDefaultMessage: this.dropzoneParams.data('default-message'), | |||
| dictInvalidFileType: this.dropzoneParams.data('invalid-input-type'), | |||
| dictFileTooBig: this.dropzoneParams.data('file-too-big'), | |||
| dictRemoveFile: this.dropzoneParams.data('remove-file'), | |||
| previewTemplate | |||
| previewTemplate:previewTemplate | |||
| }); | |||
| dropzoneUploader.on('addedfile', (file) => { | |||
| this.file = file | |||
| }); | |||
| dropzoneUploader.on('maxfilesexceeded', function (file) { | |||
| if (this.files[0].status !== 'success') { | |||
| alert(this.dropzoneParams.data('waitting-uploading')); | |||
| this.removeFile(file); | |||
| return; | |||
| if(file.size/(1024*1024)>dropzoneUploader.options.maxFilesize){ | |||
| dropzoneUploader.removeFile(file) | |||
| $('.maxfilesize.ui.red.message').text("单次最多上传10个文件,单个文件不超过200G") | |||
| $('.maxfilesize.ui.red.message').css('display','block') | |||
| }else{ | |||
| this.file = file | |||
| $('.maxfilesize.ui.red.message').css('display','none') | |||
| } | |||
| this.removeAllFiles(); | |||
| this.addFile(file); | |||
| }); | |||
| dropzoneUploader.on("removedfile",(file)=>{ | |||
| $('.maxfilesize.ui.red.message').css('display','none') | |||
| }) | |||
| dropzoneUploader.on('maxfilesexceeded', function (file) { | |||
| dropzoneUploader.removeFile(file) | |||
| $('.maxfilesize.ui.red.message').text("单次最多上传10个文件,单个文件不超过200G") | |||
| $('.maxfilesize.ui.red.message').css('display','block') | |||
| }); | |||
| this.dropzoneUploader = dropzoneUploader; | |||
| }, | |||
| watch:{ | |||
| allUploadLength(len){ | |||
| if(len===this.uploadFiles.length){ | |||
| setTimeout(() => { | |||
| this.dropzoneUploader.removeAllFiles(true) | |||
| this.btnFlag = false | |||
| this.$emit('setcluster',this.btnFlag) | |||
| }, 2000); | |||
| } | |||
| } | |||
| }, | |||
| methods: { | |||
| startUpload(){ | |||
| this.uploadFiles = this.dropzoneUploader.getQueuedFiles() | |||
| if(this.uploadFiles.length===0){ | |||
| return | |||
| } | |||
| this.resetStatus() | |||
| $('.dz-remove').remove() | |||
| $('.maxfilesize.ui.red.message').css('display','none') | |||
| this.btnFlag = true | |||
| this.$emit('setcluster',this.btnFlag) | |||
| this.uploadFiles.forEach(element => { | |||
| element.datasetId = document.getElementById('datasetId').getAttribute('datasetId') | |||
| this.computeMD5(element) | |||
| }); | |||
| }, | |||
| cancelDataset(){ | |||
| location.href = this.repoPath | |||
| this.dropzoneUploader.removeAllFiles(true) | |||
| }, | |||
| resetStatus() { | |||
| this.progress = 0; | |||
| this.status = ''; | |||
| this.uploadLength = 0 | |||
| this.allUploadLength = 0 | |||
| this.allUploadFiles = [] | |||
| }, | |||
| updateProgress(file, progress) { | |||
| console.log("progress---",progress) | |||
| file.previewTemplate.querySelector( | |||
| '.dz-upload' | |||
| ).style.width = `${progress}%` | |||
| @@ -148,6 +175,26 @@ export default { | |||
| '.dz-upload' | |||
| ).style.background = '#409eff'; | |||
| }, | |||
| uploadError(file,info){ | |||
| file.previewTemplate.querySelector( | |||
| '.dz-error-mark' | |||
| ).style.opacity = 1 | |||
| file.previewTemplate.querySelector( | |||
| '.dz-progress' | |||
| ).style.opacity = 0 | |||
| file.previewTemplate.querySelector( | |||
| '.dz-error-message span' | |||
| ).innerHTML = info | |||
| file.previewTemplate.querySelector( | |||
| '.dz-error-message' | |||
| ).style.display = 'block' | |||
| file.previewTemplate.querySelector( | |||
| '.dz-details' | |||
| ).onmouseover = function(){file.previewTemplate.querySelector('.dz-error-message').style.opacity = 1 } | |||
| file.previewTemplate.querySelector( | |||
| '.dz-details' | |||
| ).onmouseout = function(){file.previewTemplate.querySelector('.dz-error-message').style.opacity = 0 } | |||
| }, | |||
| emitDropzoneSuccess(file) { | |||
| file.status = 'success'; | |||
| this.dropzoneUploader.emit('success', file); | |||
| @@ -159,28 +206,22 @@ export default { | |||
| this.dropzoneUploader.emit('error', file); | |||
| // this.dropzoneUploader.emit('complete', file); | |||
| }, | |||
| onFileAdded() { | |||
| this.btnFlag = true | |||
| this.file.datasetId = document | |||
| .getElementById('datasetId') | |||
| .getAttribute('datasetId'); | |||
| this.resetStatus(); | |||
| if(!this.file?.upload){ | |||
| this.btnFlag = false | |||
| return | |||
| } | |||
| this.computeMD5(this.file); | |||
| }, | |||
| finishUpload(file) { | |||
| this.emitDropzoneSuccess(file); | |||
| setTimeout(() => { | |||
| console.log("finish",file) | |||
| file.previewTemplate.querySelector( | |||
| '.dz-success-mark' | |||
| ).style.opacity = 1 | |||
| file.previewTemplate.querySelector( | |||
| '.dz-progress' | |||
| ).style.opacity = 0 | |||
| if(this.uploadLength === this.uploadFiles.length){ | |||
| setTimeout(() => { | |||
| window.location.href = this.repoPath | |||
| }, 1000); | |||
| }, 1000); | |||
| } | |||
| }, | |||
| computeMD5(file) { | |||
| this.resetStatus(); | |||
| const blobSlice = | |||
| File.prototype.slice || | |||
| File.prototype.mozSlice || | |||
| @@ -189,7 +230,6 @@ export default { | |||
| spark = new SparkMD5.ArrayBuffer(), | |||
| fileReader = new FileReader(); | |||
| let currentChunk = 0; | |||
| const time = new Date().getTime(); | |||
| this.status = this.dropzoneParams.data('md5-computing'); | |||
| file.totalChunkCounts = chunks; | |||
| @@ -225,6 +265,7 @@ export default { | |||
| file.size | |||
| } 用时:${(new Date().getTime() - time) / 1000} s` | |||
| ); | |||
| this.updateProgress(file,100) | |||
| spark.destroy(); // 释放缓存 | |||
| file.uniqueIdentifier = md5; // 将文件md5赋值给文件唯一标识 | |||
| file.cmd5 = false; // 取消计算md5状态 | |||
| @@ -257,6 +298,10 @@ export default { | |||
| this.multipartUpload(file); | |||
| } else { | |||
| // 失败如何处理 | |||
| let info = "上传失败" | |||
| this.allUploadLength++ | |||
| this.uploadError(file,info) | |||
| this.allUploadFiles.push({name:file.name,status:2,info:info}) | |||
| return; | |||
| } | |||
| return; | |||
| @@ -272,15 +317,16 @@ export default { | |||
| //不同数据集上传同一个文件 | |||
| if (file.datasetID != '') { | |||
| if (file.datasetName != "" && file.realName != "") { | |||
| var info = "该文件已上传,对应数据集(" + file.datasetName + ")-文件(" + file.realName + ")"; | |||
| window.alert(info); | |||
| window.location.reload(); | |||
| let info = `该文件已上传在数据集: ${file.datasetName}` | |||
| this.uploadError(file,info) | |||
| this.allUploadLength++ | |||
| this.allUploadFiles.push({name:file.name,status:1,info:info}) | |||
| } | |||
| } | |||
| console.log('文件已上传完成'); | |||
| this.progress = 100; | |||
| this.status = this.dropzoneParams.data('upload-complete'); | |||
| this.finishUpload(file); | |||
| // this.finishUpload(file); | |||
| } else { | |||
| // 断点续传 | |||
| this.multipartUpload(file); | |||
| @@ -488,7 +534,12 @@ export default { | |||
| this.status = this.dropzoneParams.data('uploading'); | |||
| loadNext(); | |||
| fileReader.onload = async (e) => { | |||
| await uploadChunk(e); | |||
| try{ | |||
| await uploadChunk(e); | |||
| }catch(err){ | |||
| console.log(err) | |||
| } | |||
| fileReader.abort(); | |||
| currentChunk++; | |||
| if (currentChunk < chunks) { | |||
| @@ -504,12 +555,27 @@ export default { | |||
| ).toFixed(2)}%`; | |||
| await loadNext(); | |||
| } else { | |||
| await completeUpload(); | |||
| try{ | |||
| await completeUpload(); | |||
| }catch(err){ | |||
| let info = "上传失败" | |||
| this.allUploadLength++ | |||
| this.uploadError(file,info) | |||
| this.allUploadFiles.push({name:file.name,status:2,info:info}) | |||
| if(err){ | |||
| return | |||
| } | |||
| } | |||
| console.log( | |||
| `文件上传完成:${file.name} \n分片:${chunks} 大小:${ | |||
| file.size | |||
| } 用时:${(new Date().getTime() - time) / 1000} s` | |||
| ); | |||
| this.uploadLength++ | |||
| this.allUploadLength++ | |||
| this.allUploadFiles.push({name:file.name,status:0,info:'上传成功'}) | |||
| this.updateProgress(file, 100); | |||
| this.progress = 100; | |||
| this.status = this.dropzoneParams.data('upload-complete'); | |||
| @@ -545,4 +611,10 @@ export default { | |||
| margin-top: 1em; | |||
| margin-bottom: 3em; | |||
| } | |||
| .success{ | |||
| color: #21ba45; | |||
| } | |||
| .failed{ | |||
| color: red; | |||
| } | |||
| </style> | |||
| @@ -22,12 +22,12 @@ | |||
| <el-dropdown-menu slot="dropdown"> | |||
| <el-dropdown-item :command="{label:'全部',private:''}">全部</el-dropdown-item> | |||
| <el-dropdown-item :command="{label:'公开',private:false}">公开</el-dropdown-item> | |||
| <el-dropdown-item :command="{label:'公开',private:true}">私有</el-dropdown-item> | |||
| <el-dropdown-item :command="{label:'私有',private:true}">私有</el-dropdown-item> | |||
| </el-dropdown-menu> | |||
| </el-dropdown> | |||
| </div> | |||
| <div class="ui six wide column right aligned" style="margin: 1rem 0;"> | |||
| <a class="ui blue small button" href="/admin/images/commit_image?from=imageAdmin">创建云脑镜像</a> | |||
| <a class="ui blue small button" href="/admin/images/commit_image">创建云脑镜像</a> | |||
| </div> | |||
| <div class="ui sixteen wide column" style="padding: 0;"> | |||
| <el-table | |||
| @@ -117,12 +117,8 @@ | |||
| <svg width="1.4em" height="1.4em" viewBox="0 0 32 32" class="heart-stroke"><path d="M4.4 6.54c-1.761 1.643-2.6 3.793-2.36 6.056.24 2.263 1.507 4.521 3.663 6.534a29110.9 29110.9 0 0010.296 9.633l10.297-9.633c2.157-2.013 3.424-4.273 3.664-6.536.24-2.264-.599-4.412-2.36-6.056-1.73-1.613-3.84-2.29-6.097-1.955-1.689.25-3.454 1.078-5.105 2.394l-.4.319-.398-.319c-1.649-1.316-3.414-2.143-5.105-2.394a7.612 7.612 0 00-1.113-.081c-1.838 0-3.541.694-4.983 2.038z"></path></svg> | |||
| <span style="line-height: 2;margin-left:0.3rem;">{{scope.row.numStars}}</span> | |||
| </div> | |||
| <template v-if="!scope.row.isPrivate"> | |||
| <span style="padding: 0 1rem;color: rgb(250, 140, 22);cursor:pointer;" v-if="scope.row.type==5" @click="unSetRecommend(scope.$index,scope.row.id)">取消推荐</span> | |||
| <span style="padding: 0 1rem;color: rgb(19, 194, 141);cursor:pointer;" v-else @click="setRecommend(scope.$index,scope.row.id)">设为推荐</span> | |||
| </template> | |||
| <span style="padding: 0 1rem;color: rgb(19, 194, 141);cursor:pointer;" v-if="scope.row.type!==5 && !scope.row.isPrivate" @click="setRecommend(scope.$index,scope.row.id)">设为推荐</span> | |||
| <span style="padding: 0 1rem;color:#0366d6;cursor:pointer;" @click="copyUrl(scope.row.place)">复制地址</span> | |||
| <div style="padding-left:1rem;cursor:pointer;"> | |||
| <el-dropdown size="medium"> | |||
| @@ -2,7 +2,9 @@ export default async function initCloudrain() { | |||
| let debug_button = $('.cloudbrain_debug').data('debug') | |||
| let debug_again_button = $('.cloudbrain_debug').data('debug-again') | |||
| let timeid = window.setInterval(loadJobStatus, 15000); | |||
| let timeidShow = window.setInterval(loadShowJobStatus, 15000); | |||
| $(document).ready(loadJobStatus); | |||
| $(document).ready(loadShowJobStatus); | |||
| function loadJobStatus() { | |||
| $(".job-status").each((index, job) => { | |||
| const ID = job.dataset.jobid; | |||
| @@ -10,7 +12,7 @@ export default async function initCloudrain() { | |||
| // const computeResource = job.dataset.resource | |||
| const versionname = job.dataset.version | |||
| const status_text = $(`#${ID}-text`).text() | |||
| const finalState = ['STOPPED','CREATE_FAILED','UNAVAILABLE','DELETED','RESIZE_FAILED','SUCCEEDED','IMAGE_FAILED','SUBMIT_FAILED','DELETE_FAILED','KILLED','COMPLETED','FAILED','CANCELED','LOST','START_FAILED','SUBMIT_MODEL_FAILED','DEPLOY_SERVICE_FAILED','CHECK_FAILED'] | |||
| const finalState = ['STOPPED', 'CREATE_FAILED', 'UNAVAILABLE', 'DELETED', 'RESIZE_FAILED', 'SUCCEEDED', 'IMAGE_FAILED', 'SUBMIT_FAILED', 'DELETE_FAILED', 'KILLED', 'COMPLETED', 'FAILED', 'CANCELED', 'LOST', 'START_FAILED', 'SUBMIT_MODEL_FAILED', 'DEPLOY_SERVICE_FAILED', 'CHECK_FAILED'] | |||
| if (finalState.includes(status_text)) { | |||
| return | |||
| } | |||
| @@ -19,46 +21,83 @@ export default async function initCloudrain() { | |||
| const ID = data.ID || data.JobID | |||
| const status = data.JobStatus | |||
| const duration = data.JobDuration | |||
| $('#duration-'+ID).text(duration) | |||
| console.log(status,["STOPPED"].includes(status)) | |||
| $('#duration-' + ID).text(duration) | |||
| if (status != status_text) { | |||
| $('#' + ID+'-icon').removeClass().addClass(status) | |||
| $('#' + ID+ '-text').text(status) | |||
| $('#' + ID + '-icon').removeClass().addClass(status) | |||
| $('#' + ID + '-text').text(status) | |||
| finalState.includes(status) && $('#' + ID + '-stop').removeClass('blue').addClass('disabled') | |||
| } | |||
| if(status==="RUNNING"){ | |||
| $('#ai-debug-'+ID).removeClass('disabled').addClass('blue').text(debug_button).css("margin","0 1rem") | |||
| $('#model-image-'+ID).removeClass('disabled').addClass('blue') | |||
| if (status === "RUNNING") { | |||
| $('#ai-debug-' + ID).removeClass('disabled').addClass('blue').text(debug_button).css("margin", "0 1rem") | |||
| $('#model-image-' + ID).removeClass('disabled').addClass('blue') | |||
| } | |||
| if(status!=="RUNNING"){ | |||
| if (status !== "RUNNING") { | |||
| // $('#model-debug-'+ID).removeClass('blue') | |||
| // $('#model-debug-'+ID).addClass('disabled') | |||
| $('#model-image-'+ID).removeClass('blue').addClass('disabled') | |||
| $('#model-image-' + ID).removeClass('blue').addClass('disabled') | |||
| } | |||
| if(["CREATING","STOPPING","WAITING","STARTING"].includes(status)){ | |||
| $('#ai-debug-'+ID).removeClass('blue').addClass('disabled') | |||
| if (["CREATING", "STOPPING", "WAITING", "STARTING"].includes(status)) { | |||
| $('#ai-debug-' + ID).removeClass('blue').addClass('disabled') | |||
| } | |||
| if(['STOPPED','FAILED','START_FAILED','CREATE_FAILED','SUCCEEDED'].includes(status)){ | |||
| $('#ai-debug-'+ID).removeClass('disabled').addClass('blue').text(debug_again_button).css("margin","0") | |||
| } | |||
| if(["RUNNING","WAITING"].includes(status)){ | |||
| $('#ai-stop-'+ID).removeClass('disabled').addClass('blue') | |||
| if (['STOPPED', 'FAILED', 'START_FAILED', 'CREATE_FAILED', 'SUCCEEDED'].includes(status)) { | |||
| $('#ai-debug-' + ID).removeClass('disabled').addClass('blue').text(debug_again_button).css("margin", "0") | |||
| } | |||
| if(["CREATING","STOPPING","STARTING","STOPPED","FAILED","START_FAILED","SUCCEEDED","COMPLETED","CREATE_FAILED"].includes(status)){ | |||
| $('#ai-stop-'+ID).removeClass('blue').addClass('disabled') | |||
| if (["RUNNING", "WAITING"].includes(status)) { | |||
| $('#ai-stop-' + ID).removeClass('disabled').addClass('blue') | |||
| } | |||
| if(["STOPPED","FAILED","START_FAILED","KILLED","COMPLETED","SUCCEEDED"].includes(status)){ | |||
| $('#ai-delete-'+ID).removeClass('disabled').addClass('blue') | |||
| }else{ | |||
| $('#ai-delete-'+ID).removeClass('blue').addClass('disabled') | |||
| if (["CREATING", "STOPPING", "STARTING", "STOPPED", "FAILED", "START_FAILED", "SUCCEEDED", "COMPLETED", "CREATE_FAILED"].includes(status)) { | |||
| $('#ai-stop-' + ID).removeClass('blue').addClass('disabled') | |||
| } | |||
| }).fail(function(err) { | |||
| if (["STOPPED", "FAILED", "START_FAILED", "KILLED", "COMPLETED", "SUCCEEDED"].includes(status)) { | |||
| $('#ai-delete-' + ID).removeClass('disabled').addClass('blue') | |||
| } else { | |||
| $('#ai-delete-' + ID).removeClass('blue').addClass('disabled') | |||
| } | |||
| }).fail(function (err) { | |||
| console.log(err); | |||
| }); | |||
| }); | |||
| }; | |||
| function loadShowJobStatus() { | |||
| $(".ui.accordion.border-according").each((index, job) => { | |||
| const jobID = job.dataset.jobid; | |||
| const repoPath = job.dataset.repopath; | |||
| const versionname = job.dataset.version | |||
| // ['IMAGE_FAILED','SUBMIT_FAILED','DELETE_FAILED','KILLED','COMPLETED','FAILED','CANCELED','LOST','START_FAILED'] | |||
| // if (job.textContent.trim() == 'IMAGE_FAILED' || job.textContent.trim() == 'SUBMIT_FAILED' || job.textContent.trim() == 'DELETE_FAILED' | |||
| // || job.textContent.trim() == 'KILLED' || job.textContent.trim() == 'COMPLETED' || job.textContent.trim() == 'FAILED' | |||
| // || job.textContent.trim() == 'CANCELED' || job.textContent.trim() == 'LOST') { | |||
| // return | |||
| // } | |||
| let status = $(`#${versionname}-status-span`).text() | |||
| if (['IMAGE_FAILED', 'SUBMIT_FAILED', 'DELETE_FAILED', 'KILLED', 'COMPLETED', 'FAILED', 'CANCELED', 'LOST', 'START_FAILED', 'SUCCEEDED', 'STOPPED'].includes(status)) { | |||
| return | |||
| } | |||
| let stopArray = ["KILLED", "FAILED", "START_FAILED", "KILLING", "COMPLETED", "SUCCEEDED", "STOPPED"] | |||
| $.get(`/api/v1/repos/${repoPath}/${jobID}?version_name=${versionname}`, (data) => { | |||
| //$(`#${versionname}-duration-span`).text(data.JobDuration) | |||
| $(`#${versionname}-status-span span`).text(data.JobStatus) | |||
| $(`#${versionname}-status-span i`).attr("class", data.JobStatus) | |||
| // detail status and duration | |||
| //$('#'+versionname+'-duration').text(data.JobDuration) | |||
| $('#' + versionname + '-status').text(data.JobStatus) | |||
| if (stopArray.includes(data.JobStatus)) { | |||
| $('#' + versionname + '-stop').addClass('disabled') | |||
| } | |||
| if (data.JobStatus === "COMPLETED") { | |||
| $('#' + versionname + '-create-model').removeClass('disabled').addClass('blue') | |||
| } | |||
| }).fail(function (err) { | |||
| console.log(err); | |||
| }); | |||
| }); | |||
| }; | |||
| function assertDelete(obj,versionName,repoPath) { | |||
| function assertDelete(obj, versionName, repoPath) { | |||
| if (obj.style.color == "rgb(204, 204, 204)") { | |||
| return | |||
| } else { | |||
| @@ -66,19 +105,19 @@ export default async function initCloudrain() { | |||
| let flag = 1; | |||
| $('.ui.basic.modal') | |||
| .modal({ | |||
| onDeny: function() { | |||
| onDeny: function () { | |||
| flag = false | |||
| }, | |||
| onApprove: function() { | |||
| if(!versionName){ | |||
| onApprove: function () { | |||
| if (!versionName) { | |||
| document.getElementById(delId).submit() | |||
| } | |||
| else{ | |||
| deleteVersion(versionName,repoPath) | |||
| else { | |||
| deleteVersion(versionName, repoPath) | |||
| } | |||
| flag = true | |||
| }, | |||
| onHidden: function() { | |||
| onHidden: function () { | |||
| if (flag == false) { | |||
| $('.alert').html('您已取消操作').removeClass('alert-success').addClass('alert-danger').show().delay(1500).fadeOut(); | |||
| } | |||
| @@ -87,157 +126,156 @@ export default async function initCloudrain() { | |||
| .modal('show') | |||
| } | |||
| } | |||
| function deleteVersion(versionName,repoPath){ | |||
| function deleteVersion(versionName, repoPath) { | |||
| const url = `/api/v1/repos/${repoPath}` | |||
| $.post(url,{version_name:versionName},(data)=>{ | |||
| if(data.StatusOK===0){ | |||
| $.post(url, { version_name: versionName }, (data) => { | |||
| if (data.StatusOK === 0) { | |||
| location.reload() | |||
| } | |||
| }).fail(function(err) { | |||
| console.log(err); | |||
| }).fail(function (err) { | |||
| console.log(err); | |||
| }); | |||
| } | |||
| $('.ui.basic.ai_delete').click(function() { | |||
| $('.ui.basic.ai_delete').click(function () { | |||
| const repoPath = this.dataset.repopath | |||
| const versionName = this.dataset.version | |||
| if(repoPath && versionName){ | |||
| assertDelete(this,versionName,repoPath) | |||
| if (repoPath && versionName) { | |||
| assertDelete(this, versionName, repoPath) | |||
| } | |||
| else{ | |||
| else { | |||
| assertDelete(this) | |||
| } | |||
| }) | |||
| function stopDebug(ID,stopUrl){ | |||
| function stopDebug(ID, stopUrl) { | |||
| $.ajax({ | |||
| type:"POST", | |||
| url:stopUrl, | |||
| data:$('#stopForm-'+ID).serialize(), | |||
| success:function(res){ | |||
| if(res.result_code==="0"){ | |||
| $('#' + ID+'-icon').removeClass().addClass(res.status) | |||
| $('#' + ID+ '-text').text(res.status) | |||
| if(res.status==="STOPPED"){ | |||
| $('#ai-debug-'+ID).removeClass('disabled').addClass('blue').text(debug_again_button).css("margin","0") | |||
| $('#ai-image-'+ID).removeClass('blue').addClass('disabled') | |||
| $('#ai-model-debug-'+ID).removeClass('blue').addClass('disabled') | |||
| $('#ai-delete-'+ID).removeClass('disabled').addClass('blue') | |||
| $('#ai-stop-'+ID).removeClass('blue').addClass('disabled') | |||
| type: "POST", | |||
| url: stopUrl, | |||
| data: $('#stopForm-' + ID).serialize(), | |||
| success: function (res) { | |||
| if (res.result_code === "0") { | |||
| $('#' + ID + '-icon').removeClass().addClass(res.status) | |||
| $('#' + ID + '-text').text(res.status) | |||
| if (res.status === "STOPPED") { | |||
| $('#ai-debug-' + ID).removeClass('disabled').addClass('blue').text(debug_again_button).css("margin", "0") | |||
| $('#ai-image-' + ID).removeClass('blue').addClass('disabled') | |||
| $('#ai-model-debug-' + ID).removeClass('blue').addClass('disabled') | |||
| $('#ai-delete-' + ID).removeClass('disabled').addClass('blue') | |||
| $('#ai-stop-' + ID).removeClass('blue').addClass('disabled') | |||
| } | |||
| else{ | |||
| $('#ai-debug-'+ID).removeClass('blue').addClass('disabled') | |||
| $('#ai-stop-'+ID).removeClass('blue').addClass('disabled') | |||
| else { | |||
| $('#ai-debug-' + ID).removeClass('blue').addClass('disabled') | |||
| $('#ai-stop-' + ID).removeClass('blue').addClass('disabled') | |||
| } | |||
| }else{ | |||
| } else { | |||
| $('.alert').html(res.error_msg).removeClass('alert-success').addClass('alert-danger').show().delay(2000).fadeOut(); | |||
| } | |||
| }, | |||
| error :function(res){ | |||
| error: function (res) { | |||
| console.log(res) | |||
| } | |||
| }) | |||
| } | |||
| $('.ui.basic.ai_stop').click(function() { | |||
| $('.ui.basic.ai_stop').click(function () { | |||
| const ID = this.dataset.jobid | |||
| const repoPath = this.dataset.repopath | |||
| stopDebug(ID,repoPath) | |||
| stopDebug(ID, repoPath) | |||
| }) | |||
| function stopVersion(version_name,ID,repoPath){ | |||
| function stopVersion(version_name, ID, repoPath) { | |||
| const url = `/api/v1/repos/${repoPath}/${ID}/stop_version` | |||
| $.post(url,{version_name:version_name},(data)=>{ | |||
| if(data.StatusOK===0){ | |||
| $('#ai-stop-'+ID).removeClass('blue') | |||
| $('#ai-stop-'+ID).addClass('disabled') | |||
| refreshStatus(version_name,ID,repoPath) | |||
| $.post(url, { version_name: version_name }, (data) => { | |||
| if (data.StatusOK === 0) { | |||
| $('#ai-stop-' + ID).removeClass('blue') | |||
| $('#ai-stop-' + ID).addClass('disabled') | |||
| refreshStatus(version_name, ID, repoPath) | |||
| } | |||
| }).fail(function(err) { | |||
| console.log(err); | |||
| }).fail(function (err) { | |||
| console.log(err); | |||
| }); | |||
| } | |||
| function refreshStatus(version_name,ID,repoPath){ | |||
| function refreshStatus(version_name, ID, repoPath) { | |||
| const url = `/api/v1/repos/${repoPath}/${ID}/?version_name${version_name}` | |||
| $.get(url,(data)=>{ | |||
| $(`#${ID}-icon`).attr("class",data.JobStatus) | |||
| $.get(url, (data) => { | |||
| $(`#${ID}-icon`).attr("class", data.JobStatus) | |||
| // detail status and duration | |||
| $(`#${ID}-text`).text(data.JobStatus) | |||
| if(["STOPPED","FAILED","START_FAILED","KILLED","COMPLETED","SUCCEEDED"].includes(data.JobStatus)){ | |||
| $('#ai-delete-'+ID).removeClass('disabled').addClass('blue') | |||
| if (["STOPPED", "FAILED", "START_FAILED", "KILLED", "COMPLETED", "SUCCEEDED"].includes(data.JobStatus)) { | |||
| $('#ai-delete-' + ID).removeClass('disabled').addClass('blue') | |||
| } | |||
| }).fail(function(err) { | |||
| }).fail(function (err) { | |||
| console.log(err); | |||
| }); | |||
| } | |||
| $('.ui.basic.ai_stop_version').click(function() { | |||
| $('.ui.basic.ai_stop_version').click(function () { | |||
| const ID = this.dataset.jobid | |||
| const repoPath = this.dataset.repopath | |||
| const versionName = this.dataset.version | |||
| stopVersion(versionName,ID,repoPath) | |||
| stopVersion(versionName, ID, repoPath) | |||
| }) | |||
| function getModelInfo(repoPath,modelName,versionName,jobName){ | |||
| $.get(`${repoPath}/modelmanage/show_model_info_api?name=${modelName}`,(data)=>{ | |||
| if(data.length===0){ | |||
| function getModelInfo(repoPath, modelName, versionName, jobName) { | |||
| $.get(`${repoPath}/modelmanage/show_model_info_api?name=${modelName}`, (data) => { | |||
| if (data.length === 0) { | |||
| $(`#${jobName}`).popup('toggle') | |||
| }else{ | |||
| let versionData = data.filter((item)=>{ | |||
| } else { | |||
| let versionData = data.filter((item) => { | |||
| return item.Version === versionName | |||
| }) | |||
| if(versionData.length==0){ | |||
| if (versionData.length == 0) { | |||
| $(`#${jobName}`).popup('toggle') | |||
| } | |||
| else{ | |||
| else { | |||
| location.href = `${repoPath}/modelmanage/show_model_info?name=${modelName}` | |||
| } | |||
| } | |||
| }) | |||
| } | |||
| $('.goto_modelmanage').click(function() { | |||
| $('.goto_modelmanage').click(function () { | |||
| const repoPath = this.dataset.repopath | |||
| const modelName = this.dataset.modelname | |||
| const versionName = this.dataset.version | |||
| const jobName = this.dataset.jobname | |||
| getModelInfo(repoPath,modelName,versionName,jobName) | |||
| getModelInfo(repoPath, modelName, versionName, jobName) | |||
| }) | |||
| function debugAgain(ID,debugUrl,redirect_to){ | |||
| if($('#' + ID+ '-text').text()==="RUNNING"){ | |||
| window.open(debugUrl+'debug') | |||
| }else{ | |||
| function debugAgain(ID, debugUrl, redirect_to) { | |||
| if ($('#' + ID + '-text').text() === "RUNNING") { | |||
| window.open(debugUrl + 'debug') | |||
| } else { | |||
| $.ajax({ | |||
| type:"POST", | |||
| url:debugUrl+'restart?redirect_to='+redirect_to, | |||
| data:$('#debugAgainForm-'+ID).serialize(), | |||
| success:function(res){ | |||
| if(res['WechatRedirectUrl']){ | |||
| window.location.href=res['WechatRedirectUrl'] | |||
| type: "POST", | |||
| url: debugUrl + 'restart?redirect_to=' + redirect_to, | |||
| data: $('#debugAgainForm-' + ID).serialize(), | |||
| success: function (res) { | |||
| if (res['WechatRedirectUrl']) { | |||
| window.location.href = res['WechatRedirectUrl'] | |||
| } | |||
| else if(res.result_code==="0"){ | |||
| if(res.id!==ID){ | |||
| else if (res.result_code === "0") { | |||
| if (res.id !== ID) { | |||
| location.reload() | |||
| }else{ | |||
| $('#' + ID+'-icon').removeClass().addClass(res.status) | |||
| $('#' + ID+ '-text').text(res.status) | |||
| $('#ai-debug-'+ID).removeClass('blue').addClass('disabled') | |||
| $('#ai-delete-'+ID).removeClass('blue').addClass('disabled') | |||
| $('#ai-debug-'+ID).text(debug_button).css("margin","0 1rem") | |||
| } else { | |||
| $('#' + ID + '-icon').removeClass().addClass(res.status) | |||
| $('#' + ID + '-text').text(res.status) | |||
| $('#ai-debug-' + ID).removeClass('blue').addClass('disabled') | |||
| $('#ai-delete-' + ID).removeClass('blue').addClass('disabled') | |||
| $('#ai-debug-' + ID).text(debug_button).css("margin", "0 1rem") | |||
| } | |||
| }else{ | |||
| } else { | |||
| $('.alert').html(res.error_msg).removeClass('alert-success').addClass('alert-danger').show().delay(2000).fadeOut(); | |||
| } | |||
| }, | |||
| error :function(res){ | |||
| error: function (res) { | |||
| console.log(res) | |||
| } | |||
| }) | |||
| } | |||
| } | |||
| $('.ui.basic.ai_debug').click(function() { | |||
| $('.ui.basic.ai_debug').click(function () { | |||
| const ID = this.dataset.jobid | |||
| const repoPath = this.dataset.repopath | |||
| const redirect_to = this.dataset.linkpath | |||
| debugAgain(ID,repoPath,redirect_to) | |||
| debugAgain(ID, repoPath, redirect_to) | |||
| }) | |||
| } | |||
| @@ -165,12 +165,13 @@ export default async function initImage(){ | |||
| return false | |||
| }) | |||
| $('#cancel_submit_image').click(()=>{ | |||
| console.log(pageform) | |||
| if(link.includes('cloudbrain')){ | |||
| let repoLink = link.split('cloudbrain')[0] | |||
| location.href = `${window.config.AppSubUrl}${repoLink}debugjob?debugListType=all` | |||
| }else if(pageform=='imageSquare'){ | |||
| location.href = `${window.config.AppSubUrl}/explore/images?type=myimage` | |||
| }else if(pageform=='imageAdmin'){ | |||
| }else if(pageform){ | |||
| location.href = `${window.config.AppSubUrl}/admin/images` | |||
| } | |||
| }) | |||
| @@ -183,11 +183,11 @@ function initBranchSelector() { | |||
| }); | |||
| $selectBranch.find('.reference.column').on('click', function () { | |||
| $selectBranch.find('.scrolling.reference-list-menu').css('display', 'none'); | |||
| $selectBranch.find('.reference .text').removeClass('black'); | |||
| $selectBranch.find('.reference .text').addClass('black'); | |||
| $($(this).data('target')).css('display', 'block'); | |||
| $(this) | |||
| .find('.text') | |||
| .addClass('black'); | |||
| .find('.text.black') | |||
| .removeClass('black'); | |||
| return false; | |||
| }); | |||
| } | |||
| @@ -230,7 +230,7 @@ function initLabelEdit() { | |||
| }); | |||
| } | |||
| function updateIssuesMeta(url, action, issueIds, elementId, isAdd) { | |||
| function updateIssuesMeta(url, action, issueIds, elementId,isAdd) { | |||
| return new Promise((resolve) => { | |||
| $.ajax({ | |||
| type: 'POST', | |||
| @@ -240,13 +240,14 @@ function updateIssuesMeta(url, action, issueIds, elementId, isAdd) { | |||
| action, | |||
| issue_ids: issueIds, | |||
| id: elementId, | |||
| is_add: isAdd | |||
| is_add: isAdd, | |||
| }, | |||
| success: resolve | |||
| }); | |||
| }); | |||
| } | |||
| function initRepoStatusChecker() { | |||
| const migrating = $('#repo_migrating'); | |||
| $('#repo_migrating_failed').hide(); | |||
| @@ -486,12 +487,13 @@ function initCommentForm() { | |||
| const promises = []; | |||
| Object.keys(labels).forEach((elementId) => { | |||
| const label = labels[elementId]; | |||
| console.log("label:",label) | |||
| const promise = updateIssuesMeta( | |||
| label['update-url'], | |||
| label.action, | |||
| label['issue-id'], | |||
| elementId, | |||
| label['is-checked'] | |||
| label['is-checked'], | |||
| ); | |||
| promises.push(promise); | |||
| }); | |||
| @@ -531,7 +533,7 @@ function initCommentForm() { | |||
| '', | |||
| $listMenu.data('issue-id'), | |||
| $(this).data('id'), | |||
| $(this).data('is-checked') | |||
| $(this).data('is-checked'), | |||
| ); | |||
| $listMenu.data('action', 'update'); // Update to reload the page when we updated items | |||
| return false; | |||
| @@ -603,6 +605,7 @@ function initCommentForm() { | |||
| $listMenu.data('issue-id'), | |||
| '', | |||
| '' | |||
| ).then(reload); | |||
| } | |||
| @@ -636,10 +639,16 @@ function initCommentForm() { | |||
| initListSubmits('select-reviewers-modify', 'assignees'); | |||
| function selectItem(select_id, input_id) { | |||
| const $menu = $(`${select_id} .menu`); | |||
| let $menu; | |||
| if (select_id=='.select-branch'){ | |||
| $menu = $(`${select_id} .menu`).eq(1); | |||
| }else{ | |||
| $menu = $(`${select_id} .menu`); | |||
| } | |||
| const $list = $(`.ui${select_id}.list`); | |||
| const hasUpdateAction = $menu.data('action') === 'update'; | |||
| $menu.find('.item:not(.no-select)').on('click', function () { | |||
| $(this) | |||
| .parent() | |||
| @@ -650,12 +659,17 @@ function initCommentForm() { | |||
| $(this).addClass('selected active'); | |||
| if (hasUpdateAction) { | |||
| //let ref = '' | |||
| //if (select_id=='.select-branch'){ | |||
| // ref = $(this).data('name'); | |||
| // } | |||
| updateIssuesMeta( | |||
| $menu.data('update-url'), | |||
| '', | |||
| $menu.data('issue-id'), | |||
| $(this).data('id'), | |||
| $(this).data('is-checked') | |||
| $(this).data('is-checked'), | |||
| ).then(reload); | |||
| } | |||
| switch (input_id) { | |||
| @@ -708,6 +722,7 @@ function initCommentForm() { | |||
| // Milestone and assignee | |||
| selectItem('.select-milestone', '#milestone_id'); | |||
| selectItem('.select-assignee', '#assignee_id'); | |||
| selectItem('.select-branch', ''); | |||
| } | |||
| function initInstall() { | |||
| @@ -810,7 +825,7 @@ function initIssueComments() { | |||
| const issueId = $(this).data('issue-id'); | |||
| const id = $(this).data('id'); | |||
| const isChecked = $(this).data('is-checked'); | |||
| //const ref = $(this).data('name'); | |||
| event.preventDefault(); | |||
| updateIssuesMeta(url, '', issueId, id, isChecked).then(reload); | |||
| }); | |||
| @@ -2899,6 +2914,7 @@ $(document).ready(async () => { | |||
| }) | |||
| .get() | |||
| .join(); | |||
| console.log("this:",this) | |||
| const {url} = this.dataset; | |||
| if (elementId === '0' && url.substr(-9) === '/assignee') { | |||
| elementId = ''; | |||
| @@ -3700,6 +3716,37 @@ function initVueEditAbout() { | |||
| } | |||
| function initVueDataset() { | |||
| if($('#dataset_check').length){ | |||
| if(location.search.indexOf('recommend=true')!==-1){ | |||
| $('#dataset_check').checkbox('set checked') | |||
| }else{ | |||
| $('#dataset_check').checkbox('set unchecked') | |||
| } | |||
| $('#dataset_check').checkbox({ | |||
| onChecked: function() { | |||
| if(location.search){ | |||
| const params = new URLSearchParams(location.search) | |||
| if(params.has('recommend')){ | |||
| params.delete('recommend') | |||
| location.href = AppSubUrl + location.pathname + '?' + params.toString() + '&recommend=true' | |||
| }else{ | |||
| location.href = `${window.config.AppSubUrl}/admin/datasets${location.search}&recommend=true` | |||
| } | |||
| }else{ | |||
| location.href = `${window.config.AppSubUrl}/admin/datasets?recommend=true` | |||
| } | |||
| }, | |||
| onUnchecked: function() { | |||
| if(location.search=='?recommend=true'){ | |||
| location.href = AppSubUrl + location.pathname | |||
| }else{ | |||
| const params = new URLSearchParams(location.search) | |||
| params.delete('recommend') | |||
| location.href = AppSubUrl + location.pathname + '?' + params.toString() | |||
| } | |||
| }, | |||
| }) | |||
| } | |||
| $('.set_dataset').on('click', function(){ | |||
| const $this = $(this); | |||
| let link = $this.data('url') | |||
| @@ -3783,24 +3830,14 @@ function initVueDataset() { | |||
| if(document.getElementById('dataset-file-desc')){ | |||
| dataset_file_desc = document.getElementById('dataset-file-desc').value | |||
| } | |||
| // getEditInit(){ | |||
| // if($('#dataset-edit-value')){ | |||
| // $this = $('#dataset-edit-value') | |||
| // this.ruleForm.title = $this.data('edit-title') || '' | |||
| // this.ruleForm.description = $this.data('edit-description') || '' | |||
| // this.ruleForm.category = $this.data('edit-category') || '' | |||
| // this.ruleForm.task = $this.data('edit-task') || '' | |||
| // this.ruleForm.license = $this.data('edit-license') || '' | |||
| // this.ruleForm.id = $this.data('edit-id')|| '' | |||
| // } | |||
| // }, | |||
| new Vue({ | |||
| delimiters: ['${', '}'], | |||
| el, | |||
| data: { | |||
| suburl: AppSubUrl, | |||
| url:'', | |||
| checked:false, | |||
| clusterFlag:false, | |||
| type:0, | |||
| desc:'', | |||
| descfile:'', | |||
| @@ -3897,6 +3934,12 @@ function initVueDataset() { | |||
| this.getCurrentRepoDataset(this.repolink,this.cloudbrainType) | |||
| } | |||
| const params = new URLSearchParams(location.search) | |||
| if (params.has('recommend') && params.get('recommend')=='true'){ | |||
| this.checked = true | |||
| }else{ | |||
| this.checked = false | |||
| } | |||
| }, | |||
| created(){ | |||
| if(document.getElementById('postPath')){ | |||
| @@ -3937,6 +3980,30 @@ function initVueDataset() { | |||
| } | |||
| }, | |||
| handleCheckedChange(val){ | |||
| if(val){ | |||
| if(location.search){ | |||
| const params = new URLSearchParams(location.search) | |||
| if(params.has('recommend')){ | |||
| params.delete('recommend') | |||
| let search = params.toString() | |||
| location.href = `${AppSubUrl}/explore/datasets?${search}&recommend=${val}` | |||
| }else{ | |||
| location.href = `${AppSubUrl}/explore/datasets${location.search}&recommend=${val}` | |||
| } | |||
| }else{ | |||
| location.href = `${AppSubUrl}/explore/datasets?recommend=${val}` | |||
| } | |||
| }else{ | |||
| if(location.search=='?recommend=true'){ | |||
| location.href = AppSubUrl + location.pathname | |||
| }else{ | |||
| const params = new URLSearchParams(location.search) | |||
| params.delete('recommend') | |||
| location.href = AppSubUrl + location.pathname + '?' + params.toString() | |||
| } | |||
| } | |||
| }, | |||
| createDataset(formName){ | |||
| let _this = this | |||
| this.$refs[formName].validate((valid)=>{ | |||
| @@ -3976,7 +4043,8 @@ function initVueDataset() { | |||
| }, | |||
| gotoUpload(repolink,datsetId){ | |||
| location.href = `${AppSubUrl}${repolink}/datasets/attachments/upload?datasetId=${datsetId}` | |||
| // location.href = `${AppSubUrl}${repolink}/datasets/attachments/upload?datasetId=${datsetId}` | |||
| window.open(`${AppSubUrl}${repolink}/datasets/attachments/upload?datasetId=${datsetId}`,'_blank') | |||
| }, | |||
| gotoDataset(datsetUrl){ | |||
| location.href = datsetUrl | |||
| @@ -3984,6 +4052,9 @@ function initVueDataset() { | |||
| gotoAnnotate(repolink,uuid,type){ | |||
| location.href = `${AppSubUrl}${repolink}/datasets/label/${uuid}?type=${type}` | |||
| }, | |||
| setcluster(val){ | |||
| this.clusterFlag = val | |||
| }, | |||
| uploadGpu(){ | |||
| this.type=0 | |||
| }, | |||