Commit c9c10480 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

rerun handled from gui

parent 183049b7
......@@ -226,8 +226,7 @@ class JFlowServer (object):
@cherrypy.expose
@jsonify
def rerun_workflow(self, **kwargs):
self.wfmanager.rerun_workflow(kwargs["workflow_id"])
workflow = self.wfmanager.get_workflow(kwargs["workflow_id"])
workflow = self.wfmanager.rerun_workflow(kwargs["workflow_id"])
return self.jsonify_workflow_status(workflow)
@cherrypy.expose
......
......@@ -191,6 +191,7 @@
});
$("#refresh_workflow").click(function(){ $('#statusModalBody').wfstatus('reload'); });
$("#rerun_workflow").click(function(){ $('#statusModalBody').wfstatus('rerun'); });
$("#reset_workflow").click(function(){ $('#setAndRunModalBody').wfform('reset'); });
$("#back_workflow").click(function(){
$('#statusModalBody').wfstatus('reload');
......
......@@ -89,6 +89,7 @@ class WorkflowsManager(object):
if hasattr(workflow, "stderr"):
workflow.set_stderr()
workflow.start()
return workflow
def reset_workflow_component(self, workflow_id, component_name):
workflow = self.get_workflow(workflow_id)
......
......@@ -248,6 +248,25 @@
}
}
WFStatus.prototype.rerun = function() {
var $this = this;
$.ajax({
url: this.options.serverURL + '/rerun_workflow?workflow_id='+$this.options.workflowID+'&callback=?',
dataType: "json",
timeout: 20000,
error: function (xhr, ajaxOptions, thrownError) {
var alert_message = ['<div class="alert alert-error">',
'<strong>Error!</strong>',
'Jflow failed to connect to the specified server <strong>' + $this.options.serverURL + '</strong>',
'</div>'].join('\n');
$this.$element.html(alert_message);
},
success: function(data) {
$this.reload();
}
});
}
/* WFStatus PLUGIN DEFINITION
* ========================== */
......@@ -300,7 +319,7 @@
'</dl>'].join('\n'),
workflowID: null,
forceUsingWorkflow: null,
display: "graph"
display: "list"
}
$.fn.wfstatus.Constructor = WFStatus
......
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