From d3249141c52ed154b7554dd8cf799cf7cb9f1f69 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Fri, 30 Nov 2018 12:17:43 -0500 Subject: [PATCH 1/3] Token handling for cancel, restart --- public/js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/main.js b/public/js/main.js index dabf1e2..ce69eb9 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -261,8 +261,8 @@ $(function() { }); }; } - Task.prototype.cancel = genApiCall("/task/cancel"); - Task.prototype.restart = genApiCall("/task/restart", function(task) { + Task.prototype.cancel = genApiCall("/task/cancel?token=" + token); + Task.prototype.restart = genApiCall("/task/restart?token=" + token, function(task) { task.resetOutput(); }); Task.prototype.download = function() { From d81932df33b2fb395cc9835c2d5d3dbdb83bde8d Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Fri, 30 Nov 2018 13:47:03 -0500 Subject: [PATCH 2/3] Better view console output UI --- public/index.html | 2 +- public/js/main.js | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/public/index.html b/public/index.html index 7f42848..e376470 100644 --- a/public/index.html +++ b/public/index.html @@ -112,7 +112,7 @@
Images:
Status:
Time Elapsed:
-
Output: ViewHide
+
Output: ViewHide | Download
diff --git a/public/js/main.js b/public/js/main.js index ce69eb9..eff09ec 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -164,23 +164,26 @@ $(function() { this.autoScrollOutput = true; this.output.removeAll(); }; + Task.prototype.downloadOutput = function(){ + var self = this; + var url = "/task/" + self.uuid + "/output"; + $.get(url, { line: -10, token: token }) + .done(function(output) { + var wnd = window.open("about:blank", "", "_blank"); + wnd.document.write(output.join("
")); + }) + .fail(function() { + self.info({ error: url + " is unreachable." }); + }); + }; Task.prototype.viewOutput = function() { var self = this; function fetchOutput() { - var url = "/task/" + self.uuid + "/output?token=" + token; - $.get(url, { line: self.viewOutputLine }) + var url = "/task/" + self.uuid + "/output"; + $.get(url, { line: -9, token: token }) .done(function(output) { - for (var i in output) { - self.output.push(output[i]); - } - if (output.length) { - self.viewOutputLine += output.length; - if (self.autoScrollOutput) { - var $console = $("#console_" + self.uuid); - $console.scrollTop($console[0].scrollHeight - $console.height()); - } - } + self.output(output); }) .fail(function() { self.info({ error: url + " is unreachable." }); From a54413525abf3291c3aadaf3af2c0a9eeef4d622 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Fri, 30 Nov 2018 13:52:59 -0500 Subject: [PATCH 3/3] Point docker builds to opendronemap/odm --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 44915ac..fbabfe8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM opendronemap/opendronemap:latest +FROM opendronemap/odm:latest MAINTAINER Piero Toffanin EXPOSE 3000