kopia lustrzana https://github.com/OpenDroneMap/NodeODM
Better view console output UI
rodzic
d3249141c5
commit
d81932df33
|
@ -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>
|
||||
|
|
|
@ -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." });
|
||||
|
|
Ładowanie…
Reference in New Issue