Merge pull request #55 from pierotofy/ui-improvements

Ui improvements
pull/56/head
Piero Toffanin 2018-11-30 14:08:30 -05:00 zatwierdzone przez GitHub
commit 0687dda8c5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 19 dodań i 16 usunięć

Wyświetl plik

@ -1,4 +1,4 @@
FROM opendronemap/opendronemap:latest
FROM opendronemap/odm:latest
MAINTAINER Piero Toffanin <pt@masseranolabs.com>
EXPOSE 3000

Wyświetl plik

@ -112,7 +112,7 @@
<div class="taskItem"><strong>Images:</strong> <span data-bind="text: info().imagesCount"></span></div>
<div class="taskItem"><strong>Status:</strong> <span data-bind="text: statusDescr()"></span></div>
<div class="taskItem"><strong>Time Elapsed:</strong> <span data-bind="text: timeElapsed()"></span></div>
<div class="taskItem"><strong>Output:</strong> <a href="javascript:void(0);" data-bind="click: viewOutput, visible: !viewingOutput()">View</a><a href="javascript:void(0);" data-bind="click: hideOutput, visible: viewingOutput()">Hide</a></div>
<div class="taskItem"><strong>Output:</strong> <a href="javascript:void(0);" data-bind="click: viewOutput, visible: !viewingOutput()">View</a><a href="javascript:void(0);" data-bind="click: hideOutput, visible: viewingOutput()">Hide</a> | <a href="#" data-bind="click: downloadOutput">Download</a></a></div>
<textarea class="consoleOutput" data-bind="value: output().join('\n'), visible: viewingOutput(), event: {mouseover: consoleMouseOver, mouseout: consoleMouseOut}, attr: {id: 'console_' + uuid}"></textarea>
<span data-bind="css: 'statusIcon glyphicon ' + icon()"></span>

Wyświetl plik

@ -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("<br/>"));
})
.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." });
@ -261,8 +264,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() {