Browse Source

Merge pull request 'fix-2626 显示同时点击两次创建按钮' (#2731) from fix-2626 into V20220830

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/2731
Reviewed-by: chenshihai <chenshh@pcl.ac.cn>
tags/v1.22.8.2^2
chenshihai 3 years ago
parent
commit
ca0d048bd3
9 changed files with 57 additions and 30 deletions
  1. +7
    -1
      templates/repo/cloudbrain/benchmark/new.tmpl
  2. +7
    -1
      templates/repo/cloudbrain/inference/new.tmpl
  3. +5
    -1
      templates/repo/cloudbrain/new.tmpl
  4. +7
    -1
      templates/repo/cloudbrain/trainjob/new.tmpl
  5. +7
    -3
      templates/repo/grampus/trainjob/gpu/new.tmpl
  6. +7
    -2
      templates/repo/grampus/trainjob/npu/new.tmpl
  7. +7
    -1
      templates/repo/modelarts/inferencejob/new.tmpl
  8. +3
    -5
      templates/repo/modelarts/notebook/new.tmpl
  9. +7
    -15
      templates/repo/modelarts/trainjob/new.tmpl

+ 7
- 1
templates/repo/cloudbrain/benchmark/new.tmpl View File

@@ -40,7 +40,7 @@
<input type="hidden" name="benchmarkMode" value="{{.benchmarkMode}}"> <input type="hidden" name="benchmarkMode" value="{{.benchmarkMode}}">


{{if eq .benchmarkMode "model"}} {{if eq .benchmarkMode "model"}}
<form class="ui form model_form" action="{{.Link}}?benchmarkMode=model" method="post">
<form id="form_id" class="ui form model_form" action="{{.Link}}?benchmarkMode=model" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<div class="required min_title inline field"> <div class="required min_title inline field">
@@ -251,6 +251,12 @@
{{template "base/footer" .}} {{template "base/footer" .}}


<script> <script>
let form = document.getElementById('form_id');
let createFlag = false
form.onsubmit = function (e) {
if(createFlag) return false
createFlag = true
}
let repolink = {{.RepoLink }} let repolink = {{.RepoLink }}
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)


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

@@ -47,7 +47,7 @@
</h4> </h4>
<div class="ui attached segment"> <div class="ui attached segment">
<!-- equal width --> <!-- equal width -->
<form class="ui form" action="{{.Link}}" method="post">
<form id="form_id" class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" id="ai_image_name" value="{{.image}}"> <input type="hidden" id="ai_image_name" value="{{.image}}">
@@ -262,6 +262,12 @@
{{template "base/footer" .}} {{template "base/footer" .}}


<script> <script>
let form = document.getElementById('form_id');
let createFlag = false
form.onsubmit = function (e) {
if(createFlag) return false
createFlag = true
}
const RepoLink = {{.RepoLink}} const RepoLink = {{.RepoLink}}
let nameMap,nameList let nameMap,nameList
// 获取模型列表和模型名称对应的模型版本 // 获取模型列表和模型名称对应的模型版本


+ 5
- 1
templates/repo/cloudbrain/new.tmpl View File

@@ -217,7 +217,9 @@
}) })
} }
validate(); validate();
let createFlag = false
form.onsubmit = function (e) { form.onsubmit = function (e) {
if(createFlag) return false
let value_task = $("input[name='display_job_name']").val() let value_task = $("input[name='display_job_name']").val()
let value_image = $("input[name='image']").val() let value_image = $("input[name='image']").val()
let value_data = $("input[name='attachment']").val() let value_data = $("input[name='attachment']").val()
@@ -231,6 +233,7 @@
} }
let min_value_task = value_task.toLowerCase() let min_value_task = value_task.toLowerCase()
$("input[name='display_job_name']").attr("value", min_value_task) $("input[name='display_job_name']").attr("value", min_value_task)
createFlag = true
document.getElementById("mask").style.display = "block" document.getElementById("mask").style.display = "block"
} }


@@ -276,13 +279,14 @@
} }
}) })
}) })
$('.ui.green.button').click(function () { $('.ui.green.button').click(function () {
if (!$('input[name="isBranches"]').val()) { if (!$('input[name="isBranches"]').val()) {
return false return false
} }
selected_value = $("#cloudbrain_benchmark_category").val() selected_value = $("#cloudbrain_benchmark_category").val()
$('#store_category').attr("value", selected_value) $('#store_category').attr("value", selected_value)
}) })


</script> </script>

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

@@ -75,7 +75,7 @@
</h4> </h4>
<div class="ui attached segment"> <div class="ui attached segment">
<!-- equal width --> <!-- equal width -->
<form class="ui form" action="{{.Link}}" method="post">
<form id="form_id" class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" id="ai_image_name" value="{{.image}}"> <input type="hidden" id="ai_image_name" value="{{.image}}">
@@ -269,6 +269,12 @@
{{template "base/footer" .}} {{template "base/footer" .}}


<script> <script>
let form = document.getElementById('form_id');
let createFlag = false
form.onsubmit = function (e) {
if(createFlag) return false
createFlag = true
}
$('select.dropdown') $('select.dropdown')
.dropdown(); .dropdown();




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

