Commit 7977e039 authored by Penom Nom's avatar Penom Nom
Browse files

No commit message

No commit message
parent b1d217d4
......@@ -1210,64 +1210,67 @@ function addWorkflowsStatusOnRun() {
function addWorkflowsStatusOnSingleRun(){
var run_id = $("[id^=wfstatus_run_id_]").first().attr("id").split("_")[3];
if (run_id){
var serverURL = "http://localhost:8080";
if ($("#server_url").val()){ serverURL = $("#server_url").val(); }
$.ajax({
url: serverURL +'/get_workflows_status?metadata_filter=run_id='+run_id+'&callback=?',
dataType: "json",
success: function(data) {
var class_label = "";
for (var i in data) {
var myrun = data[i];
if (myrun["status"] == "completed"){
class_label = 'btn-success';
} else if (myrun["status"] == "failed"){
class_label = 'btn-danger';
} else if (myrun["status"] == "aborted"){
class_label = 'btn-danger';
} else if (myrun["status"] == "started"){
class_label = 'btn-info';
}
var $html = $('<button class="workflow-btn btn btn-default btn-sm '+class_label+'" style="padding: 2px;"><i class="glyphicon glyphicon-cog"></i></button>'),
myrun_id = "";
for (var j in myrun["metadata"]) {
if (myrun["metadata"][j].indexOf("run_id=") == 0) {
myrun_id = myrun["metadata"][j].split("=")[1];
$html.data('workflow', myrun);
if(myrun_id == run_id) {
$("#wfstatus_run_id_"+run_id).html($html);
}
}
}
}
$(".workflow-btn").on("click", function(event){
$('#setAndRunModalLabel').html($(this).data('workflow')["name"] + " <small>" + $(this).data('workflow')["id"] + "</small>");
$('#setAndRunModalBody').wfstatus({
workflowID: $(this).data('workflow').id,
forceUsingWorkflow: $(this).data('workflow'),
serverURL: $("#server_url").val()
});
$('#setAndRunModalFooter').html([
' <div class="btn-group">',
' <button id="refresh_workflow" class="btn btn-default"><i class="glyphicon glyphicon-refresh"></i> Refresh</button>',
' <button id="rerun_workflow" class="btn btn-primary"><i class="glyphicon glyphicon-cog"></i> Rerun</button>',
' </div>',
].join(''));
$("#reset_workflow, #run_workflow").hide();
unbindAll();
$("#refresh_workflow").click(function(){
$('#setAndRunModalBody').wfstatus('reload');
});
$("#rerun_workflow").bind('click', {'selector' : '#setAndRunModalBody' }, rerunWFHandler);
$('#setAndRunModal').modal();
});
}
});
if ($("[id^=wfstatus_run_id]").length > 0) {
var run_id = $("[id^=wfstatus_run_id]").first().attr("id").split("_")[3];
if (run_id){
var serverURL = "http://localhost:8080";
if ($("#server_url").val()){ serverURL = $("#server_url").val(); }
$.ajax({
url: serverURL +'/get_workflows_status?metadata_filter=run_id='+run_id+'&callback=?',
dataType: "json",
success: function(data) {
var class_label = "";
for (var i in data) {
var myrun = data[i];
if (myrun["status"] == "completed"){
class_label = 'btn-success';
} else if (myrun["status"] == "failed"){
class_label = 'btn-danger';
} else if (myrun["status"] == "aborted"){
class_label = 'btn-danger';
} else if (myrun["status"] == "started"){
class_label = 'btn-info';
}
var $html = $('<button class="workflow-btn btn btn-default btn-sm '+class_label+'" style="padding: 2px;"><i class="glyphicon glyphicon-cog"></i></button>'),
myrun_id = "";
for (var j in myrun["metadata"]) {
if (myrun["metadata"][j].indexOf("run_id=") == 0) {
myrun_id = myrun["metadata"][j].split("=")[1];
$html.data('workflow', myrun);
if(myrun_id == run_id) {
$("#wfstatus_run_id_"+run_id).html($html);
}
}
}
}
$(".workflow-btn").on("click", function(event){
$('#setAndRunModalLabel').html($(this).data('workflow')["name"] + " <small>" + $(this).data('workflow')["id"] + "</small>");
$('#setAndRunModalBody').wfstatus({
workflowID: $(this).data('workflow').id,
forceUsingWorkflow: $(this).data('workflow'),
serverURL: $("#server_url").val()
});
$('#setAndRunModalFooter').html([
' <div class="btn-group">',
' <button id="refresh_workflow" class="btn btn-default"><i class="glyphicon glyphicon-refresh"></i> Refresh</button>',
' <button id="rerun_workflow" class="btn btn-primary"><i class="glyphicon glyphicon-cog"></i> Rerun</button>',
' </div>',
].join(''));
$("#reset_workflow, #run_workflow").hide();
unbindAll();
$("#refresh_workflow").click(function(){
$('#setAndRunModalBody').wfstatus('reload');
});
$("#rerun_workflow").bind('click', {'selector' : '#setAndRunModalBody' }, rerunWFHandler);
$('#setAndRunModal').modal();
});
}
});
}
}
}
......
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