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

reset ok

parent 0bca5597
/*!
* Bootstrap Responsive v2.3.2
*
* Copyright 2012 Twitter, Inc
* Copyright 2013 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
* Designed and built with all the love in the world by @mdo and @fat.
*/
.clearfix {
......
/*!
* Bootstrap v2.3.2
*
* Copyright 2012 Twitter, Inc
* Copyright 2013 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
* Designed and built with all the love in the world by @mdo and @fat.
*/
.clearfix {
......
......@@ -23,7 +23,7 @@
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
......@@ -69,7 +69,7 @@
</div>
</header>
<div class="container">
<div class="container">
<div class="row">
<div class="span6">
<div class="page-header">
......@@ -108,7 +108,6 @@
<div class="modal-footer">
<div class="btn-group">
<button id="refresh_workflow" class="btn status-panel"><i class="icon-refresh"></i> Refresh</button>
<button id="reset_component" class="btn status-panel"><i class="icon-remove"></i> Reset</button>
<button id="rerun_workflow" class="btn status-panel"><i class="icon-cog"></i> ReRun</button>
</div>
<button id="output_workflow" class="btn btn-success status-panel"><i class="icon-chevron-right icon-white"></i> Output</button>
......@@ -159,7 +158,7 @@
<script type='text/javascript'>
$(document).ready(function(){
/**
* Use the plugins
*/
......@@ -193,7 +192,6 @@
$("#refresh_workflow").click(function(){ $('#statusModalBody').wfstatus('reload'); });
$("#rerun_workflow").click(function(){ $('#statusModalBody').wfstatus('rerun'); });
$("#reset_component").click(function(){ $('#statusModalBody').wfstatus('reset'); });
$("#reset_workflow").click(function(){ $('#setAndRunModalBody').wfform('reset'); });
$("#back_workflow").click(function(){
$('#statusModalBody').wfstatus('reload');
......
This diff is collapsed.
......@@ -91,7 +91,7 @@
}
});
}
WFStatus.prototype._listview = function() {
if (this.options.forceUsingWorkflow) {
var workflow = this.reformatWorkflowJSON(this.options.forceUsingWorkflow);
......@@ -133,18 +133,20 @@
$.tmpl($this.options.headTemplate, {workflow: workflow}).appendTo($this.$element);
$.tmpl($this.options.listTemplate, {workflow: workflow}).appendTo($this.$element);
$this.errorMessage();
$("[id^=component_]").hover(function(){
$(this).addClass("component-hover");
});
$("[id^=component_]").mouseout(function(){
$(this).removeClass("component-hover");
});
$("[id^=component_]").click(function(){
$("[id^=component_]").each(function(){
$(this).removeClass("component-select");
});
$(this).addClass("component-select");
});
$('[id^=progress_component_]').hover(function(){
var rname = $(this).attr("id").split("progress_component_")[1],
cname = rname.replace(".", "\\.");
$("#reset_component_"+cname).children("div").css("left", $(this).width()-35);
$("#info_component_"+cname).children("div").css("left", $(this).width()-69);
$("#reset_component_"+cname).fadeIn(200);
$("#info_component_"+cname).fadeIn(200);
$("#reset_component_"+cname).bind("click", { component_name: rname, element: $this }, resetComponentHandler);
}, function(){
var cname = $(this).attr("id").split("progress_component_")[1].replace(".", "\\.");
$("#reset_component_"+cname).fadeOut(200);
$("#info_component_"+cname).fadeOut(200);
$("#reset_component_"+cname).unbind("click", resetComponentHandler);
});
}
});
}
......@@ -309,35 +311,30 @@
});
}
WFStatus.prototype.reset = function() {
var resetComponentHandler = function(event) { event.data.element.reset(event.data.component_name); }
WFStatus.prototype.reset = function(component_name) {
var $this = this,
params = "" ,
one_is_selected = false;
params = "";
if (this.options.workflowID) { params = "workflow_id=" + this.options.workflowID + "&"; }
$("[id^=component_]").each(function(){
if ($(this).hasClass("component-select")) {
params += 'component_name='+$(this).attr("id").split("component_")[1],+'&';
one_is_selected = true;
}
});
if (one_is_selected) {
$.ajax({
url: this.options.serverURL + '/reset_workflow_component?'+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.reload();
}
});
}
params += 'component_name='+component_name+'&';
$.ajax({
url: this.options.serverURL + '/reset_workflow_component?'+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.reload();
}
});
}
/* WFStatus PLUGIN DEFINITION
......@@ -380,15 +377,21 @@
'</dl>'].join('\n'),
listTemplate: ['<dl class="dl-horizontal">',
'{{each(index, component) workflow.components}}',
'<div id="component_${component.name}"><p><dt>${component.name}</dt>',
'<dt>${component.name}</dt>',
'<dd>',
'<div class="progress">',
'<div class="bar bar-success" style="width: ${component.completed}%;"></div>',
'<div class="bar bar-danger" style="width: ${component.failed}%;"></div>',
'<div class="bar" style="width: ${component.running}%;"></div>',
'<div class="bar bar-warning" style="width: ${component.waiting}%;"></div>',
'<div id="progress_component_${component.name}" class="progress">',
' <div class="bar bar-success" style="width: ${component.completed}%;"></div>',
' <div class="bar bar-danger" style="width: ${component.failed}%;"></div>',
' <div class="bar" style="width: ${component.running}%;"></div>',
' <div class="bar bar-warning" style="width: ${component.waiting}%;"></div>',
' <div id="reset_component_${component.name}" class="tooltip in" style="position:absolute; cursor: pointer; display: none;">',
' <div class="tooltip-inner" style="position:absolute; top:-6px"><i class="icon-remove icon-white"></i></div>',
' </div>',
// ' <div id="info_component_${component.name}" class="tooltip in" style="position:absolute; cursor: pointer; display: none;">',
// ' <div class="tooltip-inner" style="position:absolute; top:-6px"><i class="icon-info-sign icon-white"></i></div>',
// ' </div>',
'</div>',
'</dd></p></div>',
'</dd>',
'{{/each}}',
'</dl>'].join('\n'),
graphTemplate: ['<div id="cytoscape_panel" style="background-image:url(img/grid.png);*/',
......@@ -397,7 +400,7 @@
'</div>'].join('\n'),
workflowID: null,
forceUsingWorkflow: null,
display: "graph"
display: "list"
}
$.fn.wfstatus.Constructor = WFStatus
......
......@@ -24,58 +24,6 @@ position:relative;
width:16px;
height:20px}
.component-select, .component-hover {
background-color: #efefef;
border-bottom-color: #efefef;
border-left-color-ltr-source: physical;
border-left-color-rtl-source: physical;
border-left-color-value: #efefef;
border-right-color-ltr-source: physical;
border-right-color-rtl-source: physical;
border-right-color-value: #efefef;
border-top-color: #efefef;
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-style: solid;
border-bottom-width: 1px;
border-image-outset: 0 0 0 0;
border-image-repeat: stretch stretch;
border-image-slice: 100% 100% 100% 100%;
border-image-source: none;
border-image-width: 1 1 1 1;
border-left-color-ltr-source: physical;
border-left-color-rtl-source: physical;
border-left-style-ltr-source: physical;
border-left-style-rtl-source: physical;
border-left-style-value: solid;
border-left-width-ltr-source: physical;
border-left-width-rtl-source: physical;
border-left-width-value: 1px;
border-right-color-ltr-source: physical;
border-right-color-rtl-source: physical;
border-right-style-ltr-source: physical;
border-right-style-rtl-source: physical;
border-right-style-value: solid;
border-right-width-ltr-source: physical;
border-right-width-rtl-source: physical;
border-right-width-value: 1px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-top-style: solid;
border-top-width: 1px;
margin-bottom: 20px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.blockG{
position:absolute;
background-color:#FFFFFF;
......
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