Browse Source

fix 992

tags/v1.21.12.1^2
lewis 4 years ago
parent
commit
2bbd2e3806
2 changed files with 8 additions and 4 deletions
  1. +6
    -2
      routers/repo/modelarts.go
  2. +2
    -2
      templates/repo/modelarts/trainjob/new.tmpl

+ 6
- 2
routers/repo/modelarts.go View File

@@ -364,13 +364,17 @@ func trainJobNewDataPrepare(ctx *context.Context) error {

Branches, err := ctx.Repo.GitRepo.GetBranches()
if err != nil {
log.Error("GetBranches failed:%v", err)
ctx.ServerError("GetBranches error:", err)
return err
}
ctx.Data["Branches"] = Branches
if Branches != nil {
ctx.Data["Branches"] = Branches
}

ctx.Data["BranchesCount"] = len(Branches)
ctx.Data["params"] = ""
ctx.Data["BranchName"] = ctx.Repo.BranchName
ctx.Data["branchName"] = ctx.Repo.BranchName

configList, err := getConfigList(modelarts.PerPage, 1, modelarts.SortByCreateTime, "desc", "", modelarts.ConfigTypeCustom)
if err != nil {


+ 2
- 2
templates/repo/modelarts/trainjob/new.tmpl View File

@@ -183,9 +183,9 @@
{{end}}
{{end}}
{{else}}
<option name="branch_name" value="{{.BranchName}}">{{.BranchName}}</option>
<option name="branch_name" value="{{.branchName}}">{{.branchName}}</option>
{{range $k, $v :=.Branches}}
{{ if ne $v $.BranchName }}
{{ if ne $v $.branchName }}
<option name="branch_name" value="{{$v}}">{{$v}}</option>
{{end}}
{{end}}


Loading…
Cancel
Save