@@ -66,7 +66,7 @@
</h4> </h4>
<div class="ui attached segment"> <div class="ui attached segment">
<!-- equal width --> <!-- equal width -->
<form class="ui form" action="{{.Link}}" method="post">
<form id="form_id" class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" id="ai_engine_name" name="engine_name" value=""> <input type="hidden" id="ai_engine_name" name="engine_name" value="">
@@ -218,8 +218,12 @@
{{template "base/footer" .}} {{template "base/footer" .}}


<script> <script>
//let url_href = window.location.pathname.split('create')[0]
//$(".ui.button").attr('href',url_href)
let form = document.getElementById('form_id');
let createFlag = false
form.onsubmit = function (e) {
if(createFlag) return false
createFlag = true
}
$('select.dropdown') $('select.dropdown')
.dropdown(); .dropdown();




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

@@ -61,7 +61,7 @@
</h4> </h4>
<div class="ui attached segment"> <div class="ui attached segment">
<!-- equal width --> <!-- equal width -->
<form class="ui form" action="{{.Link}}" method="post">
<form id="form_id" class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" id="ai_engine_name" name="engine_name" value=""> <input type="hidden" id="ai_engine_name" name="engine_name" value="">
@@ -244,7 +244,12 @@
{{template "base/footer" .}} {{template "base/footer" .}}


<script> <script>
let form = document.getElementById('form_id');
let createFlag = false
form.onsubmit = function (e) {
if(createFlag) return false
createFlag = true
}
$('select.dropdown') $('select.dropdown')
.dropdown(); .dropdown();




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

@@ -46,7 +46,7 @@
</h4> </h4>
<div class="ui attached segment"> <div class="ui attached segment">
<!-- equal width --> <!-- equal width -->
<form class="ui form" action="{{.Link}}" method="post">
<form id="form_id" class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" id="ai_engine_name" name="engine_names" value=""> <input type="hidden" id="ai_engine_name" name="engine_names" value="">
@@ -295,6 +295,12 @@
{{template "base/footer" .}} {{template "base/footer" .}}


<script> <script>
let form = document.getElementById('form_id');
let createFlag = false
form.onsubmit = function (e) {
if(createFlag) return false
createFlag = true
}
const RepoLink = {{.RepoLink}} const RepoLink = {{.RepoLink}}
const url_href = window.location.pathname.split('create')[0] const url_href = window.location.pathname.split('create')[0]
let nameMap,nameList let nameMap,nameList


+ 3
- 5
templates/repo/modelarts/notebook/new.tmpl View File

@@ -123,11 +123,10 @@
}) })
} }
validate(); validate();
let createFlag = false
form.onsubmit = function(e){ form.onsubmit = function(e){
if(createFlag) return false
let value_task = $("input[name='display_job_name']").val() let value_task = $("input[name='display_job_name']").val()


let re = /^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/ let re = /^[a-z0-9][a-z0-9-_]{1,34}[a-z0-9-]$/
let flag = re.test(value_task) let flag = re.test(value_task)
if(!flag){ if(!flag){
@@ -136,11 +135,10 @@
$('#messageInfo p').text(str) $('#messageInfo p').text(str)
return false return false
} }

let min_value_task = value_task.toLowerCase() let min_value_task = value_task.toLowerCase()

$("input[name='display_job_name']").attr("value",min_value_task) $("input[name='display_job_name']").attr("value",min_value_task)
document.getElementById("mask").style.display = "block" document.getElementById("mask").style.display = "block"
createFlag = true


} }
// 点击按钮后遮罩层显示 // 点击按钮后遮罩层显示


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

@@ -69,7 +69,7 @@
</h4> </h4>
<div class="ui attached segment"> <div class="ui attached segment">
<!-- equal width --> <!-- equal width -->
<form class="ui form" action="{{.Link}}" method="post">
<form id="form_id" class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<input type="hidden" name="action" value="update"> <input type="hidden" name="action" value="update">
<input type="hidden" id="ai_engine_name" name="engine_names" value=""> <input type="hidden" id="ai_engine_name" name="engine_names" value="">
@@ -312,6 +312,12 @@
{{template "base/footer" .}} {{template "base/footer" .}}


<script> <script>
let form = document.getElementById('form_id');
let createFlag = false
form.onsubmit = function (e) {
if(createFlag) return false
createFlag = true
}
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') $('select.dropdown')
@@ -324,20 +330,6 @@
case 13:return false; case 13:return false;
} }
}); });
// let sever_num = $("#trainjob_work_server_num_select .text").text() //$('#trainjob_work_server_num')
// console.log("sever_num:",sever_num)
// $('.add').click(function(){
// sever_num.val(parseInt(sever_num.val())+1)
// if(sever_num.val()>=26){
// sever_num.val(parseInt(sever_num.val())-1)
// }
// })
// $('.min').click(function(){
// sever_num.val(parseInt(sever_num.val())-1)
// if(sever_num.val()<=0){
// sever_num.val(parseInt(sever_num.val())+1)
// }
// })
// 参数增加、删除、修改、保存 // 参数增加、删除、修改、保存
function Add_parameter(i) { function Add_parameter(i) {
value = '<div class="two fields width85" id= "para' + i + '">' + value = '<div class="two fields width85" id= "para' + i + '">' +


Loading…
Cancel
Save