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

no longer specific ajax request for errors

parent fe05b282
......@@ -138,6 +138,7 @@ class JFlowServer (object):
"aborted": status_info["aborted"],
"completed": status_info["completed"]})
status = {"id":utils.get_nb_string(workflow.id),
"errors": workflow.get_errors(),
"name": workflow.name,
"metadata": workflow.metadata,
"status": workflow.get_status(),
......@@ -321,11 +322,6 @@ class JFlowServer (object):
status.append(self.jsonify_workflow_status(workflow))
return status
@cherrypy.expose
@jsonify
def get_workflow_errors(self, **kwargs):
return self.wfmanager.get_workflow_errors(kwargs["workflow_id"])
def _webify_outputs(self, web_path, path):
work_dir = self.jflow_config_reader.get_work_directory()
socket_opt = self.jflow_config_reader.get_socket_options()
......
......@@ -66,32 +66,6 @@
return workflow;
}
WFStatus.prototype.errorMessage = function() {
var $this = this,
params = "" ;
if (this.options.workflowID) { params = "workflow_id=" + this.options.workflowID + "&"; }
$.ajax({
url: this.options.serverURL + '/get_workflow_errors?'+params+'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.$element.find("#wfstatus_error_panel").hide();
if( data != null ) {
$this.$element.find("#wfstatus_error_msg").html( data["msg"].join('<br/>') );
$this.$element.find("#wfstatus_error_location").text( data["location"] );
$this.$element.find("#wfstatus_error_panel").show();
}
}
});
}
WFStatus.prototype._listview = function() {
if (this.options.forceUsingWorkflow) {
var workflow = this.reformatWorkflowJSON(this.options.forceUsingWorkflow);
......@@ -132,7 +106,15 @@
$this.$element.html("");
$.tmpl($this.options.headTemplate, {workflow: workflow}).appendTo($this.$element);
$.tmpl($this.options.listTemplate, {workflow: workflow}).appendTo($this.$element);
$this.errorMessage();
// handle if there is some error
$this.$element.find("#wfstatus_error_panel").hide();
if( data.errors != null ) {
$this.$element.find("#wfstatus_error_msg").html( data.errors["msg"].join('<br/>') );
$this.$element.find("#wfstatus_error_location").text( data.errors["location"] );
$this.$element.find("#wfstatus_error_panel").show();
}
$('[id^=progress_component_]').hover(function(){
var rname = $(this).attr("id").split("progress_component_")[1],
cname = rname.replace(".", "\\.");
......@@ -210,6 +192,14 @@
edges.push({ data: { source: data.edges[i][0], target: data.edges[i][1] } });
}
}
// handle if there is some errors
$this.$element.find("#wfstatus_error_panel").hide();
if( data.errors != null ) {
$this.$element.find("#wfstatus_error_msg").html( data.errors["msg"].join('<br/>') );
$this.$element.find("#wfstatus_error_location").text( data.errors["location"] );
$this.$element.find("#wfstatus_error_panel").show();
}
$('#cytoscape_panel').cytoscape({
style: cytoscape.stylesheet()
......@@ -279,7 +269,6 @@
});
}
});
$this.errorMessage();
}
});
}
......
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