Browse Source

Merge pull request '【云脑运维看板】翻到末页后无法跳转到其它页面 任务名、项目跳转链接不对' (#1566) from fix-1477 into V20220228

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/1566
Reviewed-by: lewis <747342561@qq.com>
tags/v1.22.2.2^2
lewis 3 years ago
parent
commit
ea372b94f3
5 changed files with 10 additions and 42 deletions
  1. +3
    -3
      routers/admin/cloudbrains.go
  2. +3
    -1
      templates/admin/cloudbrain/list.tmpl
  3. +0
    -34
      templates/repo/issue/new_form.tmpl
  4. +3
    -3
      templates/repo/issue/view_content/pull.tmpl
  5. +1
    -1
      web_src/js/index.js

+ 3
- 3
routers/admin/cloudbrains.go View File

@@ -21,7 +21,7 @@ import (
const (
tplCloudBrains base.TplName = "admin/cloudbrain/list"
EXCEL_DATE_FORMAT = "20060102150405"
CREATE_TIME_FORMAT = "2006/01/02 15:04:05.00"
CREATE_TIME_FORMAT = "2006/01/02 15:04:05"
)

func CloudBrains(ctx *context.Context) {
@@ -179,7 +179,7 @@ func DownloadCloudBrains(ctx *context.Context) {
}

func allValues(row int, rs *models.CloudbrainInfo, ctx *context.Context) map[string]string {
return map[string]string{getCellName("A", row): rs.JobName, getCellName("B", row): rs.Status, getCellName("C", row): rs.JobType, getCellName("D", row): time.Unix(int64(rs.Cloudbrain.CreatedUnix), 0).Format(CREATE_TIME_FORMAT), getCellName("E", row): getDurationTime(rs),
return map[string]string{getCellName("A", row): rs.JobName, getCellName("B", row): rs.JobType, getCellName("C", row): rs.Status, getCellName("D", row): time.Unix(int64(rs.Cloudbrain.CreatedUnix), 0).Format(CREATE_TIME_FORMAT), getCellName("E", row): getDurationTime(rs),
getCellName("F", row): rs.ComputeResource, getCellName("G", row): rs.Name, getCellName("H", row): getRepoPathName(rs), getCellName("I", row): rs.JobName,
}
}
@@ -216,7 +216,7 @@ func getTotalPage(total int64, pageSize int) int {

func allHeader(ctx *context.Context) map[string]string {

return map[string]string{"A1": ctx.Tr("repo.cloudbrain_task"), "B1": ctx.Tr("repo.modelarts.status"), "C1": ctx.Tr("repo.cloudbrain_task_type"), "D1": ctx.Tr("repo.modelarts.createtime"), "E1": ctx.Tr("repo.modelarts.train_job.dura_time"), "F1": ctx.Tr("repo.modelarts.computing_resources"), "G1": ctx.Tr("repo.cloudbrain_creator"), "H1": ctx.Tr("repo.repo_name"), "I1": ctx.Tr("repo.cloudbrain_task_name")}
return map[string]string{"A1": ctx.Tr("repo.cloudbrain_task"), "B1": ctx.Tr("repo.cloudbrain_task_type"), "C1": ctx.Tr("repo.modelarts.status"), "D1": ctx.Tr("repo.modelarts.createtime"), "E1": ctx.Tr("repo.modelarts.train_job.dura_time"), "F1": ctx.Tr("repo.modelarts.computing_resources"), "G1": ctx.Tr("repo.cloudbrain_creator"), "H1": ctx.Tr("repo.repo_name"), "I1": ctx.Tr("repo.cloudbrain_task_name")}

}



+ 3
- 1
templates/admin/cloudbrain/list.tmpl View File

@@ -60,12 +60,13 @@
</div>
</div>
{{range .Tasks}}
{{if .Repo}}
<div class="ui grid stackable item">
<div class="row">
<!-- 任务名 -->
<div class="two wide column nowrap">
{{if eq .JobType "DEBUG"}}
<a class="title" href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}/cloudbrain/{{.JobName}}" title="{{.JobName}}" style="font-size: 14px;">
<a class="title" href="{{AppSubUrl}}/{{.Repo.OwnerName}}/{{.Repo.Name}}{{if eq .ComputeResource "CPU/GPU"}}/cloudbrain/{{.JobName}}{{else}}/modelarts/notebook/{{.JobID}}{{end}}" title="{{.JobName}}" style="font-size: 14px;">
<span class="fitted" style="width: 90%;vertical-align: middle;">{{.JobName}}</span>
</a>
{{else if eq .JobType "INFERENCE"}}
@@ -163,6 +164,7 @@
</div>
</div>
{{end}}
{{end}}
<div id="app" style="margin-top: 2rem;">
<div class="center">
<el-pagination


+ 0
- 34
templates/repo/issue/new_form.tmpl View File

@@ -185,40 +185,6 @@
</div>
</div>
</form>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script>
<script>
// $(document).ready(function(){
// var reward_value = $('.ui.form').form('get value', 'dog')
// var reward_value = $('form').form('get value', 'dog')
// console.log(reward_value)
// alert(reward_value)
// $('.ui.green.button').click(function(){
// $('.ui.form')
// .form({
// // on: 'blur',
// inline: true,
// fields: {
// dog: {
// identifier: 'dog',
// rules: [
// {
// type: 'empty',
// prompt: '请您输入项目奖励'
// },
// {
// type : 'integer[0..100]',
// prompt : '项目奖励必须为整数,请您输入有效奖励金额'
// }
// ]
// }
// },
// onFailure: function(e){
// return false;
// }
// });
// });
// </script>
{{if .PageIsComparePull}}
<script>window.wipPrefixes = {{.PullRequestWorkInProgressPrefixes}}</script>
{{end}}

+ 3
- 3
templates/repo/issue/view_content/pull.tmpl View File

@@ -448,8 +448,8 @@
</div>
</div>

<script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script>
<script>
<!-- <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script> -->
<!-- <script>

$(document)
.ready(function() {
@@ -477,4 +477,4 @@
});
});
})
</script>
</script> -->

+ 1
- 1
web_src/js/index.js View File

@@ -3622,7 +3622,7 @@ function initVueApp() {
if (!window.location.search) {
window.location.href = this.localHref + '?page='+val
} else if (searchParams.has('page')) {
window.location.href = this.localHref.replace(/page=[0-9]/g,'page='+val)
window.location.href = this.localHref.replace(/page=[0-9]+/g,'page='+val)
} else {
window.location.href=location.href+'&page='+val
}


Loading…
Cancel
Save