Browse Source

Merge pull request 'fix #1345 前端直接校验不合法的任务名称并给出提示' (#2555) from fix-1345 into V20220801

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/2555
Reviewed-by: zhoupzh <zhoupzh@pcl.ac.cn>
pull/2575/head
zhoupzh 2 years ago
parent
commit
bde13b946c
8 changed files with 52 additions and 9 deletions
  1. +2
    -2
      templates/repo/cloudbrain/inference/new.tmpl
  2. +21
    -0
      templates/repo/cloudbrain/new.tmpl
  3. +2
    -2
      templates/repo/cloudbrain/trainjob/new.tmpl
  4. +1
    -1
      templates/repo/grampus/trainjob/gpu/new.tmpl
  5. +1
    -1
      templates/repo/grampus/trainjob/npu/new.tmpl
  6. +2
    -2
      templates/repo/modelarts/inferencejob/new.tmpl
  7. +22
    -0
      templates/repo/modelarts/notebook/new.tmpl
  8. +1
    -1
      templates/repo/modelarts/trainjob/new.tmpl

+ 2
- 2
templates/repo/cloudbrain/inference/new.tmpl View File

@@ -421,7 +421,7 @@
identifier : 'display_job_name',
rules: [
{
type: 'regExp[/^[a-zA-Z0-9-_]{1,64}[^-]$/]',
type: 'regExp[/^[a-zA-Z0-9-_]{1,64}[a-zA-Z0-9_]$/]',
}
]
},
@@ -472,9 +472,9 @@
document.getElementById("mask").style.display = "none"
}
}
validate();
$('.ui.create_train_job.green.button').click(function(e) {
send_run_para()
get_name()
validate()
})
</script>

+ 21
- 0
templates/repo/cloudbrain/new.tmpl View File

@@ -294,6 +294,27 @@
context.value = ''
$(".icon.icons").css("visibility", "hidden")
}
function validate(){
$('.ui.form').form({
on: 'blur',
fields: {
display_job_name:{
identifier : 'display_job_name',
rules: [
{
type: 'regExp[/^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/]',
}
]
},
},
onSuccess: function(){
},
onFailure: function(e){
return false;
}
})
}
validate();
form.onsubmit = function (e) {
let value_task = $("input[name='display_job_name']").val()
let value_image = $("input[name='image']").val()


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

@@ -483,9 +483,9 @@
$("input#ai_flaver_name").val(name2)

}
validate();
$('.ui.create_train_job.green.button').click(function (e) {
get_name()
send_run_para()
validate()
send_run_para()
})
</script>

+ 1
- 1
templates/repo/grampus/trainjob/gpu/new.tmpl View File

@@ -433,9 +433,9 @@
$("input#ai_flavor_name").val(name2)

}
validate();
$('.ui.create_train_job.green.button').click(function(e) {
get_name()
send_run_para()
validate()
})
</script>

+ 1
- 1
templates/repo/grampus/trainjob/npu/new.tmpl View File

@@ -425,9 +425,9 @@
$("input#trainjob_work_server_num").val(val_server_num_select)

}
validate();
$('.ui.create_train_job.green.button').click(function(e) {
get_name()
send_run_para()
validate()
})
</script>

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

@@ -438,7 +438,7 @@
identifier : 'display_job_name',
rules: [
{
type: 'regExp[/^[a-zA-Z0-9-_]{1,64}[^-]$/]',
type: 'regExp[/^[a-zA-Z0-9-_]{1,64}[a-zA-Z0-9_]$/]',
}
]
},
@@ -489,9 +489,9 @@
document.getElementById("mask").style.display = "none"
}
}
validate();
$('.ui.create_train_job.green.button').click(function(e) {
send_run_para()
get_name()
validate()
})
</script>

+ 22
- 0
templates/repo/modelarts/notebook/new.tmpl View File

@@ -110,6 +110,28 @@

$('#messageInfo').css('display','none')

function validate(){
$('.ui.form').form({
on: 'blur',
fields: {
display_job_name:{
identifier : 'display_job_name',
rules: [
{
type: 'regExp[/^[a-z0-9][a-z0-9-_]{1,36}$/]',
}
]
},
},
onSuccess: function(){
},
onFailure: function(e){
return false;
}
})
}
validate();

form.onsubmit = function(e){
let value_task = $("input[name='display_job_name']").val()



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

@@ -500,9 +500,9 @@
$("input#trainjob_work_server_num").val(val_server_num_select)

}
validate();
$('.ui.create_train_job.green.button').click(function (e) {
get_name()
send_run_para()
validate()
})
</script>

Loading…
Cancel
Save