Commit 27718353 authored by Mikaël Salson's avatar Mikaël Salson Committed by Vidjil Team

database.js, clone.js: Use a get_read method in database.js

This method now uses the callProcess function which regularly checks for the end of the process

Fix #1469
parent 94c9f360
......@@ -1213,10 +1213,7 @@ Clone.prototype = {
}
if ($('#debug_menu').is(':visible') && (typeof this.m.db_key.config != 'undefined' )) {
html += "<br/>"
call_reads = "db.call('default/run_request', { "
call_reads += "'sequence_file_id': '" + this.m.samples.db_key[this.m.samples.order[j]] + "', "
call_reads += "'config_id' : '" + this.m.db_key.config + "', "
call_reads += "'grep_reads' : '" + this.id + "' })"
call_reads = "db.get_read('" + this.id + "', "+ this.m.samples.sequence_file_id[this.m.samples.order[j]] + ')';
console.log(call_reads)
html += "<span class='button' onclick=\"" + call_reads + "\"> get reads </span>"
}
......
......@@ -125,6 +125,18 @@ Database.prototype = {
report.reportcontamination()
})
},
get_read: function(window, sequence_file_id) {
var self = this;
self.callProcess('default/run_request',
{'sequence_file_id': sequence_file_id,
'sample_set_id': self.m.sample_set_id,
'config_id': self.m.db_key.config,
'grep_reads': window},
function(a) {
openAndFillNewTab("Your reads are ready. <a href='"+DB_ADDRESS+"/results_file/download?filename=seq/clone.fa-1&results_file_id="+a.result_id+"'>Download them</a>");
});
},
/**
* request a side process to the server
......
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