Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,15 @@ <h3 class="h3-xs mt-4">Job Details</h3>
</table>
</div>

<h3 class="h3-xs mt-4">Screen Output</h3>
<div class="mb-1 mt-4 d-flex justify-content-between align-items-center">
<h3 class="h3-xs mb-0">Screen Output</h3>
<button *ngIf="isRTool && hasInputLines" class="btn btn-sm btn-secondary" (click)="toggleInputLines()">
{{ hideInputLines ? "Show input lines" : "Hide input lines" }}
</button>
</div>

<div class="text-sm bg-white border container">
<pre style="margin-bottom: 0em">{{ screenOutput }}</pre>
<pre style="margin-bottom: 0em">{{ filteredScreenOutput }}</pre>
<i *ngIf="isRunning" class="fas fa-circle-notch fa-spin fa-fw"></i>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,30 @@ export class JobComponent implements OnInit, OnDestroy {
tool: Tool;
parameterLimit = 12;
rSessionInfoVisible = false;
hideInputLines = true;
filteredScreenOutput: string = null;
hasInputLines = false;
isRTool = false;

toggleInputLines() {
this.hideInputLines = !this.hideInputLines;
this.filteredScreenOutput = this.filterScreenOutput();
}

private filterScreenOutput(): string {
if (!this.hideInputLines || !this.screenOutput) {
return this.screenOutput;
}
const lines = this.screenOutput.split("\n");
let prevWasInput = false; // this for clarity instead of reduce
return lines
.filter((line) => {
const isInput = line.startsWith(">") || (prevWasInput && line.startsWith("+"));
prevWasInput = isInput;
return !isInput;
})
.join("\n");
}

private unsubscribe: Subject<any> = new Subject();
// noinspection JSMismatchedCollectionQueryUpdate
Expand Down Expand Up @@ -61,6 +85,7 @@ export class JobComponent implements OnInit, OnDestroy {
this.parameterListForView = [];
this.inputListForView = [];
this.outputListForView = [];
this.hideInputLines = true;
let jobId = null;

if (selectedJobs && selectedJobs.length > 0) {
Expand Down Expand Up @@ -109,6 +134,9 @@ export class JobComponent implements OnInit, OnDestroy {
this.failed = !JobService.isSuccessful(job);
this.state = capitalize(job.state);
this.screenOutput = job.screenOutput;
this.isRTool = job.toolId?.endsWith(".R") ?? false;
this.hasInputLines = this.screenOutput?.split("\n").some((line) => line.startsWith(">")) ?? false;
this.filteredScreenOutput = this.filterScreenOutput();
this.duration = JobService.getDuration(job);

if (job.outputs != null) {
Expand Down Expand Up @@ -216,9 +244,9 @@ export class JobComponent implements OnInit, OnDestroy {
}

showInputs(inputs: JobInput[], tool: Tool) {
/* The new Chipster has misleadingly saved dataset name in input.displayName at
least between 2018-2023. Try to find the displayName from the current tool
instead, otherwise show the plain inputId.
/* The new Chipster has misleadingly saved dataset name in input.displayName at
least between 2018-2023. Try to find the displayName from the current tool
instead, otherwise show the plain inputId.
*/
inputs.forEach((jobInput) => {
const _clone = clone(jobInput);
Expand Down