Commit 94fcf64a authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Merge branch 'master' of forgemia.inra.fr:genotoul-bioinfo/dgenies

parents 284ff122 b5c6bc51
......@@ -19,11 +19,6 @@ max_upload_size_ava = 1G
max_upload_file_size = 1G
[softwares]
minimap2 = ###DEFAULT###
minimap2_cluster = ###DEFAULT###
[debug]
# Debug (enable only for tests)
enable = False
......
......@@ -5,7 +5,7 @@ if [ ! $(which index.js) ] ; then
ERROR: minifier is not installed!
Install it through npm:
npm install minifier
npm install --prefix ~ minifier
Then, add it to the PATH:
export PATH=\$PATH:~/node_modules/minifier
......@@ -15,4 +15,4 @@ fi
cd src/dgenies/static/css
index.js -o dgenies.min.css dgenies.css
\ No newline at end of file
index.js -o dgenies.min.css dgenies.css
......@@ -7,7 +7,7 @@ if [ ! $(which babel.js) ] ; then
ERROR: babel is not installed!
Install it through npm:
npm install --save-dev babel-cli
npm install --prefix ~ --save-dev babel-cli
Then, add it to the PATH:
export PATH=\$PATH:~/node_modules/babel-cli/bin
......@@ -21,4 +21,4 @@ babel.js -o dgenies.min.js --compact --minified dgenies.js dgenies.prototypes.js
babel.js -o dgenies.result.min.js --compact --minified dgenies.result.js dgenies.result.controls.js dgenies.result.export.js dgenies.result.summary.js d3.boxplot.js d3.boxplot.events.js d3.boxplot.mousetip.js d3.boxplot.zoom.js
babel.js -o jquery.fileupload.min.js --compact --minified jquery.fileupload.js jquery.fileupload-process.js jquery.fileupload-validate.js
babel.js -o dgenies.run.min.js --compact --minified dgenies.run.js
babel.js -o dgenies.status.min.js --compact --minified dgenies.status.js
\ No newline at end of file
babel.js -o dgenies.status.min.js --compact --minified dgenies.status.js
......@@ -19,11 +19,6 @@ max_upload_size_ava = 1G
max_upload_file_size = 1G
[softwares]
minimap2 = ###DEFAULT###
minimap2_cluster = ###DEFAULT###
[debug]
# Debug (enable only for tests)
enable = False
......
......@@ -712,6 +712,10 @@ class JobManager:
self.align.set_path(self.__getting_local_file(self.align, "align"))
correct, error_set, should_be_local = self.check_file("align", should_be_local,
max_upload_size_readable)
elif self.__check_url(self.align):
files_to_download.append([self.align, "align"])
else:
return False, True, True
all_downloaded = True
if correct :
......
......@@ -458,6 +458,12 @@ dgenies.run.reset_other_tab = function(tab) {
$("input#queryidx").val("");
dgenies.run.files[4] = undefined;
}
else {
$("input#target").val("");
dgenies.run.files[0] = undefined;
$("input#query").val("");
dgenies.run.files[1] = undefined;
}
};
dgenies.run._start_upload = function(ftype, fname) {
......
......@@ -6,4 +6,4 @@ if($("input#id_job").val().length===0){$("label.id-job").addClass("error");dgeni
if(dgenies.mode==="webserver"){let email=$("input#email").val();let mail_re=/^.+@.+\..+$/;if(email.match(mail_re)===null){$("label.email").addClass("error");if(email==="")dgenies.run.add_error("Email is required!");else dgenies.run.add_error("Email is not correct!");has_errors=true}}let tab=$("#tabs .tab.active").attr("id");/* TAB 1 */if(tab==="tab1"){//Check input target:
if($("input#target").val().length===0){$("label.file-target").addClass("error");dgenies.run.add_error("Target fasta is required!");has_errors=true}//Check input query:
let tool=$("input[name=tool]:checked").val();if(!dgenies.run.tool_has_ava[tool]&&$("input#query").val().length===0){$("label.file-query").addClass("error");dgenies.run.add_error("Query fasta is required!");has_errors=true}}/* TAB 2 */else{if($("input#targetidx").val().length===0){$("label.file-targetidx").addClass("error");dgenies.run.add_error("Target file is required!");has_errors=true}if($("input#alignfile").val().length===0){$("label.file-align").addClass("error");dgenies.run.add_error("Alignment file is required!");has_errors=true}}// Returns
return!has_errors};dgenies.run.show_loading=function(fasta){$(".loading-file."+fasta).show()};dgenies.run.hide_loading=function(fasta){$(".loading-file."+fasta).hide()};dgenies.run.show_success=function(fasta){$(".upload-success."+fasta).show()};dgenies.run.hide_success=function(fasta){$(".upload-success."+fasta).hide()};dgenies.run.reset_errors=function(){$("label").removeClass("error");$("div.errors-submit ul.flashes").find("li").remove()};dgenies.run.ask_for_upload=function(){console.log("Ask for upload...");dgenies.post("/ask-upload",{"s_id":dgenies.run.s_id},function(data,status){if(data["success"]){let allow_upload=data["allowed"];if(allow_upload){$("div#uploading-loading").html("Uploading files...");dgenies.run.ping_interval=window.setInterval(dgenies.run.ping_upload,15000);dgenies.run.upload_next()}else{window.setTimeout(dgenies.run.ask_for_upload,15000)}}else{dgenies.notify("message"in data?data["message"]:"An error has occurred. Please contact the support","danger",3000)}},undefined,false)};dgenies.run.ping_upload=function(){dgenies.post("/ping-upload",{"s_id":dgenies.run.s_id},function(data,status){})};dgenies.run.check_url=function(url){return url.startsWith("http://")||url.startsWith("https://")||url.startsWith("ftp://")||url.startsWith("example://")};dgenies.run.reset_other_tab=function(tab){if(tab==="tab1"){$("input#alignfile").val("");dgenies.run.files[2]=undefined;$("input#targetidx").val("");dgenies.run.files[3]=undefined;$("input#queryidx").val("");dgenies.run.files[4]=undefined}};dgenies.run._start_upload=function(ftype,fname){let has_uploads=false;let fasta_type=parseInt($(`select.${ftype}`).val());let fasta_val=$(`input#${ftype}`).val();if(fasta_type===0&&fasta_val.length>0){$(`button#button-${ftype}`).hide();dgenies.run.show_loading(ftype);has_uploads=true}else{dgenies.run.files[0]=undefined;if(fasta_val!==""&&!dgenies.run.check_url(fasta_val)){dgenies.run.add_error(`${fname} file: invalid URL`,"error");dgenies.run.enable_form();return false}}return has_uploads};dgenies.run.start_uploads=function(){let has_uploads=false;let tab=$("#tabs .tab.active").attr("id");let inputs=[];if(tab==="tab1"){dgenies.run.reset_file_form("tab2");inputs=[["query","Query"],["target","Target"]]}else{dgenies.run.reset_file_form("tab1");inputs=[["queryidx","Query"],["targetidx","Target"],["alignfile","Alignment"]]}for(let i in inputs){let input=inputs[i];let test_has_uploads=dgenies.run._start_upload(input[0],input[1]);has_uploads=has_uploads||test_has_uploads}if(has_uploads){$("div#uploading-loading").html("Asking for upload...");dgenies.run.ask_for_upload()}else{dgenies.run.upload_next()}};dgenies.run.show_global_loading=function(){$("button#submit").hide();$("button#example").hide();$("div#uploading-loading").show()};dgenies.run.submit=function(){dgenies.run.reset_errors();if(dgenies.run.valid_form()){dgenies.run.disable_form();dgenies.run.show_global_loading();dgenies.run.start_uploads()}};
return!has_errors};dgenies.run.show_loading=function(fasta){$(".loading-file."+fasta).show()};dgenies.run.hide_loading=function(fasta){$(".loading-file."+fasta).hide()};dgenies.run.show_success=function(fasta){$(".upload-success."+fasta).show()};dgenies.run.hide_success=function(fasta){$(".upload-success."+fasta).hide()};dgenies.run.reset_errors=function(){$("label").removeClass("error");$("div.errors-submit ul.flashes").find("li").remove()};dgenies.run.ask_for_upload=function(){console.log("Ask for upload...");dgenies.post("/ask-upload",{"s_id":dgenies.run.s_id},function(data,status){if(data["success"]){let allow_upload=data["allowed"];if(allow_upload){$("div#uploading-loading").html("Uploading files...");dgenies.run.ping_interval=window.setInterval(dgenies.run.ping_upload,15000);dgenies.run.upload_next()}else{window.setTimeout(dgenies.run.ask_for_upload,15000)}}else{dgenies.notify("message"in data?data["message"]:"An error has occurred. Please contact the support","danger",3000)}},undefined,false)};dgenies.run.ping_upload=function(){dgenies.post("/ping-upload",{"s_id":dgenies.run.s_id},function(data,status){})};dgenies.run.check_url=function(url){return url.startsWith("http://")||url.startsWith("https://")||url.startsWith("ftp://")||url.startsWith("example://")};dgenies.run.reset_other_tab=function(tab){if(tab==="tab1"){$("input#alignfile").val("");dgenies.run.files[2]=undefined;$("input#targetidx").val("");dgenies.run.files[3]=undefined;$("input#queryidx").val("");dgenies.run.files[4]=undefined}else{$("input#target").val("");dgenies.run.files[0]=undefined;$("input#query").val("");dgenies.run.files[1]=undefined}};dgenies.run._start_upload=function(ftype,fname){let has_uploads=false;let fasta_type=parseInt($(`select.${ftype}`).val());let fasta_val=$(`input#${ftype}`).val();if(fasta_type===0&&fasta_val.length>0){$(`button#button-${ftype}`).hide();dgenies.run.show_loading(ftype);has_uploads=true}else{dgenies.run.files[0]=undefined;if(fasta_val!==""&&!dgenies.run.check_url(fasta_val)){dgenies.run.add_error(`${fname} file: invalid URL`,"error");dgenies.run.enable_form();return false}}return has_uploads};dgenies.run.start_uploads=function(){let has_uploads=false;let tab=$("#tabs .tab.active").attr("id");let inputs=[];if(tab==="tab1"){dgenies.run.reset_file_form("tab2");inputs=[["query","Query"],["target","Target"]]}else{dgenies.run.reset_file_form("tab1");inputs=[["queryidx","Query"],["targetidx","Target"],["alignfile","Alignment"]]}for(let i in inputs){let input=inputs[i];let test_has_uploads=dgenies.run._start_upload(input[0],input[1]);has_uploads=has_uploads||test_has_uploads}if(has_uploads){$("div#uploading-loading").html("Asking for upload...");dgenies.run.ask_for_upload()}else{dgenies.run.upload_next()}};dgenies.run.show_global_loading=function(){$("button#submit").hide();$("button#example").hide();$("div#uploading-loading").show()};dgenies.run.submit=function(){dgenies.run.reset_errors();if(dgenies.run.valid_form()){dgenies.run.disable_form();dgenies.run.show_global_loading();dgenies.run.start_uploads()}};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment