Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.1.3
zouap 3 years ago
parent
commit
c117fd53ab
1 changed files with 8 additions and 82 deletions
  1. +8
    -82
      templates/repo/cloudbrain/benchmark/new.tmpl

+ 8
- 82
templates/repo/cloudbrain/benchmark/new.tmpl View File

@@ -152,13 +152,10 @@
<script> <script>
let url_href = window.location.pathname.split('create')[0] let url_href = window.location.pathname.split('create')[0]
$(".ui.button").attr('href',url_href) $(".ui.button").attr('href',url_href)
$('select.dropdown')
.dropdown();


$('.menu .item') $('.menu .item')
.tab(); .tab();


$('#benchmark_types_id').change(function(){ $('#benchmark_types_id').change(function(){
var html = "<option value=\"1\">无</option>" ; var html = "<option value=\"1\">无</option>" ;
if ($(this).val() == '2') { if ($(this).val() == '2') {
@@ -169,73 +166,17 @@
} }
document.getElementById("benchmark_child_types_id").innerHTML=html; document.getElementById("benchmark_child_types_id").innerHTML=html;
}) })

$('select.dropdown')
$('#benchmark_types_id')
.dropdown(); .dropdown();


$('.ui.form')
.form({
on: 'blur',
inline:true,
fields: {
boot_file: {
identifier : 'boot_file',
rules: [
{
type: 'regExp[/.+\.py$/g]',
prompt : '启动文件必须为.py结尾'
}
]
},
job_name:{
identifier : 'job_name',
rules: [
{
type: 'regExp[/^[a-zA-Z0-9-_]{1,36}$/]',
prompt : '只包含大小写字母、数字、_和-,最长36个字符。'
}
]
},
attachment:{
identifier : 'attachment',
rules: [
{
type: 'empty',
prompt : '选择一个数据集'
}
]

},
work_server_number: {
identifier : 'work_server_number',
rules: [
{
type : 'integer[1..25]',
prompt : '计算节点需要在1-25之间,请您键入正确的值'
}
]
}
},
})



function validate(){ function validate(){
$('.ui.form') $('.ui.form')
.form({ .form({
on: 'blur', on: 'blur',
inline:true, inline:true,
fields: { fields: {
boot_file: {
identifier : 'boot_file',
rules: [
{
type: 'regExp[/.+\.py$/g]',
prompt : '启动文件必须为.py结尾'
}
]
},
job_name:{ job_name:{
identifier : 'job_name', identifier : 'job_name',
rules: [ rules: [
@@ -245,24 +186,15 @@
} }
] ]
}, },
attachment:{
identifier : 'attachment',
image:{
identifier : 'image',
rules: [ rules: [
{ {
type: 'empty', type: 'empty',
prompt : '选择一个数据集'
prompt : '选择一个镜像'
} }
] ]


},
work_server_number: {
identifier : 'work_server_number',
rules: [
{
type : 'integer[1..25]',
prompt : '计算节点需要在1-25之间,请您键入正确的值'
}
]
} }
}, },
onSuccess: function(){ onSuccess: function(){
@@ -274,15 +206,9 @@
} }
}) })
} }
document.onreadystatechange = function() {
if (document.readyState === "complete") {
document.getElementById("mask").style.display = "none"
}
}


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

Loading…
Cancel
Save