Browse Source

stop job

tags/v1.21.12.1
lewis 4 years ago
parent
commit
3cc8ed479d
2 changed files with 5 additions and 5 deletions
  1. +2
    -2
      modules/modelarts/resty.go
  2. +3
    -3
      templates/repo/modelarts/trainjob/index.tmpl

+ 2
- 2
modules/modelarts/resty.go View File

@@ -626,7 +626,7 @@ sendjob:
return &result, fmt.Errorf("json.Unmarshal failed(%s): %v", res.String(), err.Error())
}
log.Error("DelTrainJob failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg)
return &result, fmt.Errorf("DelTrainJob failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg)
return &result, fmt.Errorf("删除训练作业失败(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg)
}

if !result.IsSuccess {
@@ -667,7 +667,7 @@ sendjob:
return &result, fmt.Errorf("json.Unmarshal failed(%s): %v", res.String(), err.Error())
}
log.Error("StopTrainJob failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg)
return &result, fmt.Errorf("StopTrainJob failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg)
return &result, fmt.Errorf("停止训练作业失败(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg)
}

if !result.IsSuccess {


+ 3
- 3
templates/repo/modelarts/trainjob/index.tmpl View File

@@ -57,7 +57,7 @@
{{template "repo/header" .}}
<div class="ui container">
{{template "base/alert" .}}
<div class="ui grid">
{{template "repo/modelarts/navbar" .}}
<!-- 右侧 -->
@@ -126,9 +126,9 @@
<!-- 停止 -->
<div class="two wide column">
<div class="ui text center clipboard">
<form id="stopForm-{{.JobID}}" action="{{$.Link}}/{{.JobID}}/stop" method="post">
<form id="stopForm-{{.JobID}}" action="{{if ne .Status "RUNNING"}}javascript:void(0){{else}}{{$.Link}}/{{.JobID}}/stop{{end}}" method="post">
{{$.CsrfTokenHtml}}
<a class="fitted" onclick="document.getElementById('stopForm-{{.JobID}}').submit();" style="font-size:16px; font-weight:bold">停止</a>
<a class="fitted" onclick="document.getElementById('stopForm-{{.JobID}}').submit();" style="{{if ne .Status "RUNNING"}}color:#CCCCCC{{end}};font-size:16px; font-weight:bold">停止</a>
</form>
</div>
</div>


Loading…
Cancel
Save