| @@ -306,7 +306,7 @@ func GenerateTask(ctx *context.Context, displayJobName, jobName, image, command, | |||||
| if string(models.JobTypeBenchmark) == jobType { | if string(models.JobTypeBenchmark) == jobType { | ||||
| notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, stringId, displayJobName, models.ActionCreateBenchMarkTask) | notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, stringId, displayJobName, models.ActionCreateBenchMarkTask) | ||||
| } else if string(models.JobTypeTrain) == jobType { | } else if string(models.JobTypeTrain) == jobType { | ||||
| notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, stringId, displayJobName, models.ActionCreateGPUTrainTask) | |||||
| notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, jobID, displayJobName, models.ActionCreateGPUTrainTask) | |||||
| } else { | } else { | ||||
| notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, stringId, displayJobName, models.ActionCreateDebugGPUTask) | notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, stringId, displayJobName, models.ActionCreateDebugGPUTask) | ||||
| } | } | ||||
| @@ -2747,10 +2747,11 @@ reject_pull_request = `suggested changes for <a href="%s/pulls/%s">%s#%[2]s</a>` | |||||
| upload_dataset=`upload dataset <a href="%s/datasets?type=%s">%s</a>` | upload_dataset=`upload dataset <a href="%s/datasets?type=%s">%s</a>` | ||||
| task_gpudebugjob=`created CPU/GPU type debugging task<a href="%s/cloudbrain/%s">%s</a>` | task_gpudebugjob=`created CPU/GPU type debugging task<a href="%s/cloudbrain/%s">%s</a>` | ||||
| task_npudebugjob=`created NPU type debugging task <a href="%s/modelarts/notebook/%s">%s</a>` | task_npudebugjob=`created NPU type debugging task <a href="%s/modelarts/notebook/%s">%s</a>` | ||||
| task_trainjob=`created training task<a href="%s/modelarts/train-job/%s">%s</a>` | |||||
| task_nputrainjob=`created NPU training task<a href="%s/modelarts/train-job/%s">%s</a>` | |||||
| task_inferencejob=`created reasoning task <a href="%s/modelarts/inference-job/%s">%s</a>` | task_inferencejob=`created reasoning task <a href="%s/modelarts/inference-job/%s">%s</a>` | ||||
| task_benchmark=`created profiling task <a href="%s/cloudbrain/benchmark/%s">%s</a>` | task_benchmark=`created profiling task <a href="%s/cloudbrain/benchmark/%s">%s</a>` | ||||
| task_createmodel=`created new model <a href="%s/modelmanage/show_model_info?name=%s">%s</a>` | task_createmodel=`created new model <a href="%s/modelmanage/show_model_info?name=%s">%s</a>` | ||||
| task_gputrainjob=`created CPU/GPU training task<a href="%s/cloudbrain/train-job/%s">%s</a>` | |||||
| [tool] | [tool] | ||||
| ago = %s ago | ago = %s ago | ||||
| @@ -2755,7 +2755,7 @@ task_nputrainjob=`创建了NPU类型训练任务 <a href="%s/modelarts/train-job | |||||
| task_inferencejob=`创建了推理任务 <a href="%s/modelarts/inference-job/%s">%s</a>` | task_inferencejob=`创建了推理任务 <a href="%s/modelarts/inference-job/%s">%s</a>` | ||||
| task_benchmark=`创建了评测任务 <a href="%s/cloudbrain/benchmark/%s">%s</a>` | task_benchmark=`创建了评测任务 <a href="%s/cloudbrain/benchmark/%s">%s</a>` | ||||
| task_createmodel=`导入了新模型 <a href="%s/modelmanage/show_model_info?name=%s">%s</a>` | task_createmodel=`导入了新模型 <a href="%s/modelmanage/show_model_info?name=%s">%s</a>` | ||||
| task_gputrainjob=`创建了CPU/GPU类型训练任务 <a href="%s/modelarts/train-job/%s">%s</a>` | |||||
| task_gputrainjob=`创建了CPU/GPU类型训练任务 <a href="%s/cloudbrain/train-job/%s">%s</a>` | |||||
| [tool] | [tool] | ||||
| ago=%s前 | ago=%s前 | ||||
| @@ -175,6 +175,8 @@ function getTaskLink(record){ | |||||
| re = re + "/cloudbrain/benchmark/" + record.Content; | re = re + "/cloudbrain/benchmark/" + record.Content; | ||||
| }else if(record.OpType == 30){ | }else if(record.OpType == 30){ | ||||
| re = re + "/modelmanage/show_model_info?name=" + record.RefName; | re = re + "/modelmanage/show_model_info?name=" + record.RefName; | ||||
| }else if(record.OpType == 31){ | |||||
| re = re + "/cloudbrain/train-job/" + record.Content; | |||||
| } | } | ||||
| re = encodeURI(re); | re = encodeURI(re); | ||||
| return re; | return re; | ||||
| @@ -485,6 +485,9 @@ func TrainJobIndex(ctx *context.Context) { | |||||
| } | } | ||||
| listType := ctx.Query("listType") | listType := ctx.Query("listType") | ||||
| if len(listType) == 0 { | |||||
| listType = models.AllResource | |||||
| } | |||||
| ctx.Data["ListType"] = listType | ctx.Data["ListType"] = listType | ||||
| typeCloudBrain := models.TypeCloudBrainAll | typeCloudBrain := models.TypeCloudBrainAll | ||||
| @@ -531,6 +534,7 @@ func TrainJobIndex(ctx *context.Context) { | |||||
| pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5) | pager := context.NewPagination(int(count), setting.UI.IssuePagingNum, page, 5) | ||||
| pager.SetDefaultParams(ctx) | pager.SetDefaultParams(ctx) | ||||
| pager.AddParam(ctx, "listType", "ListType") | |||||
| ctx.Data["Page"] = pager | ctx.Data["Page"] = pager | ||||
| ctx.Data["PageIsCloudBrain"] = true | ctx.Data["PageIsCloudBrain"] = true | ||||
| @@ -1567,6 +1571,7 @@ func trainJobGetLog(jobID string) (*models.GetTrainJobLogFileNamesResult, *model | |||||
| func TrainJobDel(ctx *context.Context) { | func TrainJobDel(ctx *context.Context) { | ||||
| var jobID = ctx.Params(":jobid") | var jobID = ctx.Params(":jobid") | ||||
| var listType = ctx.Query("listType") | |||||
| repo := ctx.Repo.Repository | repo := ctx.Repo.Repository | ||||
| var jobTypes []string | var jobTypes []string | ||||
| @@ -1608,12 +1613,13 @@ func TrainJobDel(ctx *context.Context) { | |||||
| if ctx.IsUserSiteAdmin() && isAdminPage == "true" { | if ctx.IsUserSiteAdmin() && isAdminPage == "true" { | ||||
| ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") | ctx.Redirect(setting.AppSubURL + "/admin" + "/cloudbrains") | ||||
| } else { | } else { | ||||
| ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/train-job") | |||||
| ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/train-job?listType=" + listType) | |||||
| } | } | ||||
| } | } | ||||
| func TrainJobStop(ctx *context.Context) { | func TrainJobStop(ctx *context.Context) { | ||||
| var jobID = ctx.Params(":jobid") | var jobID = ctx.Params(":jobid") | ||||
| var listType = ctx.Query("listType") | |||||
| task := ctx.Cloudbrain | task := ctx.Cloudbrain | ||||
| _, err := modelarts.StopTrainJob(jobID, strconv.FormatInt(task.VersionID, 10)) | _, err := modelarts.StopTrainJob(jobID, strconv.FormatInt(task.VersionID, 10)) | ||||
| @@ -1623,7 +1629,7 @@ func TrainJobStop(ctx *context.Context) { | |||||
| return | return | ||||
| } | } | ||||
| ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/train-job") | |||||
| ctx.Redirect(setting.AppSubURL + ctx.Repo.RepoLink + "/modelarts/train-job?listType=" + listType) | |||||
| } | } | ||||
| func canUserCreateTrainJob(uid int64) (bool, error) { | func canUserCreateTrainJob(uid int64) (bool, error) { | ||||
| @@ -227,7 +227,7 @@ | |||||
| <button class="ui create_train_job green button"> | <button class="ui create_train_job green button"> | ||||
| {{.i18n.Tr "repo.cloudbrain.new"}} | {{.i18n.Tr "repo.cloudbrain.new"}} | ||||
| </button> | </button> | ||||
| <a class="ui button" href="/">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> | |||||
| <a class="ui button" href="{{.RepoLink}}/modelarts/train-job">{{.i18n.Tr "repo.cloudbrain.cancel"}}</a> | |||||
| </div> | </div> | ||||
| <!-- 模态框 --> | <!-- 模态框 --> | ||||
| @@ -239,8 +239,8 @@ | |||||
| {{template "base/footer" .}} | {{template "base/footer" .}} | ||||
| <script> | <script> | ||||
| let url_href = window.location.pathname.split('create')[0] | |||||
| $(".ui.button").attr('href',url_href) | |||||
| //let url_href = window.location.pathname.split('create')[0] | |||||
| //$(".ui.button").attr('href',url_href) | |||||
| $('select.dropdown') | $('select.dropdown') | ||||
| .dropdown(); | .dropdown(); | ||||
| @@ -165,6 +165,7 @@ | |||||
| </div> | </div> | ||||
| <!-- 删除任务 --> | <!-- 删除任务 --> | ||||
| <form class="ui compact buttons" id="delForm-{{.JobID}}" action='{{if eq .ComputeResource "NPU" }}{{$.Link}}/{{.JobID}}{{else}}{{$.RepoLink}}/cloudbrain/train-job/{{.JobID}}{{end}}/del' method="post"> | <form class="ui compact buttons" id="delForm-{{.JobID}}" action='{{if eq .ComputeResource "NPU" }}{{$.Link}}/{{.JobID}}{{else}}{{$.RepoLink}}/cloudbrain/train-job/{{.JobID}}{{end}}/del' method="post"> | ||||
| <input type="hidden" name="listType" value="{{$.ListType}}"> | |||||
| {{$.CsrfTokenHtml}} | {{$.CsrfTokenHtml}} | ||||
| {{if .CanDel}} | {{if .CanDel}} | ||||
| <a style="padding: 0.5rem 1rem;margin-left:0.2rem" id="ai-delete-{{.JobID}}" class="ui basic ai_delete blue button" style="border-radius: .28571429rem;"> | <a style="padding: 0.5rem 1rem;margin-left:0.2rem" id="ai-delete-{{.JobID}}" class="ui basic ai_delete blue button" style="border-radius: .28571429rem;"> | ||||
| @@ -85,7 +85,7 @@ | |||||
| {{else if eq .GetOpType 30}} | {{else if eq .GetOpType 30}} | ||||
| {{$.i18n.Tr "action.task_createmodel" .GetRepoLink .RefName .RefName | Str2html}} | {{$.i18n.Tr "action.task_createmodel" .GetRepoLink .RefName .RefName | Str2html}} | ||||
| {{else if eq .GetOpType 31}} | {{else if eq .GetOpType 31}} | ||||
| {{$.i18n.Tr "action.task_gputrainjob" .GetRepoLink .RefName .RefName | Str2html}} | |||||
| {{$.i18n.Tr "action.task_gputrainjob" .GetRepoLink .Content .RefName | Str2html}} | |||||
| {{end}} | {{end}} | ||||
| </p> | </p> | ||||
| {{if or (eq .GetOpType 5) (eq .GetOpType 18)}} | {{if or (eq .GetOpType 5) (eq .GetOpType 18)}} | ||||
| @@ -131,6 +131,8 @@ | |||||
| <span class="text grey"><i class="ri-vip-crown-line icon big"></i></span> | <span class="text grey"><i class="ri-vip-crown-line icon big"></i></span> | ||||
| {{else if eq .GetOpType 30}} | {{else if eq .GetOpType 30}} | ||||
| <span class="text grey"><i class="ri-picture-in-picture-exit-line icon big"></i></span> | <span class="text grey"><i class="ri-picture-in-picture-exit-line icon big"></i></span> | ||||
| {{else if eq .GetOpType 31}} | |||||
| <span class="text grey"><i class="ri-character-recognition-line icon big"></i></span> | |||||
| {{else}} | {{else}} | ||||
| <span class="text grey">{{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32}}</span> | <span class="text grey">{{svg (printf "octicon-%s" (ActionIcon .GetOpType)) 32}}</span> | ||||
| {{end}} | {{end}} | ||||