Commit 02bf0b3e authored by Penom Nom's avatar Penom Nom
Browse files

No commit message

No commit message
parent 62270a8c
......@@ -145,43 +145,43 @@ $(function () {
}
});
/**
*
* @param workflow_id
* @param callback
* @returns
*/
function get_worflow_status(workflow_id, callback){
$.ajax({
url : $("#server_url").val() + '/get_workflow_status?display=list&workflow_id=' + workflow_id,
dataType : 'jsonp',
success : function(data){
if (callback){
callback(data);
}
}
})
}
/**
*
* @param workflow_id
* @param callback
* @returns
*/
function get_workflow_outputs(workflow_id, callback){
$.ajax({
url : $("#server_url").val() + '/get_workflow_outputs?workflow_id=' + workflow_id,
dataType : 'jsonp',
success : function(data){
if (callback){
callback(data);
}
}
})
}
/**
*
* @param workflow_id
* @param callback
* @returns
*/
function get_workflow_status(serverurl, workflow_id, callback){
$.ajax({
url : serverurl + '/get_workflow_status?display=list&workflow_id=' + workflow_id,
dataType : 'jsonp',
success : function(data){
if (callback){
callback(data);
}
}
})
}
/**
*
* @param workflow_id
* @param callback
* @returns
*/
function get_workflow_outputs(serverurl, workflow_id, callback){
$.ajax({
url : serverurl + '/get_workflow_outputs?workflow_id=' + workflow_id,
dataType : 'jsonp',
success : function(data){
if (callback){
callback(data);
}
}
})
}
$("#download_btn").click(function(){
$('#myModalLabel').html("Loading");
$('#myModalFooter').html([
......@@ -229,9 +229,9 @@ $(function () {
displayResetButton: false,
parameters : {
"login" : $("#user_login").val(),
"data_id" : data_ids.join('::-::'),
"run_id" : run_ids.join('::-::'),
"analysis_id" : analysis_ids.join('::-::'),
"data_id" : data_ids,
"run_id" : run_ids,
"analysis_id" : analysis_ids,
},
textTemplate : [
'<div>',
......@@ -249,6 +249,19 @@ $(function () {
serverURL: $("#server_url").val()
});
var download_archive = function(outdata){
var targz = false;
$.each(outdata, function(i, component) {
$.each(component, function(i, file) {
if (file.extension == '.gz'){
$("#myModal").modal('hide');
location.href = file.url;
return;
}
});
});
};
$('#myModalBody').on('run.wfform', function(event, running_wf) {
$("#reset_workflow, #run_workflow").hide();
$("#close").show();
......@@ -257,20 +270,7 @@ $(function () {
var callback = function(wfdata){
if (wfdata.status == "completed"){
var processout = function(outdata){
var targz = false;
$.each(outdata, function(i, component) {
$.each(component, function(i, file) {
if (file.extension == '.gz'){
$("#myModal").modal('hide');
location.href = file.url;
return;
}
});
});
};
get_workflow_outputs(wfdata.id, processout);
get_workflow_outputs($("#server_url").val(), wfdata.id, download_archive);
$('#myModalLabel').html("Success");
$("#myModalBody").html( [
......@@ -287,11 +287,12 @@ $(function () {
})
}
else{
setTimeout(function(){get_worflow_status(running_wf.id, callback)}, 3000) ;
setTimeout(function(){
get_workflow_status($("#server_url").val(), running_wf.id, callback)
}, 3000) ;
}
};
get_worflow_status(running_wf.id, callback);
get_workflow_status($("#server_url").val(), running_wf.id, callback);
});
$("#reset_workflow").click(function(){
......
Supports Markdown
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