From b2169ba04db4369fffcaba2e49695bbb635bc81c Mon Sep 17 00:00:00 2001 From: zouap Date: Wed, 21 Sep 2022 17:41:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3#2916=20=E3=80=90=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E8=BD=AC=E6=8D=A2=E3=80=91=E6=A8=A1=E5=9E=8B=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=BA=E7=A9=BA=E6=97=B6=E5=BA=94=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=A8=A1=E5=9E=8B=E8=BD=AC=E6=8D=A2=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- options/locale/locale_en-US.ini | 1 + options/locale/locale_zh-CN.ini | 1 + templates/repo/modelmanage/convertIndex.tmpl | 11 +++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index faf9c7ced..81fc5cc06 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1301,6 +1301,7 @@ modelconvert.taskurlname=Model transformation task log_scroll_start=Scroll to top log_scroll_end=Scroll to bottom modelconvert.tasknameempty=Please enter a task name. +modelconvert.modelfileempty=Please choose a model file. modelconvert.inputshapeerror=Format input error, please input such as: 1,1,32,32, corresponding to the input data format. modelconvert.manage.create_error1=A model transformation task with the same name already exists. diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index e00b69e0e..f8bbb5ca9 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -1317,6 +1317,7 @@ log_scroll_start=滚动到顶部 log_scroll_end=滚动到底部 modelconvert.tasknameempty=请输入任务名称。 modelconvert.inputshapeerror=格式输入错误,请输入如:1,1,32,32,与输入数据格式对应。 +modelconvert.modelfileempty=请选择模型文件。 modelconvert.manage.create_error1=相同的名称模型转换任务已经存在。 modelconvert.manage.create_error2=只能创建一个正在运行的模型转换任务。 diff --git a/templates/repo/modelmanage/convertIndex.tmpl b/templates/repo/modelmanage/convertIndex.tmpl index 2f5ee6c35..3c4ac7f69 100644 --- a/templates/repo/modelmanage/convertIndex.tmpl +++ b/templates/repo/modelmanage/convertIndex.tmpl @@ -241,7 +241,7 @@ -
+
@@ -382,7 +382,14 @@ data['DestFormat'] = $('#DestFormat').val(); data['NetOutputFormat']= $('#NetOutputFormat').val(); data['ModelFile'] = $('#ModelFile').val(); - + if(data['ModelFile']==""){ + $('.ui.error.message').text("{{.i18n.Tr "repo.modelconvert.modelfileempty"}}") + $('.ui.error.message').css('display','block') + $("#ModelFile_Div").addClass("error") + return false + }else{ + $("#ModelFile_Div").removeClass("error") + } $.post(`${repolink}/modelmanage/create_model_convert`,data,(result) => { console.log("result=" + result); if(result.result_code ==0){