Skip to content

Commit 28f37f0

Browse files
feat: add ability to shift click log expand to expand all (#6629)
Signed-off-by: Maxime Caruchet <maxime.caruchet@corp.ovh.com>
1 parent 12af8fc commit 28f37f0

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

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

+18-4
Original file line numberDiff line numberDiff line change
@@ -321,20 +321,34 @@ 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) {
325325
let step = this.steps[index];
326+
327+
let limit = `${this.expandLoadLinesCount}`;
328+
if (event.shiftKey) {
329+
limit = '0';
330+
}
331+
326332
let result = await this._workflowService.getLogLines(step.link,
327-
{ offset: `${step.lines[step.lines.length - 1].number + 1}`, limit: `${this.expandLoadLinesCount}` }
333+
{offset: `${step.lines[step.lines.length - 1].number + 1}`, limit: limit}
328334
).toPromise();
329335
this.steps[index].totalLinesCount = result.totalCount;
330336
this.steps[index].lines = step.lines.concat(result.lines.filter(l => !step.endLines.find(line => line.number === l.number)));
331337
this._cd.markForCheck();
332338
}
333339

334-
async clickExpandStepUp(index: number) {
340+
async clickExpandStepUp(index: number, event: MouseEvent) {
335341
let step = this.steps[index];
342+
343+
let offset = `-${step.endLines.length + this.expandLoadLinesCount}`;
344+
let limit = `${this.expandLoadLinesCount}`;
345+
if (event.shiftKey) {
346+
offset = `${step.lines[step.lines.length - 1].number + 1}`;
347+
limit = '0';
348+
}
349+
336350
let result = await this._workflowService.getLogLines(step.link,
337-
{ offset: `-${step.endLines.length + this.expandLoadLinesCount}`, limit: `${this.expandLoadLinesCount}` }
351+
{ offset: offset, limit: limit }
338352
).toPromise();
339353
this.steps[index].totalLinesCount = result.totalCount;
340354
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)