Browse Source

Merge branch 'V20220801' into fix-2454

tags/v1.22.7.2^2
zhoupzh 3 years ago
parent
commit
aa1e091d81
2 changed files with 23 additions and 27 deletions
  1. +10
    -0
      templates/repo/grampus/trainjob/gpu/new.tmpl
  2. +13
    -27
      web_src/js/components/MinioUploader.vue

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

@@ -80,6 +80,8 @@
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="update">
<input type="hidden" id="ai_engine_name" name="engine_name" value="">
<input type="hidden" id="ai_flavor_name" name="flavor_name" value="">
<input type="hidden" id="ai_image_name" value="{{.image}}">
<input type="hidden" id="fail_dataset_name" value="{{$.dataset_name}}">
<input type="hidden" id="fail_dataset_uuid" value="{{$.attachment}}">
@@ -360,8 +362,16 @@
msg = JSON.stringify(msg)
$('#store_run_para').val(msg)
}
function get_name(){
let name1=$("#engine_name .text").text()
let name2=$("#flavor_name .text").text()
$("input#ai_engine_name").val(name1)
$("input#ai_flavor_name").val(name2)

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

+ 13
- 27
web_src/js/components/MinioUploader.vue View File

@@ -135,10 +135,10 @@ export default {
allUploadLength(len){
if(len===this.uploadFiles.length){
setTimeout(() => {
this.dropzoneUploader.removeAllFiles(true)
this.btnFlag = false
this.$emit('setcluster',this.btnFlag)
}, 2000);
this.dropzoneUploader.removeAllFiles(true)
this.btnFlag = false
this.$emit('setcluster',this.btnFlag)
}, 2000);
}
}
},
@@ -254,7 +254,7 @@ export default {
(currentChunk / chunks) *
100
).toFixed(2)}% (${currentChunk}/${chunks})`;
// this.updateProgress(file, ((currentChunk / chunks) * 100).toFixed(2));
this.updateProgress(file, ((currentChunk / chunks) * 100).toFixed(2));
loadMd5Next();
return;
}
@@ -265,7 +265,7 @@ export default {
file.size
} 用时:${(new Date().getTime() - time) / 1000} s`
);
// this.updateProgress(file,100)
this.updateProgress(file,100)
spark.destroy(); // 释放缓存
file.uniqueIdentifier = md5; // 将文件md5赋值给文件唯一标识
file.cmd5 = false; // 取消计算md5状态
@@ -297,11 +297,11 @@ export default {
file.chunks = '';
this.multipartUpload(file);
} else {
// 失败如何处理
let info = "上传失败"
this.allUploadLength++
this.uploadError(file,info)
this.allUploadFiles.push({name:file.name,status:2,info:info})
// 失败如何处理
let info = "上传失败"
this.allUploadLength++
this.uploadError(file,info)
this.allUploadFiles.push({name:file.name,status:2,info:info})
return;
}
return;
@@ -321,16 +321,12 @@ export default {
this.uploadError(file,info)
this.allUploadLength++
this.allUploadFiles.push({name:file.name,status:1,info:info})
return;
}
}
}
console.log('文件已上传完成');
this.allUploadLength++
this.allUploadFiles.push({name:file.name,status:0,info:'上传成功'})
this.updateProgress(file, 100);
this.progress = 100;
this.status = this.dropzoneParams.data('upload-complete');
this.finishUpload(file);
// this.finishUpload(file);
} else {
// 断点续传
this.multipartUpload(file);
@@ -338,10 +334,6 @@ export default {
} catch (error) {
this.emitDropzoneFailed(file);
console.log(error);
let info = "上传失败"
this.allUploadLength++
this.uploadError(file,info)
this.allUploadFiles.push({name:file.name,status:2,info:info})
}

async function addAttachment(file) {
@@ -511,7 +503,6 @@ export default {
console.log(error);
//this.emitDropzoneFailed(file);
//console.log(error);
throw error;
}
}

@@ -547,11 +538,6 @@ export default {
await uploadChunk(e);
}catch(err){
console.log(err)
let info = "上传失败"
this.allUploadLength++
this.uploadError(file,info)
this.allUploadFiles.push({name:file.name,status:2,info:info});
return;
}
fileReader.abort();


Loading…
Cancel
Save