Skip to content

Commit 6a9e291

Browse files
feat: add ability to shift click log expand to expand all
Signed-off-by: Maxime Caruchet <maxime.caruchet@corp.ovh.com>
1 parent f1a8c41 commit 6a9e291

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

ui/src/app/views/workflow/run/node/pipeline/workflow-run-job/workflow-run-job.component.ts

+12-4
Original file line numberDiff line numberDiff line change
@@ -321,20 +321,28 @@ export class WorkflowRunJobComponent implements OnInit, OnDestroy {
321321
return DurationService.duration(fromM.toDate(), to ? to.toDate() : moment().toDate());
322322
}
323323

324-
async clickExpandStepDown(index: number) {
324+
async clickExpandStepDown(index: number, event: MouseEvent) {
325+
let limit = this.expandLoadLinesCount
326+
if (event.shiftKey) {
327+
limit = 0
328+
}
325329
let step = this.steps[index];
326330
let result = await this._workflowService.getLogLines(step.link,
327-
{ offset: `${step.lines[step.lines.length - 1].number + 1}`, limit: `${this.expandLoadLinesCount}` }
331+
{ offset: `${step.lines[step.lines.length - 1].number + 1}`, limit: `${limit}` }
328332
).toPromise();
329333
this.steps[index].totalLinesCount = result.totalCount;
330334
this.steps[index].lines = step.lines.concat(result.lines.filter(l => !step.endLines.find(line => line.number === l.number)));
331335
this._cd.markForCheck();
332336
}
333337

334-
async clickExpandStepUp(index: number) {
338+
async clickExpandStepUp(index: number, event: MouseEvent) {
339+
let limit = this.expandLoadLinesCount
340+
if (event.shiftKey) {
341+
limit = 0
342+
}
335343
let step = this.steps[index];
336344
let result = await this._workflowService.getLogLines(step.link,
337-
{ offset: `-${step.endLines.length + this.expandLoadLinesCount}`, limit: `${this.expandLoadLinesCount}` }
345+
{ offset: `-${step.endLines.length + this.expandLoadLinesCount}`, limit: `${limit}` }
338346
).toPromise();
339347
this.steps[index].totalLinesCount = result.totalCount;
340348
this.steps[index].endLines = result.lines.filter(l => !step.lines.find(line => line.number === l.number)

ui/src/app/views/workflow/run/node/pipeline/workflow-run-job/workflow-run-job.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</div>
5656
</div>
5757
<div class="line expand" *ngIf="step.lines.length + step.endLines.length < step.totalLinesCount"
58-
(click)="clickExpandStepDown(i)">
58+
(click)="clickExpandStepDown(i, $event)">
5959
<div class="number">
6060
<i nz-icon nzType="caret-down" nzTheme="fill"></i>
6161
{{step.firstDisplayedLineNumber +
@@ -65,7 +65,7 @@
6565
</div>
6666
<div class="line expand"
6767
*ngIf="step.lines.length + step.endLines.length < (step.totalLinesCount - expandLoadLinesCount) - 1"
68-
(click)="clickExpandStepUp(i)">
68+
(click)="clickExpandStepUp(i, $event)">
6969
<div class="number"><i nz-icon nzType="caret-up" nzTheme="fill"></i>{{(step.firstDisplayedLineNumber +
7070
step.totalLinesCount) - step.endLines.length}}
7171
</div>

0 commit comments

Comments
 (0)