kopia lustrzana https://github.com/OpenDroneMap/WebODM
Added buttons to download and copy to clipboard task outputs;Added copyTaskoutput function;
rodzic
b1aad7cdc4
commit
5be01ae88d
|
@ -86,6 +86,16 @@ class Console extends React.Component {
|
||||||
saveAs("data:application/octet-stream," + encodeURIComponent(this.state.lines.join("\r\n")), filename);
|
saveAs("data:application/octet-stream," + encodeURIComponent(this.state.lines.join("\r\n")), filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
copyTxt(){
|
||||||
|
const el = document.createElement('textarea');
|
||||||
|
el.value = this.state.lines.join("\r\n");
|
||||||
|
document.body.appendChild(el);
|
||||||
|
el.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
document.body.removeChild(el);
|
||||||
|
console.log("Task output copied to clipboard");
|
||||||
|
}
|
||||||
|
|
||||||
tearDownDynamicSource(){
|
tearDownDynamicSource(){
|
||||||
if (this.sourceTimeout) clearTimeout(this.sourceTimeout);
|
if (this.sourceTimeout) clearTimeout(this.sourceTimeout);
|
||||||
if (this.sourceRequest) this.sourceRequest.abort();
|
if (this.sourceRequest) this.sourceRequest.abort();
|
||||||
|
|
|
@ -45,6 +45,7 @@ class TaskListItem extends React.Component {
|
||||||
this.startEditing = this.startEditing.bind(this);
|
this.startEditing = this.startEditing.bind(this);
|
||||||
this.checkForCommonErrors = this.checkForCommonErrors.bind(this);
|
this.checkForCommonErrors = this.checkForCommonErrors.bind(this);
|
||||||
this.downloadTaskOutput = this.downloadTaskOutput.bind(this);
|
this.downloadTaskOutput = this.downloadTaskOutput.bind(this);
|
||||||
|
this.copyTaskOutput = this.copyTaskOutput.bind(this);
|
||||||
this.handleEditTaskSave = this.handleEditTaskSave.bind(this);
|
this.handleEditTaskSave = this.handleEditTaskSave.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,6 +206,10 @@ class TaskListItem extends React.Component {
|
||||||
this.console.downloadTxt("task_output.txt");
|
this.console.downloadTxt("task_output.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
copyTaskOutput(){
|
||||||
|
this.console.copyTxt();
|
||||||
|
}
|
||||||
|
|
||||||
optionsToList(options){
|
optionsToList(options){
|
||||||
if (!Array.isArray(options)) return "";
|
if (!Array.isArray(options)) return "";
|
||||||
else if (options.length === 0) return "Default";
|
else if (options.length === 0) return "Default";
|
||||||
|
@ -497,7 +502,13 @@ class TaskListItem extends React.Component {
|
||||||
ref={domNode => this.console = domNode}
|
ref={domNode => this.console = domNode}
|
||||||
onAddLines={this.checkForCommonErrors}
|
onAddLines={this.checkForCommonErrors}
|
||||||
/>
|
/>
|
||||||
|
<a href="javascript:void(0);" onClick={this.downloadTaskOutput} class="btn btn-sm btn-primary pull-right" title="Download task output">
|
||||||
|
<i class="fa fa-download"></i>
|
||||||
|
</a>
|
||||||
|
<a href="javascript:void(0);" onClick={this.copyTaskOutput} class="btn btn-sm btn-primary pull-right" title="Copy task output">
|
||||||
|
<i class="fa fa-clipboard"></i>
|
||||||
|
</a>
|
||||||
|
<div class="clearfix"></div>
|
||||||
{showMemoryErrorWarning ?
|
{showMemoryErrorWarning ?
|
||||||
<div className="task-warning"><i className="fa fa-support"></i> <span>It looks like your processing node ran out of memory. If you are using docker, make sure that your docker environment has <a href={memoryErrorLink} target="_blank">enough RAM allocated</a>. Alternatively, make sure you have enough physical RAM, reduce the number of images, make your images smaller, or reduce the max-concurrency parameter from the task's <a href="javascript:void(0);" onClick={this.startEditing}>options</a>.</span></div> : ""}
|
<div className="task-warning"><i className="fa fa-support"></i> <span>It looks like your processing node ran out of memory. If you are using docker, make sure that your docker environment has <a href={memoryErrorLink} target="_blank">enough RAM allocated</a>. Alternatively, make sure you have enough physical RAM, reduce the number of images, make your images smaller, or reduce the max-concurrency parameter from the task's <a href="javascript:void(0);" onClick={this.startEditing}>options</a>.</span></div> : ""}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue