Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/973 Reviewed-by: lewis <747342561@qq.com>tags/v1.21.12.1
| @@ -370,6 +370,7 @@ func trainJobNewDataPrepare(ctx *context.Context) error { | |||||
| ctx.Data["Branches"] = Branches | ctx.Data["Branches"] = Branches | ||||
| ctx.Data["BranchesCount"] = len(Branches) | ctx.Data["BranchesCount"] = len(Branches) | ||||
| ctx.Data["params"] = "" | ctx.Data["params"] = "" | ||||
| ctx.Data["BranchName"] = ctx.Repo.BranchName | |||||
| configList, err := getConfigList(modelarts.PerPage, 1, modelarts.SortByCreateTime, "desc", "", modelarts.ConfigTypeCustom) | configList, err := getConfigList(modelarts.PerPage, 1, modelarts.SortByCreateTime, "desc", "", modelarts.ConfigTypeCustom) | ||||
| if err != nil { | if err != nil { | ||||
| @@ -903,10 +904,11 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ | |||||
| // } | // } | ||||
| //todo: del the codeLocalPath | //todo: del the codeLocalPath | ||||
| _, err = ioutil.ReadDir(codeLocalPath) | |||||
| if err == nil { | |||||
| os.RemoveAll(codeLocalPath) | |||||
| } | |||||
| // _, err = ioutil.ReadDir(codeLocalPath) | |||||
| // if err == nil { | |||||
| // os.RemoveAll(codeLocalPath) | |||||
| // } | |||||
| os.RemoveAll(codeLocalPath) | |||||
| gitRepo, _ := git.OpenRepository(repo.RepoPath()) | gitRepo, _ := git.OpenRepository(repo.RepoPath()) | ||||
| commitID, _ := gitRepo.GetBranchCommitID(branch_name) | commitID, _ := gitRepo.GetBranchCommitID(branch_name) | ||||
| @@ -399,7 +399,7 @@ | |||||
| <form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post"> | <form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post"> | ||||
| {{$.CsrfTokenHtml}} | {{$.CsrfTokenHtml}} | ||||
| {{if $.Permission.CanWrite $.UnitTypeCloudBrain}} | {{if $.Permission.CanWrite $.UnitTypeCloudBrain}} | ||||
| <a id="model-delete-{{.JobID}}" class="ui basic blue button {{if not .CanDel}}disabled {{end}}" onclick="assertDelete(this)" style="border-radius: .28571429rem;"> | |||||
| <a id="model-delete-{{.JobID}}" class="ui basic button {{if not .CanDel}}disabled {{else}} blue {{end}}" onclick="assertDelete(this)" style="border-radius: .28571429rem;"> | |||||
| {{$.i18n.Tr "repo.delete"}} | {{$.i18n.Tr "repo.delete"}} | ||||
| </a> | </a> | ||||
| {{else}} | {{else}} | ||||
| @@ -352,7 +352,7 @@ | |||||
| <form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post"> | <form class="ui compact buttons" id="delForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/del" method="post"> | ||||
| {{$.CsrfTokenHtml}} | {{$.CsrfTokenHtml}} | ||||
| {{if $.Permission.CanWrite $.UnitTypeCloudBrain}} | {{if $.Permission.CanWrite $.UnitTypeCloudBrain}} | ||||
| <a id="model-delete-{{.JobID}}" class="ui basic blue button {{if eq .Status "RUNNING" "CREATING" "WAITING" "STARTING" "STOPPING" }}disabled {{end}}" onclick="assertDelete(this)" style="border-radius: .28571429rem;"> | |||||
| <a id="model-delete-{{.JobID}}" class="ui basic button {{if eq .Status "RUNNING" "CREATING" "WAITING" "STARTING" "STOPPING" }}disabled {{else}} blue {{end}}" onclick="assertDelete(this)" style="border-radius: .28571429rem;"> | |||||
| {{$.i18n.Tr "repo.delete"}} | {{$.i18n.Tr "repo.delete"}} | ||||
| </a> | </a> | ||||
| {{else}} | {{else}} | ||||
| @@ -177,10 +177,15 @@ | |||||
| <select class="ui dropdown width80 left2" id="code_version" name="branch_name"> | <select class="ui dropdown width80 left2" id="code_version" name="branch_name"> | ||||
| {{if .branch_name}} | {{if .branch_name}} | ||||
| <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | <option name="branch_name" value="{{.branch_name}}">{{.branch_name}}</option> | ||||
| {{range $k, $v :=.Branches}} | |||||
| {{ if ne $v $.branch_name }} | |||||
| <option name="branch_name" value="{{$v}}">{{$v}}</option> | |||||
| {{end}} | |||||
| {{end}} | |||||
| {{else}} | |||||
| <option name="branch_name" value="{{.BranchName}}">{{.BranchName}}</option> | |||||
| {{end}} | {{end}} | ||||
| {{range $k, $v :=.Branches}} | |||||
| <option name="branch_name" value="{{$v}}">{{$v}}</option> | |||||
| {{end}} | |||||
| </select> | </select> | ||||
| </div> | </div> | ||||
| @@ -289,7 +289,7 @@ footer .column{margin-bottom:0!important; padding-bottom:0!important;} | |||||
| .dropdown-menu { | .dropdown-menu { | ||||
| position: relative; | position: relative; | ||||
| display: inline-block; | display: inline-block; | ||||
| margin-top: 4px; | |||||
| } | } | ||||
| .hover_active{ | .hover_active{ | ||||
| @@ -305,8 +305,8 @@ display: block; | |||||
| -webkit-box-shadow: none !important; | -webkit-box-shadow: none !important; | ||||
| box-shadow: none !important; | box-shadow: none !important; | ||||
| border-radius: .28571429rem .28571429rem 0 0!important; | border-radius: .28571429rem .28571429rem 0 0!important; | ||||
| color: rgba(0,0,0,.95); | |||||
| border-top-width: 1px; | |||||
| color: rgba(0,0,0,.95) !important; | |||||
| border-top-width: 1px !important; | |||||
| } | } | ||||