diff --git a/src/main/java/com/metaweb/gridworks/commands/util/CancelProcessesCommand.java b/src/main/java/com/metaweb/gridworks/commands/util/CancelProcessesCommand.java index 1f0417211..203ff7903 100644 --- a/src/main/java/com/metaweb/gridworks/commands/util/CancelProcessesCommand.java +++ b/src/main/java/com/metaweb/gridworks/commands/util/CancelProcessesCommand.java @@ -12,7 +12,7 @@ import com.metaweb.gridworks.model.Project; public class CancelProcessesCommand extends Command { @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) + public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { diff --git a/src/main/java/com/metaweb/gridworks/operations/ReconOperation.java b/src/main/java/com/metaweb/gridworks/operations/ReconOperation.java index 15717266a..4b10588c0 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ReconOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ReconOperation.java @@ -214,22 +214,24 @@ public class ReconOperation extends EngineDependentOperation { } } - Change reconChange = new ReconChange( - cellChanges, - _columnName, - _reconConfig, - null - ); - - HistoryEntry historyEntry = new HistoryEntry( - _project, - _description, - ReconOperation.this, - reconChange - ); - - _project.history.addEntry(historyEntry); - _project.processManager.onDoneProcess(this); + if (!_canceled) { + Change reconChange = new ReconChange( + cellChanges, + _columnName, + _reconConfig, + null + ); + + HistoryEntry historyEntry = new HistoryEntry( + _project, + _description, + ReconOperation.this, + reconChange + ); + + _project.history.addEntry(historyEntry); + _project.processManager.onDoneProcess(this); + } } } } diff --git a/src/main/webapp/scripts/project/process-widget.js b/src/main/webapp/scripts/project/process-widget.js index e48d34bfb..84ec574c8 100644 --- a/src/main/webapp/scripts/project/process-widget.js +++ b/src/main/webapp/scripts/project/process-widget.js @@ -33,6 +33,15 @@ ProcessWidget.prototype.update = function(updateOptions, onDone) { ); }; +ProcessWidget.prototype._cancelAll = function() { + $.post( + "/command/cancel-processes?" + $.param({ project: theProject.id }), + null, + function(o) {}, + "json" + ); +}; + ProcessWidget.prototype._render = function() { var self = this; @@ -43,14 +52,23 @@ ProcessWidget.prototype._render = function() { } else { this._div.show(); - var bodyDiv = $('
').addClass("process-panel-inner").appendTo(this._div); - $('') - .css("float", "right") - .css("margin-left", "10px") - .css("margin-bottom", "10px") - .css("opacity", "0.3") - .appendTo(bodyDiv); + var innerDiv = $('').addClass("process-panel-inner").appendTo(this._div); + var headDiv = $('').addClass("process-panel-head").appendTo(innerDiv); + $('') + .css("margin-right", "3px") + .css("opacity", "0.3") + .appendTo(headDiv); + $('') + .addClass("action") + .text("cancel all") + .click(function() { + self._cancelAll(); + $(this).text("canceling all processes...").unbind(); + }) + .appendTo(headDiv); + + var bodyDiv = $('').addClass("process-panel-body").appendTo(innerDiv); var renderProcess = function(process) { var div = $('').addClass("process-panel-entry").appendTo(bodyDiv); diff --git a/src/main/webapp/styles/process.css b/src/main/webapp/styles/process.css index 42700e196..ec6a9cc76 100644 --- a/src/main/webapp/styles/process.css +++ b/src/main/webapp/styles/process.css @@ -9,10 +9,17 @@ border: 1px solid #ccc; width: 500px; max-height: 70px; - overflow: auto; - padding: 10px; margin: 0 auto; text-align: left; background: #fffee0; } +.process-panel-head { + padding: 2px 10px; + border-bottom: 1px solid #ccc; +} + +.process-panel-body { + overflow: auto; + padding: 10px; +} \ No newline at end of file